<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="sourcedocs" page="command-line" subpage=""/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Source Documents on the Command Line</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: Source Documents on the Command Line"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>Source Documents on the Command Line</h1> <p>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 <code>-1.1</code> is set.</p> <p>If a custom parser is specified using the <code>-x</code> 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 <a href="http://www.tagsoup.info/" class="bodylink">TagSoup</a> parser from John Cowan can be used to feed an HTML document as input to Saxon.</p> <p>Non-standard input formats can also be handled by specifying a user-written <code>URIResolver</code>. If the <code>-u</code> option is used on the command line, or if the source file name begins with <code>http://</code> or <code>file://</code>, then the source file name is resolved to a JAXP Source object using the <code>URIResolver</code>; if a user-written <code>URIResolver</code> is nominated (using the <code>-r</code> option) then this may translate the file name into a Source object any way that it wishes.</p> <table width="100%"> <tr> <td> <p align="right"><a class="nav" href="collections.xml">Next</a></p> </td> </tr> </table> </body> </html>