[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Use of xsl:document

Subject: RE: Use of xsl:document
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 22 Jun 2006 12:27:03 +0100
xsl document kay
> I wish to store an external XML file as the value of an XSLT 
> variable using XSLT 2.0. This is how it is presently being acheived:
> 
> <xsl:variable name="Xml" as="document-node()" 
> select="document('test.xml')"/>

That's the correct way to do it.
> 
> Should I be using the xsl:document function instead?
> If I should, why?
> Is there any use for the xsl:document function other than the 
> fact it allows validation?

xsl:document is an instruction, not a function. It allows you to construct a
document within the stylesheet, rather than reading an external file such as
text.xml.

You can construct a document implicitly using

<xsl:variable name="x">
  <test>
     <data/>
  </test>
</xsl:variable>

Using xsl:document makes this more explicit and provides access to extra
functionality such as validation.

Michael Kay
http://www.saxonica.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.