Hi,
background: My fullest exposure to XML is config files and as a very high-level understanding of WS-*. I now have a vendor that I need to communicate with, via XML. They have XSD's and sample XML files.
So I've got the xml schema file and a sample xml file from the vendor. (I don't know for certain that the one was used to generate the other).
I've used JAXB to generate
Java classes from the xsd, and wired up some dummy code and generated an XML file with
test data. My XML file does not match the sample the vendor has supplied.
This is what appears at the top of the vendor's sample XML File:
and this is what I get:
1) I've got a "standalone=yes' attribute - does that hurt?
2) my sample has no namespace prefixes (is that the right term?) anywhere. I believe this is alright, but is anyone aware of what JAXB API setting allows me to specify a NS to use in the output XML?
3) I'm totally missing the xmlns:xsi attribute from my root element. I believe that's why I'm getting the output of an xmlns:xsi attribute on my null elements. First, am I correct in that? and two: how do I put the xmlns:xsi element in my root element? I'm assuming it's another JAXB API setting. Or, perhaps this is all driven from the XSD, and the vendor has simply supplied me an XSD they created, and a hand-bombed XML file.
4) what is the purpose of the xmlns:xsi attribute in the XML File?
oh, I can share some code if that would help, but it's almost all generated via JAXB from the XSD. My only code is fairly typical "create some objects, fill them with data, marshal them to XML"