Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project


   







XSLT FUNCTION:  document

node-set = document(uri, base-uri)
 
The document function is used to locate an external XML document, to parse that XML document, and to return a node-set that contains the root node.
 
It is presumed that the XML document is valid and can be parsed. If the external XML document cannot be located, or the provided URI (Uniform Resources Identifier) is invalid, or the document is not valid XML, then the XSLT processor may either declare an error or return an empty node-set.
 
A fundamental problem is that this function may return a result tree fragment that is not well-formed. (About all that you can do with such a fragment is to convert it to a Boolean or a string.)
 
uri
 
The mandatory uri attribute defines the absolute or relative URI for an XML document. If a relative URI is provided, it will be considered relative to the base URI of the stylesheet containing the function call. If this argument is the empty string, document(' '), then the the root node of the stylesheet from where the function call was made is returned. Or, if this argument is the empty string and the function call was made as part of an exported or included stylesheet, then the root node of that exported or included stylesheet is returned.
 
base-uri
 
The optional base-uri attribute provides a base URI to help resolve a relative URI provided in the uri attribute. If this argument is the empty string, document(' '), then the root node of the stylesheet from where the function call was made is returned.
 
Two code fragments are displayed:
 
<xsl:variable name="example" select="document(@href)"> ...
<xsl:apply-template select="document(@text)" /> ...

 

 
 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information