SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Conditions of Use
Using XSLT 2.0
Using XQuery
Handling Source Documents
| Handling Source Documents
» | Source Documents on the Command Line
| Collections
| Building a Source Document from an application
| Writing input filters
| XInclude processing
| Saxon and XML 1.1
| JAXP Source Types
| Third-party Object Models: DOM, JDOM, XOM, and DOM4J
| Choosing a Tree Model
| The PTree File Format
| Validation of Source Documents
| Whitespace Stripping in Source Documents
| Streaming of Large Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# Source Documents on the Command Line

When Saxon (either XSLT or XQuery) is invoked from the command line, the source document will normally be an XML 1.0 document. Supplying an XML 1.1 document will also work, provided that (a) the selected parser is an XML 1.1 parser, and (b) the command line option `-1.1` is set.

If a custom parser is specified using the -x option on the command line, then the source document can be in any format accepted by this custom parser. The only constraint is that the parser must behave as a SAX2 parser, delivering a stream of events that define a virtual XML document. For example, the TagSoup parser from John Cowan can be used to feed an HTML document as input to Saxon.

Non-standard input formats can also be handled by specifying a user-written URIResolver. If the `-u` option is used on the command line, or if the source file name begins with `http://` or `file://`, then the source file name is resolved to a JAXP Source object using the URIResolver; if a user-written URIResolver is nominated (using the `-r` option) then this may translate the file name into a Source object any way that it wishes.

Next