[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] special character encoding, two problems

Subject: Re: [xsl] special character encoding, two problems
From: "Eliot Kimber ekimber@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 15 Oct 2014 19:23:13 -0000

It also shouldn't matter how the characters are encoded if the XML
document is otherwise a Unicode document (e.g., encoded in UTF-8 or
UTF-16). Whether a given character is written as "A", "&#x41;",
"&#x0041;", or "&#65;" it's exactly same character to an XML parser. Any
processor that consumes XML yet expects or requires a specific form of
numeric character reference seems like an exceptionally broken processor,
since any conforming XML parser removes the need to care about how the XML
data has been written to disk (encoded as a byte sequence).


Eliot Kimber, Owner
Contrext, LLC

On 10/15/14, 1:26 PM, "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx"
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

>On 15.10.2014 19:56, Jonina Dames jdames@xxxxxxxxx wrote:
>> Hi everyone,
>> Problem 1:
>> I'm having trouble figuring out why my special characters are converting
>> from numeric-hex unicode to numeric-decimal unicode, e.g. from &#x00A0;
>> in my input XML to &#160; in my output XML. My customer requires
>> numeric-hex unicode. I suspect I'm missing something really obvious, but
>> nothing that I've found via google has helped me solve the problem.
>> This is the xsl:output line I'm using:
>>          <xsl:output method="xml" encoding="us-ascii"
>> omit-xml-declaration="yes" indent="yes"/>
>> Is there something else I should use for the encoding attribute value?
>> Or am I missing something somewhere else?
>If you are using Saxon, you may use the saxon:character-representation
>serialization parameter in the xsl:output declaration:
>Problem 2 has been addressed in-depth by Graydon already.

Current Thread