I would like to validate XML files against two different XSD, knowing that the XML file does not have to be validated against both of them but only one of them. Then I need to know which XSD file validates the XML file in order to access different elements.
The XSD files are of this types: sdf and csdf but I have my own versions so I do not use the schema present in the XML header (and I don't want to require the user to modify this).
Question: how to easily do the validation test and then parse the XML file (according to the right schema) using a single xml library (and if possible jdom2) ?
Currently I use javax for the validation and jdom2 to access elements but I think/hope it is possible to do the same thing using one single library, at least in order to do not parse again and again the files. And well, as pointed out in a smilar question, I'd prefer to do not take drugs in order to understand how javax works.