Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] translating character references

From: Ganesh Babu N <nbabuganesh@--------->
To:
Date: 2/5/2009 11:10:00 AM
Dear All,

My XML is like below:

<m:math>
       <m:mi>&#x03d5;</m:mi>
       <m:mi>&#x03c6;</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>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent