EXSLT - set:leading - Use Case 1

Category: example
XML Definition: set.leading.xml
Function or Template: function

Use Case

Source (view)

<doc>
   <a />
   <b />
   <c />
   <d />
   <e />
   <f />
   <g />
   <h />
</doc>

Stylesheet (view)

<xsl:template match="doc">
   <out>
;
            <xsl:value-of select="count(set:leading(*, g))" />
;
            <xsl:value-of select="count(set:leading(*, b))" />
;
            <xsl:value-of select="count(set:leading(*, d|f|h))" />
;
            <xsl:value-of select="count(set:leading(*, a|f|h))" />
;
            <xsl:value-of select="count(set:leading(*, x))" />
;
            <xsl:value-of select="count(set:leading(x, *))" />
;
            <xsl:value-of select="count(set:leading(a|b|c, h))" />
;
    
   </out>
</xsl:template>

Result (view)

<out>;
      6;
      1;
      3;
      0;
      8;
      0;
      0;
    </out>

Change History

Previous Version: ..NaN.html

VersionModifiedByDetails
12001-04-28Mike Kay

Tests functionality of set:leading().

http://www.exslt.org/set/functions/leading/set.leading.use-case.1.html last modified 2001-04-28