This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I am using JAXB to unmarshall XML to java using DTD . Since , DTD is on my local machine I have to use EntityResolver as follows :
The above code populates the Java objects corresponding to elements as desired but for attributes it does not bind.I have also read that there is an existing defect in JAXB that does not bind attributes with Java Objects if EntityResolver is used.
Is there any workaround please as I am stuck on that ? [ December 04, 2008: Message edited by: tanu dua ]
You create the EntityResolver but don't use it, as far as I can see.
I have also read that there is an existing defect in JAXB that does not bind attributes with Java Objects if EntityResolver is used.
I don't see how JAXB would know that an EntityResolver is being used. That's transparent to users of the parser. Of course it's possible to use an EntityResolver imperfectly, but since you didn't post a link to that rumour, I can't really address it in any useful way.
Joined: Apr 05, 2004
My Bad ! I have not attached the correct code.Here is the correct code:
I have set the entity resolver for XmlReader object and on unmarshalling all the elements are binded but attributes did not get bind.
I have seen this link while serching on teh net . The other person also having this problem , may be we both are doing something wrong or there is a defect in the Jaxb.