Subject: [xsl] character maps From: Craig Sampson <Craig.Sampson@xxxxxxx> Date: Wed, 15 May 2013 20:30:00 +0000 |
Hello, I have a situation where I need to convert UTF-8 characters to their NCR (numeric character representation). I am trying to use character maps but can't get it to work. My program is written in XSLT version 2 which I am running with SAXON 9he on windows 7. Here's a snippet of the file to be converted: (where the special character is a lower case greek mu ( u + 03BC )) <foreign><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>l</mml:mi></mml:math>< /foreign> My character-map contains: <xsl:output-character character="캼" string="&#x03BC;"/> <!-- lc mu --> But my output still contains the mu character in its original state. I've tried referencing the character-map from a xsl:results-document element: <xsl:result-document href="{concat('equation\MathML-',$mCnt,'.xml')}" indent="yes" method="xml" encoding="UTF-8" use-character-maps="LCgreek" doctype-public="-//SAS//DTD authoring 13.0//EN" doctype-system="authoring.dtd"> And I've tried referencing the character-map in xsl:output and then referencing the output in the result-document: <xsl:output name="mathOut" method="xml" indent="yes" encoding="UTF-8" use-character-maps="LCgreek" doctype-system="authoring.dtd" doctype-public="-//SAS//DTD authoring 13.0//EN"/> <xsl:result-document format="mathOut" href="{concat('equation\MathML-',$mCnt,'.xml')}"> What am I doing wrong? Here's the complete character-map: <xsl:character-map name="LCgreek"> <xsl:output-character character="캱" string="&#x03B1;"/> <!-- lc alpha --> <xsl:output-character character="캲" string="&#x03B2;"/> <!-- lc beta --> <xsl:output-character character="캳" string="&#x03B3;"/> <!-- lc gamma --> <xsl:output-character character="캴" string="&#x03B4;"/> <!-- lc delta --> <xsl:output-character character="캵" string="&#x03B5;"/> <!-- lc epsilon --> <xsl:output-character character="캶" string="&#x03B6;"/> <!-- lc zeta --> <xsl:output-character character="캷" string="&#x03B7;"/> <!-- lc eta --> <xsl:output-character character="캸" string="&#x03B8;"/> <!-- lc theta --> <xsl:output-character character="캹" string="&#x03B9;"/> <!-- lc iota --> <xsl:output-character character="캺" string="&#x03BA;"/> <!-- lc kappa --> <xsl:output-character character="캻" string="&#x03BB;"/> <!-- lc lamda --> <xsl:output-character character="캼" string="&#x03BC;"/> <!-- lc mu --> <xsl:output-character character="캽" string="&#x03BD;"/> <!-- lc nu --> <xsl:output-character character="캾" string="&#x03BE;"/> <!-- lc xi --> <xsl:output-character character="캿" string="&#x03BF;"/> <!-- lc omicron --> <xsl:output-character character="쾀" string="&#x03C0;"/> <!-- lc pi --> <xsl:output-character character="쾁" string="&#x03C1;"/> <!-- lc rho --> <xsl:output-character character="쾂" string="&#x03C2;"/> <!-- lc final sigma --> <xsl:output-character character="쾃" string="&#x03C3;"/> <!-- lc sigma --> <xsl:output-character character="쾄" string="&#x03C4;"/> <!-- lc tau --> <xsl:output-character character="쾅" string="&#x03C5;"/> <!-- lc upsilon --> <xsl:output-character character="쾆" string="&#x03C6;"/> <!-- lc phi --> <xsl:output-character character="쾇" string="&#x03C7;"/> <!-- lc chi --> <xsl:output-character character="쾈" string="&#x03C8;"/> <!-- lc psi --> <xsl:output-character character="쾉" string="&#x03C9;"/> <!-- lc omega --> </xsl:character-map> Thanks, Craig -------------------------------------------------------------------- Craig R. Sampson SAS Institute Inc. email: craig.sampson@xxxxxxx XML Technologies SAS Campus Drive phone: (919) 531-7417 Cary, NC. 27513 FAX: (919) 677-4444 -------------------------------------------------------------------- Please consider the environment before printing this email
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] only last 14 characters, henry human | Thread | Re: [xsl] character maps, G. Ken Holman |
Re: [xsl] only last 14 characters, henry human | Date | Re: [xsl] character maps, G. Ken Holman |
Month |