[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

<xsl:variable name="seq" select="<<find the items I need to process>>"/>

<xsl:apply-templates select="$seq" mode="analyze">
(: put a bunch of with-param elements in here to control counters and
triggers and anything you need to control the analysis :)

<xsl:template mode="analyze">
(: pick up parameters:)
(: modify the state variables and triggers:)

<xsl:if test="position() = last()">
(: output results here :)

Another method would be to use a recursive function on a sequence:

<xsl:function name="mynamespace:analyze">
<xsl:param name="seq" as="item()*">
(:several other parameters to control analysis: counters, triggers,
state variables, etc.:)

<xsl:when test="empty($seq)">
(:output data :)
(: Modify counters, triggers, and state variables based on their
current values and head($seq))
<xsl:sequence select="mynamespace:analyze(tail($seq), (: new state
variables and counters:))/>

I was wondering what experienced users did in these cases and if
either of the above is wrong-headed.


"A false conclusion, once arrived at and widely accepted is not
dislodged easily, and the less it is understood, the more tenaciously
it is held." - Cantor's Law of Preservation of Ignorance.

Current Thread