Building the Source Document
The first thing the application must do is to build the source document, in the form of a tree.
The simplest approach is to use the sequence:
String systemId = new File(sourceFile).toURL().toString();
DocumentInfo doc = new XPathEvaluator().buildDocument(
new SAXSource(new InputSource(systemId)));
You can define the parser to be used by supplying a parser within the
If you don't supply a parser, Saxon will select one
using the JAXP mechanisms, specifically, the system property
If you want to use different parsers depending on the URI of the document being read,
you can achieve this by writing a
URIResolver that nominates the parser to be used for each
For more information about the different ways of loading source documents, see
Handling Source Documents.