This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: document() and node-list vs. tree fragment
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] document() and node-list vs. tree fragment
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Thu, 27 Sep 2001 17:37:50 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
> On Linux Xalan C++ v 1.1 I can use
>
> <xsl:variable name="f2">
> <xsl:copy-of select="document('testfile2.xml')"/>
> </xsl:variable>
>
> and later
>
> <xsl:apply-templates select="$f2"/>
>
It's not allowed in XSLT 1.0; it is allowed by the "defunct" XSLT 1.1
working draft. In XSLT 1.0, $f2 is not a node-set, it is a result tree
fragment; to convert it to a node-set, you have to use the product-specific
node-set() extension function.
But why are you doing this?
What's wrong with <xsl:apply-templates select="document('testfile2.xml')"/>?
Or if you must have a variable,
<xsl:variable name="f2" select="document('testfile2.xml')"/>?
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list