RE: [xsl] More addition questions: Using node-set()

Subject: RE: [xsl] More addition questions: Using node-set()
From: "Scott Trenda" <Scott.Trenda@xxxxxxxx>
Date: Thu, 11 Oct 2007 10:20:35 -0500
I had thought that node-set() was a trivial operation before, but the
Mozilla devs keep barking about how it's non-trivial and difficult to
hack into Transformiix. It got me thinking.

In XSLT 1.0, when a RTF is converted to a node-set, how are IDs and keys
computed? Will the following be true?

<xsl:variable name="rtf">
    <node id="1"/>
    <node id="2"/>
</xsl:variable>
<xsl:if test="generate-id(exsl:node-set($rtf)/node[@id=1]) =
generate-id(exsl:node-set($rtf)/node[@id=2])">true</xsl:if>

Keys... well, if your context node's document is the source document,
there's no question, but will the key access the variable's nodes if I
use something like this?
    <xsl:for-each select="exsl:node-set($rtf)">
      content
    </xsl:for-each>
If so, are the keys recomputed every time it's called, or only once,
when the node-set is constructed for the first time?

I guess the common part of what I'm trying to ask is, once you have a
RTF captured in a variable, does node-set() return a newly-constructed
node-set, or a reference to the node-set corresponding to that variable?
It'd be nice to know. (I have an experimental alternate FXSL
implementation that leans _heavily_ on node-set(), but I've been really
hesitant to start using it because I have no idea how its performance
will be compared to "pure" XSLT 1.0.)

~ Scott


-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Thursday, October 11, 2007 9:44 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] More addition questions: Using node-set()


> and I do this 2-3 times for different problem sets in say the same
> template,

node-set in most implementations is cheap (in some  it's essentially a
no-op) In XSLT2 the distingction between result tree fragment and node
set goes away (and with it the need for a function)

David

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________

Current Thread