xsl-list
[Top] [All Lists]

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

2007-11-04 08:22:26
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.)


Hi Scott,

In the quote above by "FXSL" do you mean the Functional programming
Library for XSLT (http://fxsl.sf.net) or something else?

FXSL for XSLT 1.0 does rely on the exslt:node-set() function. FXSL for
XSLT 2.0 does not use exslt:node-set() and any extension functions at
all.



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play



On 10/11/07, Scott Trenda <Scott(_dot_)Trenda(_at_)oati(_dot_)net> wrote:
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[(_at_)id=1]) =
generate-id(exsl:node-set($rtf)/node[(_at_)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(_at_)nag(_dot_)co(_dot_)uk]
Sent: Thursday, October 11, 2007 9:44 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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.
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • Re: [xsl] More addition questions: Using node-set(), Dimitre Novatchev <=