I'm trying to validate an XML document using Xerces-J.
I want the validator to pick up and resolve any associated XSD or DTD files (using schemalocation, nonamespaceschemalocationa and DOCTYPE references). It seems the loading of these resources can be delegated to a Resolver class.
However all the samples I've seen start off creating a validator from a schema.
Is it possible to drive this the other way around, ask xerces to validate the XML document, and have it load what it needs, or must I first parse the XML file looking for schema references, load them, then create a validator from the schemas?
In an ideal world the validator would also support xsd 1.1