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

Re: replacing diacritical marks with combining unicode

Subject: Re: replacing diacritical marks with combining unicode characters
From: Terry Ofner <tofner@xxxxxxxxxxx>
Date: Tue, 4 Mar 2008 16:42:14 -0500
Re:  replacing diacritical marks with combining unicode
I have decided to try a character map. When I used the sheet below, however, it converts <br /> to <br>:

?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">



<xsl:output use-character-maps="cm1"/>


<xsl:character-map name="cm1">
<xsl:output-character character="&#728;" string="&amp;#774;"/><!--breve-->
<xsl:output-character character="&#175;" string="&amp;#772;"/> <!-- macron -->
</xsl:character-map>


<xsl:template match="br"/>

        <xsl:template match="@*|node()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>

</xsl:stylesheet>

I really don't need the <br /> elements. That is the reason for the template rule removing them. But is the switch from <br/> to <br> caused by the output line?

Terry Ofner
1541 Northbrook Drive
Indianapolis, IN 46260
Voice: 317-870-1992
Fax: 317-870-7101

tofner@xxxxxxxxxxx




On Mar 4, 2008, at 2:09 PM, Michael Kay wrote:



The function fn:normalize-unicode() will do what you want, with a second argument of "NFC".

I'm not sure it will, because the input is using non-combining diacritical
marks. I think the answer is translate():


translate($in, '&#728;...', '&#774;...'

Michael Kay
http://www.saxonica.com/

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-2013 All Rights Reserved.