any

View: New views
5 Messages — Rating Filter:   Alert me  

any

by Lulseged :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

any

Hi

 I wonder what JAXB is doing with xs:anyAttribute and xs:any? (red text).

 It is used for extensibility. May include one or more elements from any other namespaces.

 If JAXB handles extensible types, are there any examples some where?

<xs:complexType name="externalType">
        <xs:sequence>
     
  <xs:element name="display-name" type="display-nameType" minOccurs="0"/>
     
  <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
     <xs:attribute name="anchor" type="xs:anyURI"/>
    
<xs:anyAttribute namespace="##other" processContents="lax"/>
</xs:complexType>
.
.
.
.
<xs:sequence>
      <xs:element name="display-name" type="display-nameType"
minOccurs="0"/>
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                <xs:choice>
                        <xs:element name="list">
                                <xs:complexType>
                                        <xs:complexContent>
                                                <xs:extension base="listType"/>
                                        </xs:complexContent>
        
                       </xs:complexType>
       
                </xs:element>
     
          <xs:element name="external" type="externalType"/>
                        <xs:element name="entry" type="entryType"/>
       
                <xs:element name="entry-ref" type="entry-refType"/>
     
  </xs:choice>
        </xs:sequence>
        <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
.
.
.

Lulseged


Re: any

by Aleksei Valikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

>  I wonder what JAXB is doing with xs:anyAttribute and xs:any? (red text).
>
>  It is used for extensibility. May include one or more elements from any
> other namespaces.
>
>  If JAXB handles extensible types, are there any examples some where?

Yes, these cases are supported. You'll get @XmlAnyElement,
@XmlAnyAttribute or other things depending on the schema.
Try compiling.

Bye.
/lexi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


RE: Re: any

by Lulseged :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks

I have already compiled and get @XmlAnyElement, @XmlAnyAttribute.

But when unmarshalling a document, how do I access this elements?

Lulseged

-----Original Message-----
From: aleksei.valikov@... [mailto:aleksei.valikov@...] On
Behalf Of Aleksei Valikov
Sent: den 12 november 2009 15:55
To: users@...
Subject: Re: any

Hi,

>  I wonder what JAXB is doing with xs:anyAttribute and xs:any? (red
text).
>
>  It is used for extensibility. May include one or more elements from
> any other namespaces.
>
>  If JAXB handles extensible types, are there any examples some where?

Yes, these cases are supported. You'll get @XmlAnyElement,
@XmlAnyAttribute or other things depending on the schema.
Try compiling.

Bye.
/lexi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Re: any

by Aleksei Valikov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

> I have already compiled and get @XmlAnyElement, @XmlAnyAttribute.
>
> But when unmarshalling a document, how do I access this elements?

Have you tried reading the Javadoc for starters?
@XmlAnyElement will give you DOM Element or unmarshalled object
depending on lax settings. @XmlAnyAttribute is basically a Map<QName,
String>.

Bye.
/lexi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: Re: any

by Wolfgang Laun-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Read https://jaxb.dev.java.net/tutorial/section_6_2_7_5-Collecting-Unspecified-Attributes-XmlAnyAttribute.html
and https://jaxb.dev.java.net/tutorial/section_6_2_7_6-Collecting-Unspecified-Elements-XmlAnyElement.html

-W




On Thu, Nov 12, 2009 at 4:21 PM, Lulseged Zerfu <lulseged.zerfu@...> wrote:
Thanks

I have already compiled and get @XmlAnyElement, @XmlAnyAttribute.

But when unmarshalling a document, how do I access this elements?

Lulseged

-----Original Message-----
From: aleksei.valikov@... [mailto:aleksei.valikov@...] On
Behalf Of Aleksei Valikov
Sent: den 12 november 2009 15:55
To: users@...
Subject: Re: any

Hi,

>  I wonder what JAXB is doing with xs:anyAttribute and xs:any? (red
text).
>
>  It is used for extensibility. May include one or more elements from
> any other namespaces.
>
>  If JAXB handles extensible types, are there any examples some where?

Yes, these cases are supported. You'll get @XmlAnyElement,
@XmlAnyAttribute or other things depending on the schema.
Try compiling.

Bye.
/lexi

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...