<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="using-xquery" page="resultformat" subpage=""/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Result Format</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: Result Format"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>Result Format</h1> <p>The result of a query is a sequence of nodes and atomic values - which means it is not, in general, an XML document. This raises the question as to how the results should be output.</p> <p>The Saxon command line processor for XQuery by default produces the output in raw format. This converts the result sequence to a document following the rules of the XQuery <code>document{}</code> constructor, and then serializes this document.</p> <p>The alternative is wrapped format, requested using the <code>-wrap</code> argument. This wraps the result sequence as an XML document, and then serializes the resulting document. Each item in the result sequence is wrapped in an element (such as <code>result:element</code> or <code>result:atomic-value</code>) according to its type. The sequence as a whole is wrapped in a <code>result:sequence</code> element.</p> <table width="100%"> <tr> <td> <p align="right"><a class="nav" href="querycompilation.xml">Next</a></p> </td> </tr> </table> </body> </html>