[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Use of xsl:document
> 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/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|