Nic Miloslav     Example 28    KEYWORDS      EXAMPLES      AUTHORS     

Changing case of a text.


     XML     HOME     XSL 1      
<xslTutorial >
<citylist>
        <distance city="A">1 HOURS</distance>
        <distance city="B">2 HOURS</distance>
        <distance city="C">30 MINUTES</distance>
        <distance city="D">HOURS HOURS</distance>
<distance city="E">MINUTES MINUTES</distance>
</citylist>
</xslTutorial>

     XSL 1     HOME     XML     HTML 1     OUTPUT 1     
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl:template match="citylist">
<TABLE>
<xsl:for-each select="distance">
<TR><TD>
<xsl:value-of select="@city"/>
<xsl:text> =</xsl:text>
<xsl:value-of select="substring-before(.,' ')"/>
<xsl:text> </xsl:text>
<xsl:value-of select="translate(substring-after(.,' '),'OURSINTE','oursinte')"/>
</TD></TR>
</xsl:for-each>
</TABLE>
</xsl:template>
</xsl:stylesheet>

     HTML 1     HOME     XML     XSL 1     OUTPUT 1     
<HTML>
<HEAD> </HEAD>
<BODY>
<TABLE>
<TR>
<TD>A=1 Hours</TD></TR>
<TR>
<TD>B=2 Hours</TD></TR>
<TR>
<TD>C=30 Minutes</TD></TR>
<TR>
<TD>D=HOURS Hours</TD></TR>
<TR>
<TD>E=MINUTES Minutes</TD></TR></TABLE> </BODY> </HTML>

     OUTPUT 1     HOME     XML     XSL 1     HTML 1     
A=1 Hours
B=2 Hours
C=30 Minutes
D=HOURS Hours
E=MINUTES Minutes