Example of Calling the document() Function

Suppose you have the following XML document:

<?xml version="1.0" encoding="UTF-8"?> 
               
<books> 
               

              
<bookstore>bookstore1:bookstore1.xml</bookstore> 
                   
<bookstore>bookstore2:bookstore2.xml</bookstore> 
                   
<bookstore>bookstore3:bookstore3.xml</bookstore>
                   

                
</books>

The following query returns the bookstore elements:

/books/bookstore
               

            

Now suppose you pass this query to the document() function as follows:

document(/books/bookstore)
               

            

This query returns the root nodes of bookstore1.xml, bookstore2.xml, and bookstore3.xml.

XQuery Editor

Stylus Studio's XQuery development tools are a tremendous help in building and testing XML applications requiring a standards-based approach to querying, integrating and transforming data from various distributed data sources.

Accessing Relational Databases as XML with Stylus Studio's File Explorer

This demonstration is the first part of our series on working with relational and XML data, covering how to use Stylus Studio's File Explorer to connect to and query relational database tables as XML.

XML File Explorer

The XML File Explorer provides a productive, consistent, and easy-to-use interface for working with any data sources (relational data, EDI, binary, XML, CSV, and more) used in enterprise data integration projects.

Stylesheet Design - How to Publish your Data Using a Stylesheet Designer

Simplify Stylesheet Design with Stylus Studio's XML Publisher, a visual stylesheet designer and code generator to help you create XSLT or XQuery to publish your data to HTML+CSS or XSL:FO.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member