I have a JAXB namespace formatting problem with XML files: The XML file format that JAXB accepts is different from the format I need to follow, and I'm not able to read/write xml files in my format.
I have 2 schema files that I'm using, and have been able to create the appropriate
java files for JAXB. I can even read and write XML files such as the one below:
Unfortunately, the above format doesn't match the pre-existing format convention that I have to continue following:
this format has been used by other, non-Java code that we're still using, and other users use this file in the current format, so I can't change the format suddenly. So there really isn't a way for me to just change the current xml file format for my needs.
As a result, I need to make my xml files look like the following:
With this format, JAXB correctly identifies the number of entries in coordmap (2 point targets
and one polygon) and loads their names, but the site and coordinate information is not loaded (I get Null/zero entries). I get no error messages that there was a problem -- I only realized what was going on when I tried to write an xml file and saw the format change. The above format is purportedly following the W3C format conventions, which JAXB is supposed to support, but I'm not an expert on that and I could be wrong. Regardless, I have to stick with that format.
Is there a way that I can get JAXB to handle my format or am I better off starting with something else/from scratch? I don't mind modifying the JAXB code if I can get at it the right part. If I'm better off writing my own, specialized parser, I'd rather get started now rather than burn time on trying to force JAXB to do it.
Any thoughts?