xsl-list
[Top] [All Lists]

Re: [xsl] Trouble with special characters

2016-01-25 11:53:28
I am transforming XML data that conforms to schema A, into XML data
that conforms to schema B. And the data contains special characters.

Input - Schema A

Input encoding UTF-8

<schemaa>
<list1>Degree symbol - "°"</list1>

</schemaa>

Output - Schema B

Output encoding  ISO-8859-1

<schemab>
<process1>Degree - "�</process1>

</schemab>

So what is the input encoding, what is the output encoding, do you
make sure that the XML declaration is output if the output encoding is
ISO-8859-1?
- input-UTF-8, output - ISO-8859-1, xsl:output has the attribute
encoding set to ISO-8859-1.

 How do you look at the transformation result when you get that gibberish?
- Not sure I understand what you mean. I use XML spy.

Which Unicode character is the "degree" character you want to output?
Why do you need the character map?
-Degree comes in as is (as the degree symbol). If transformed without
the character map, it converts to a question mark. That's why I use
the character map to map it to an HTMl entity.

Saxon is the processor used.




On Mon, Jan 25, 2016 at 11:38 AM, Martin Honnen 
martin(_dot_)honnen(_at_)gmx(_dot_)de
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:
a kusa akusa8(_at_)gmail(_dot_)com wrote:

I am trying to transform special characters in an XML file using XSLT
and I am having trouble with it.

One of them that I am having trouble with is the degree symbol. The
encoding is set to ISO-8859-1 because the system that consumes the XML
is set to this encoding.

So, on my XSL, I use the xsl:character-map and have mapped degree to
&#176; But for some reason, when the XML is converted, I only see
gibberish in place of the degree symbol.

Degree - "�

I also have similar problems with the middle dot, null and section
symbols.

Any suggestions on this is greatly appreciated.



So what is the input encoding, what is the output encoding, do you make sure
that the XML declaration is output if the output encoding is ISO-8859-1? How
do you look at the transformation result when you get that gibberish?

Which Unicode character is the "degree" character you want to output?
Why do you need the character map?

Can you post minimal samples of input, XSLT, XML output you want and the one
you get?


--~----------------------------------------------------------------
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>