I have an XML that looks like this and a corresponding xsd with it.
<books>
<book name="book1" id="book1">
<name>Harry Potter</name>
...........
</book>
...........
</books>
Please see that 'name' is appearing twice, once as an attribute in tag, and also as an element under tag. Apparently that is invalid syntax, I am not sure.
When I am trying to generate java classes for this using xjc command (of JAXB), it compains about the invalid duplicate entry in xsd file.
But, I am able to generate C# classes for the xsd using, xsd command in VS 2008.
I have three questions.
Is that XML syntax wrong?
Why is it that xjc(of JAXB) reports error while xsd(of VS2008) does not?
Is there any way I can get xjc(of JAXB) to generate classes (without me having to alter the XML/XSD file) ?
I don't want to alter XML/XSD file as it is 20,000 line file. But that is the last option for me.