Format of the document() Function

To query multiple documents with a single query, call the document() function in a query. During execution of a query on a particular document, this function allows you to access another XML document.

The format for the document() function is

node-set document(object, node-set?)
               

            

The XPath processor examines the first argument. If it is a single value (that is, it is not a node set) the XPath processor converts it to a string, if it is not already a string. Separate directory names and the file name with a forward slash (/). See the following format:

This string must be an absolute path. The XPath processor retrieves the specified document. The new context node is the root node of this document. Suppose you invoke the document() function and the requested document does not exist. If the invocation is in a stylesheet, the XPath processor returns an empty node set. If the invocation is anywhere else, the XPath processor returns an error message.

XML Well-Formedness Checker & XML Indenter

Tidy up your XML documents with powerful integrated XML editing utilities including a single-click XML formatter, pretty printer, XML indenter and XML well formedness checker.

XQuery Mapper

Stylus Studio has the industry's only XQuery mapper, enabling you to develop sophisticated XML mappings consisting of queries and data transformation in an intuitive, visual manner.

W3C XML Specifications

Learn about the official W3C XML specifications for XML, XSLT, XQuery, XPath, DOM, XML Namespaces, XInclude, XML Base, XPointer, WSDL and more.

XML Editing Views

Stylus Studio includes three synchronized XML editing views: Text View, Tree View, and Grid View, allowing you to work with and edit XML documents in whatever way suits you best.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member