Hi Wolfgang,
I am just trying to understand how to handle a variable of type
java.lang.Object in a JAXB class. Is it possible to read any content into
such a generic variable even if the JAXBContext does not know about the
corresponding XML element?
For example, suppose a schema is associated with the namespace "foo". It is
mapped to a set of JAXB classes. One of these classes contains an attribute
of type java.lang.Object. An XML instance document contains an element
associated with the namespace "bar" as corresponding property element. Would
this element be returned as java.lang.Object by the getter of that class
even if the JAXBContext does not know about the namespace "bar"? Or would
this require to explicitly bind the xsd:anyType property to DOM using a JAXB
binding declaration?
Cheers,
Claus
Von: Wolfgang Laun [mailto:wolfgang.laun_at_gmail.com]
Gesendet: Freitag, 6. November 2009 15:32
An: users_at_jaxb.dev.java.net
Betreff: Re: jaxb binding file for + <extension base="anyType"/>
This customization isn't possible. If properly constrained, xs:anyType might
be mapped to java.lang.Object anyway, but as it is now, you are getting
org.w3c.dom.Element, which means that you'll get the XML document tree
without any unmarshalling.
-W
On Fri, Nov 6, 2009 at 3:14 PM, indra_4011 <indra4011_at_gmail.com> wrote:
Hi i have xsd defination
<element name="primaryKey" nillable="false">
<complexType mixed="false">
<complexContent mixed="false">
<extension base="anyType"/>
</complexContent>
</complexType>
</element>
and i using binding file to
<jxb:bindings node="//xs:extension[@base='anyType']">
<jxb:property>
<jxb:baseType name="java.lang.Object"/>
</jxb:property>
</jxb:bindings> to generate the jaxb classes but i am unable to do
so its giving error
[xjc] [ERROR] Specified property customization is not used.
Please help
--
View this message in context:
http://old.nabble.com/jaxb-binding-file-for-%2B-%3Cextension-base%3D%22anyTy
pe%22-%3E-tp26230531p26230531.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net