Re: [xsl] Entities Conversion

Subject: Re: [xsl] Entities Conversion
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 27 May 2007 00:39:12 +0200
J. S. Rawat wrote:
Hi!
In my output file entities are getting converted into as per the encoding specified in the <output> element but I don't want to change the enties. Is there any encoding value, which will convert it into as desired output.


INPUT
&ldquo; &rdquo; &ndash; &mdash;

OUTPUT (encoding="iso-8859-1")
&#8220; &#8221; &#8211; &#8212;

OUTPUT (encoding="iso-8859-1")
b b b b


this is not likely. Maybe the mailer system got things mixed up, but the characters you mention are not part of ISO-8859-1 (see http://en.wikipedia.org/wiki/ISO-8859-1) and must therefor be escaped (as in your first mention of OUTPUT). This looks as literal characters, which is incorrect serializing (what processor do you use?).


DESIRED OUTPUT
&ldquo; &rdquo; &ndash; &mdash;

there's a way to get this in XSLT 2.0 using character-sets, but it is usually not the way to go as you will invalidate your xml.


It seems to me that you may just as well have a simple encoding problem. Try to output your document as UTF-8 and you'll will just see the characters. Output them in a codeset not known, the numeric entities will be used (which are equivalent to the named entities if the correct entity declarations are present in the doctype and when the output is xml/html)

Cheers,
-- Abel Braaksma

Current Thread