This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: document() and node-list vs. tree fragment


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]