Accessing remote documents

It is possible to access information stored in remote XML documents using the document() function. This function takes at least one, and possibly two parameters. The first parameter may be a string that consists of the URL for the remote document. The XSLT processor locates the document and then parses it to create an in-memory tree that can be accessed using XPath. For example, consider the following remote document:

					remote.XML
<book>
  <title>The Remote Book Title</title>
  <para>Remote paragraph.</para>
</book>

If this document is stored in the same directory as the stylesheet, it can be referenced using the function 'document('remote.XML')'. This function could be used as the first part of an XPath location path. ...

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.