Subject: Re: [xsl] "Tunneling" a parameter in document order From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 13 Apr 2012 13:01:53 -0400 |
I'll try in a different way: Imagine someone has laid a rope along the path of a depth-first traversal of the document tree. The initial color of the rope is red. However, any node in the tree may decide to change its color (e.g. to green), which the rope then has from the start of that node on for all later (=following::) ones until we reach the document end, or up to the next node that chooses to change the rope's color again.
Which new color a node changes the rope's color to depends on its context and(!) the current color of the rope it has when it reaches it.
<xsl:variable name="this" select="count( preceding::whatever[] )"/> <xsl:variable name="previous" select="count( preceding::boundary[1]/preceding::whatever[] )"/> <xsl:value-of select="$this - $previous"/>
<xsl:variable name="this"> <xsl:number level="any" count="...whatever..."/> </xsl:variable> <xsl:variable name="previous"> <xsl:number select="...location of previous..." level="any" count="...whatever..."/> </xsl:variable> <xsl:value-of select="number($this) - number($previous)"/>
-- Public XSLT, XSL-FO, UBL and code list classes in Europe -- May 2012 Contact us for world-wide XML consulting and instructor-led training Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Google+ profile: https://plus.google.com/116832879756988317389/about Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] "Tunneling" a parameter i, Christopher R. Maden | Thread | Re: [xsl] "Tunneling" a parameter i, Wendell Piez |
Re: [xsl] "Tunneling" a parameter i, Christopher R. Maden | Date | [xsl] Summing hours-worked values f, Mark |
Month |