Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Mapping xsd:anyType element to Java.lang.Object

717946Aug 18 2009
Hi,
I am using JAXB to parse a xml and in the XSD we have one element which is of the anyType and returns java.lang.object from JAXB generated classes. The issue is that when the node contains string and we type cast the returned object to string every thing runs fine but when the element contains embeded xml then the object returned can not be type cast to string.
code snippet:

*<xsd:element name="SignatureDefinition" type="xsd:anyType" />*
and the xml I am parsing contains:
*<SignatureDefinition>
<a>name</a>
<b> job</b>
</SignatureDefinition>*

That is the element contains a object which is a well formed xml.
Can any one guide or provide me the pointers.
Thanks

Regards,
Devesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 15 2009
Added on Aug 18 2009
0 comments
541 views