I'm having to work with some really poor XML from a supplier
my customer uses. They're use of namespaces is very
questionable and is giving me a lot of grief. I need either to
turn off namespace matching in Jibx, or I need the ability to
specify mappings that can appear in more than one namespace.
Any suggestions?There's a public void setDocument(java.io.Reader rdr, java.lang.String name, boolean nsa) method in the org.jibx.runtime.impl.UnmarshallingContext that allows you to disable namespace handling by the parser. I believe that if you disable the namespaces you get the entire name, including any prefix used in the XML document. If you need to worry about stripping off prefixes you may need to use your own parser wrapper class for that purpose, which would implement the IXMLReader interface. See the org.jibx.runtime.impl.XMLPullReaderFactory and StAXReaderFactory code for the XMLPull and StAX wrapper implementations.