xsl-list
[Top] [All Lists]

Re: double pass in XSLT2

2003-02-20 12:07:25
Hi Tobi,

how would I write a double pass (eg
http://www.biglist.com/lists/xsl-list/archives/200302/msg00306.html )
in XSLT2?

Just drop the xx:node-set() call -- in XSLT 2.0 a variable set using
its content gets set to the document node of the tree constructed by
the content:

<xsl:variable name="temp">
  <xsl:apply-templates select="/" mode="phase1"/>
</xsl:variable>

<xsl:template match="/">
  <xsl:apply-templates select="$temp" mode="phase2"/>
</xsl:template>

I prefer the $temp variable to be declared within the template for the
document node, but that's just a stylistic thing.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>