Example of Calling the document() Function

Suppose you have the following XML document:

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



The following query returns the bookstore elements:



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



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

Free Stylus Studio XML Training:
W3C Member