users@jaxb.java.net

Re: dublin core SimpleLiteral

From: Joe Fialli <Joseph.Fialli_at_Sun.COM>
Date: Fri, 16 Sep 2005 09:30:28 -0400

Joe Fialli wrote:

> Aleksei Valikov wrote:
>
>> Hi.
>>
>> I have trouble compiling the following complex type:
>>
>> <xs:complexType name="SimpleLiteral">
>> <xs:complexContent mixed="true">
>> <xs:restriction base="xs:anyType">
>> <xs:sequence>
>> <xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
>> </xs:sequence>
>> <xs:attribute name="scheme" type="xs:anyURI" use="optional" />
>> </xs:restriction>
>> </xs:complexContent>
>> </xs:complexType>
>>
>> XJC complains that "Content" property is empty.
>
>
> It is true that there are no children elements, but there is text due to
> the mixed="true" so XJC is just missing this boundary case.
>
>>
>> I understand that the type looks a bit stupid. This is from the
>> official Dublin Core schemas:
>> http://www.ukoln.ac.uk/metadata/dcmi/xmlschema/
>> I think XJC should process this gracefully. What would the spec
>> people say? Joe?
>>
> If it is legal schema, JAXB needs to be able to handle it.

Just following up.

Could you file an issue against JAXB 1.0 RI?

The example compiles in the build of JAXB 2.0 RI that I just tried it on.
The generated code correctly points out that only text info can be placed
into the property (since placing a String instance into the getContent()
represents
text info in JAXB view of XML document). If elements could be added,
the List<String> would have been a List<Object>.

  /**
     * Gets the value of the content property.
     *
     <deleted>
     * <p>
     * Objects of the following type(s) are allowed in the list
     * {_at_link String }
     *
     *
     */
    public List<String> getContent() {
        return this._getContent();
    }

-Joe

>
> -Joe
>
>
>> Bye.
>> /lexi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>