I am trying to validate an XML document using Xerces-J.
I want the validator to collect and resolve any related XSD or DTD files (using schemas, nonamespaceschemalocationa and DOCTYPE links). It seems that loading these resources can be delegated to the Resolver class.
However, all the samples that I saw begin with creating a validator from the schema.
Is it possible to manage this way, ask xerces to check the XML document and load what it needs, or should I first parse the XML file looking for links to the schema, load them, and then create a validator from the schemas?
In an ideal world, the validator will also support xsd 1.1
source
share