xsl-list
[Top] [All Lists]

Re: [xsl] special character encoding, two problems

2014-10-15 14:23:19
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", "A",
"A", or "A" 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).

Cheers,

Eliot
—————
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




On 10/15/14, 1:26 PM, "Imsieke, Gerrit, le-tex 
gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de"
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:



On 15.10.2014 19:56, Jonina Dames jdames(_at_)inera(_dot_)com 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:
http://www.saxonica.com/documentation9.5/index.html#!extensions/output-ext
ras/character-representation

Problem 2 has been addressed in-depth by Graydon already.

Gerrit


--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>