Wiki source code of Counter
Version 3.1 by Outhman Moustaghfir on 2024/02/20 15:30
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
3.1 | 1 | = Introduction = |
![]() |
2.1 | 2 | |
3 | |||
![]() |
3.1 | 4 | Tabulate the count of a variable's occurrences in a given scenario. |
5 | |||
![]() |
2.1 | 6 | = Parameters = |
7 | |||
8 | * **"Counter Name":** Mandatory. | ||
9 | * **"Increment Number":** Optional. | ||
10 | * **"Max Number Not to Exceed":** Optional. | ||
11 | * **"Initialization Number if Max is Reached":** Optional. | ||
12 | |||
13 | = Uses = | ||
14 | |||
15 | |||
16 | {{code language="XML"}} | ||
17 | |||
18 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ixf="http://www.ixPath.com/Function" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ix="localFunction" xmlns:fn="http://www.w3.org/2005/xpath-functions" > | ||
![]() |
3.1 | 19 | <xsl:output method="xml" indent="yes"></xsl:output> |
![]() |
2.1 | 20 | <!-- Beginning of the Translation --> |
21 | <xsl:template match="/"> | ||
22 | <ixDOC> | ||
23 | <TEST><xsl:value-of select="ixf:Counter('counterName')"></xsl:value-of></TEST> | ||
24 | <TEST><xsl:value-of select="ixf:Counter('counterName')"></xsl:value-of></TEST> | ||
25 | <TEST><xsl:value-of select="ixf:Counter('counterName')"></xsl:value-of></TEST> | ||
26 | <TEST><xsl:value-of select="ixf:Counter('counterName')"></xsl:value-of></TEST> | ||
27 | |||
28 | </ixDOC> | ||
29 | </xsl:template> | ||
30 | </xsl:stylesheet> | ||
31 | {{/code}} | ||
32 | |||
33 | for this example the output is : | ||
34 | |||
35 | [[image:Capture d'écran 2024-02-20 152646.png]] | ||
36 | |||
37 | Return: The function returns the incremented counter. |