[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

translating character references

Subject: translating character references
From: Ganesh Babu N <nbabuganesh@xxxxxxxxx>
Date: Thu, 5 Feb 2009 16:39:23 +0530
 translating character references
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>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.