Subject: [xsl] translating character references From: Ganesh Babu N <nbabuganesh@xxxxxxxxx> Date: Thu, 5 Feb 2009 16:39:23 +0530 |
Dear All, My XML is like below: <m:math> <m:mi>ϕ</m:mi> <m:mi>φ</m:mi> </m:math> I want to interchange 3d5 with 3c6 and vice versa and below is my code. it is not doing the replacement. Please help me how to achieve this. the solution should be in XSLT 1.0 My xsl is like below: <xsl:template match="m:mi"> <xsl:element name="m:mi"> <xsl:choose> <xsl:when test="contains(.,'x03d5')"> <xsl:value-of select="translate(.,'x03d5','x03c6')"/> </xsl:when> <xsl:when test="contains(.,'x03c6')"> <xsl:value-of select="translate(.,'x03c6','x03d5')"/> </xsl:when> <xsl:otherwise> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] how to avoid generating a, Manuel Souto Pico | Thread | Re: [xsl] translating character ref, David Carlisle |
Re: [xsl] how to avoid generating a, David Carlisle | Date | Re: [xsl] translating character ref, David Carlisle |
Month |