Marco Ehrentreich wrote:Hi,
do you know JAXB? With the JAXB framework you can define a mapping between XML elements and Java classes and JAXB takes care of the marshalling and unmarshalling for you. If you have an explicit schema for you XML documents it's even more easier because JAXB can automatically create the necessary Java classes for the schema.
Of course this is not DOM but in my opinion it's much more handy to use ordinary Java classes with annotations instead of DOM objects.
Marco
Ulf Dittmer wrote:What do you mean by "DOM code for that xml"? DOM is just an API - what should the code do?
Marco Ehrentreich wrote:Hi Shobhit,
Anyway I think it should be possible to use JAXB (if you want to). I guess your only way is to create the corresponding annotated classes for XML elements by hand and turn off explicit validation if this would fail when marshalling or unmarshalling XML documents. Have you already tried to do it manually? As I said, I never used JAXB for invalid XSDs myself but I'm pretty sure you can still use it even though your schema is invalid.
Marco
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |