Use character entities to represent non-ASCII characters
Paul Kinnucan via xslt <[email protected]> Fri, 19 Aug 2022 17:41:46 +0000
| Newsgroups | gmane.comp.gnome.lib.xslt |
|---|---|
| Message-ID | <MN2PR05MB70389CA1A6FB3EC3CB506DCBB46C9@MN2PR05MB7038.namprd05.prod.outlook.com> |
--===============1558040795242017650==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_MN2PR05MB70389CA1A6FB3EC3CB506DCBB46C9MN2PR05MB7038namp_"
--_000_MN2PR05MB70389CA1A6FB3EC3CB506DCBB46C9MN2PR05MB7038namp_
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable
Hi,
I am trying to use libxslt to transform an XML file that contains non-ASCII=
characters to an HTML file. Other xslt processors, such as JAXP and Xalan,=
replace non-ASCII characters with their character entity equivalents, e.g.=
, =A3 -> £ However, libxslt simply outputs the UTF-8 rendition of the=
non-ASCII character.
Is there a way to get libxslt to output the equivalent character entity ins=
tead?
Paul
--_000_MN2PR05MB70389CA1A6FB3EC3CB506DCBB46C9MN2PR05MB7038namp_
Content-Type: text/html; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
=09{font-family:"Cambria Math";
=09panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
=09{font-family:Calibri;
=09panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
=09{font-family:Consolas;
=09panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
=09{margin:0in;
=09font-size:11.0pt;
=09font-family:"Calibri",sans-serif;}
span.EmailStyle17
=09{mso-style-type:personal-compose;
=09font-family:"Calibri",sans-serif;
=09color:windowtext;}
.MsoChpDefault
=09{mso-style-type:export-only;
=09font-family:"Calibri",sans-serif;}
@page WordSection1
=09{size:8.5in 11.0in;
=09margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
=09{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72" style=3D"word-wrap:=
break-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Hi, <o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">I am trying to use libxslt to transform an XML file =
that contains non-ASCII characters to an HTML file. Other xslt processors, =
such as JAXP and Xalan, replace non-ASCII characters with their character e=
ntity equivalents, e.g.,
<span style=3D"font-size:10.0pt;font-family:Consolas">=A3 -> &pound;=
However, libxslt simply outputs the UTF-8 rendition of the non-ASCII chara=
cter.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas=
"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas=
">Is there a way to get libxslt to output the equivalent character entity i=
nstead?<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas=
"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas=
">Paul<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:Consolas=
"><o:p> </o:p></span></p>
</div>
</body>
</html>
--_000_MN2PR05MB70389CA1A6FB3EC3CB506DCBB46C9MN2PR05MB7038namp_--
--===============1558040795242017650==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
[email protected]
https://mail.gnome.org/mailman/listinfo/xslt
--===============1558040795242017650==--