I have several large DTD files. I've used trang to convert them into XSD files, so I could easily use it from JAXB and other utilities. However, the generated XSD file has all declared elements at the top level. It means that any element could be root element of an input XML. I want to specify only a particular element.
Having these multiple root elements causes a few problems, e.g. xjc
generates @XmlRootElement
for all classes, so I need to add more additional checks.
As I understand, I need to rewrite the generated XSD, moving <xs:element>
s to <xs:complexType>
s, changing element ref
s into element type
s and so on, but this would be too much monkey work, with no way to verify if all done correctly.
Is there a more efficient way to do this?
<start>
, but it is poorly supported,xjc
failed with it). – Girish