Building a Source Document from an application
With the Java s9api interface, a source document can be built using the
which is created using the factory method
newDocumentBuilder on the
Processor object. Various
options for document building are available as methods on the
DocumentBuilder, for example options
to perform schema or DTD validation, to strip whitespace, to expand XInclude directives, and also to choose the
tree implementation model to be used.
Similarly in the .NET API, there is a
DocumentBuilder object that can be created from the processor. This allows options
to be set controlling the way documents are built, and provides an overloaded
Build method allowing a tree to
be built from various kinds of source.
It is also possible to build a Saxon tree in memory by using the
Configuration object. (When using the JAXP Transformation API, the
can be obtained from the
TransformerFactory as the value of the attribute named
All the documents processed in a single transformation or query must be loaded using the same
Configuration. However, it is possible to copy a document from one
into another by supplying the
DocumentInfo at the root of the existing document
Source supplied to the
buildDocument() method of the new Configuration.