Re: [xsl] How can I know if a node has already been processed ?

Subject: Re: [xsl] How can I know if a node has already been processed ?
From: "Frédéric Choubelle" <djidjoenator@xxxxxxxxx>
Date: Fri, 7 Nov 2008 00:05:56 +0100
Thanks for your reply, M. Carlisle. It's very detailed and I looked at
your ctop.xsl and understood (I thnik) what you mean with the
apply[*[1][self::mml:inverse]] "trick". It might have been a solution,
but meanwhile, I've still been searching and found the "intermediate
tree" technique, which is very simple and I'm a bit upset with myself
that I didn't think of it earlier. Found this example in the W3C XSLT
2 recommandation :
-------------------------------------
<xsl:stylesheet
  version="2.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:import href="phase1.xsl"/>
<xsl:import href="phase2.xsl"/>

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

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

</xsl:stylesheet>
----------------------------------

So I process the mathml once first adding an attribute to the nodes I
don't want to process twice and it works. Plus, this technique will be
useful for many other things.

Thank you
Fridiric

Current Thread