Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - >Thread Next - Re: [xsl] translating character references [xsl] translating character referencesTo: Date: 2/5/2009 11:10:00 AM 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> | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
