Last change
on this file since 372 was 372, checked in by Yuri Dario, 13 years ago |
xslt: initial vendor import of xslt 1.1.26.
|
File size:
1.2 KB
|
Line | |
---|
1 | <xsl:stylesheet version = '1.0'
|
---|
2 | xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
|
---|
3 | <!-- borrowed from http://www.zvon.org/xxl/XSLTutorial/Output/example35_ch9.html -->
|
---|
4 |
|
---|
5 | <xsl:template match="/">
|
---|
6 | <TABLE>
|
---|
7 | <xsl:for-each select="//number">
|
---|
8 | <TR>
|
---|
9 | <TH>
|
---|
10 | <xsl:choose>
|
---|
11 | <xsl:when test="text() mod 2">
|
---|
12 | <xsl:apply-templates select=".">
|
---|
13 | <xsl:with-param name="type">odd</xsl:with-param>
|
---|
14 | </xsl:apply-templates>
|
---|
15 | </xsl:when>
|
---|
16 | <xsl:otherwise>
|
---|
17 | <xsl:apply-templates select="."/>
|
---|
18 | </xsl:otherwise>
|
---|
19 | </xsl:choose>
|
---|
20 | </TH>
|
---|
21 | </TR>
|
---|
22 | </xsl:for-each>
|
---|
23 | </TABLE>
|
---|
24 | </xsl:template>
|
---|
25 |
|
---|
26 | <xsl:template match="number">
|
---|
27 | <xsl:variable name="type">even</xsl:variable>
|
---|
28 | <xsl:value-of select="."/>
|
---|
29 | <xsl:text> (</xsl:text>
|
---|
30 | <xsl:value-of select="$type"/>
|
---|
31 | <xsl:text>)</xsl:text>
|
---|
32 | </xsl:template>
|
---|
33 |
|
---|
34 |
|
---|
35 | </xsl:stylesheet>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.