Unmarshalling using schema generated code from different packages
I have two independant schemas. I compiled each of them in different packages.
The first of them contains an xsd:any element.
The elements of the second schema are included in the xsd:any element of the first schema.
With the following tricks, I can marshall my object tree.
Making the NamespaceContext2 class of the second class inherit from the NamespaceContext2 class from the 1 schema.
Making the XMLSerializer class of the second class inherit from the XMLSerializer class from the 1 schema.
Making the XMLSerializable class of the second class inherit from the XMLSerializable class from the 1 schema.
in JAXBContext.newInstance, passing the package name of both schemas.
But unmarshalling makes a problem.
The unmarshalling mechanism is unable to find the unmarshaller class for the second schema.
I think that the grammar info for the second schema is not loaded in the context.
My code :
JAXBContext context = JAXBContext.newInstance("org.util.text.parser.ebnf.jaxb:org.util.parser.importer.sablecc.jaxb:org.util.w3c.xslt.jaxb");
Unmarshaller u = context.createUnmarshaller();
Is it possible to solve this in an easy way like
customizing binding or calling some methods to merge grammars manually ?