java - Parsing abstract objects without container tag with JAXB -
I JAXB to generate very specific XML schema and then the match schema XML parsing documents Want to do I have a summary class which is the basis for everything that will appear in XML. After that there are layout classes and widgets:
abstractViewElement {Private list in the public category & lt; AbstractViewElement & gt; children; ...} Public Square TextField AbstractViewElement {...} Expands Public Category Button AbstractViewElement {...}
Now, I want to be able to parse XML documents which More or less like this:
& lt; Ucl: Layout & gt; & Lt; UCL: Buttons & gt; & Lt; UCL: TextField / & gt; & Lt; / UCL: Layout & gt;
So, basically I "children" would get rid of the tag, which is normally required by the layout of Class I is I'm not sure how to set the XML namespace in Jeajiabi , Either ... help?
you can replace @XmlElementRef
on the children
property Comment, then annotate all your subclasses of SarviveAvilment
with @XmlRootElement
.
For namespace, you can use the package level @XmlSchema
annotation.
Comments
Post a Comment