EXSLT - set:trailing - Use Case 1

Category: example
XML Definition: set.trailing.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:trailing(*, d))" />
;
            <xsl:value-of select="count(set:trailing(*, b|d|f))" />
;
            <xsl:value-of select="count(set:trailing(*, a|f|h))" />
;
            <xsl:value-of select="count(set:trailing(*, x))" />
;
            <xsl:value-of select="count(set:trailing(x, *))" />
;
            <xsl:value-of select="count(set:trailing(d|e|f, a|e))" />
;
    
   </out>
</xsl:template>

Result (view)

<out>;
      4;
      6;
      7;
      8;
      0;
      0;
    </out>

Change History

Previous Version: ..NaN.html

VersionModifiedByDetails
12001-04-28Mike Kay

Tests functionality of set:trailing().

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