Page 1 of 1

Differences calling Saxon8B (outof Oxygen/Java-Application)

Posted: Mon Oct 23, 2006 7:08 pm
by Toralion
Hello,
I try to convert xml to rtf and have problems converting unicode characters to ansi (rtf allows only ansi chars).
For that purpose I have to convert any char above codepoint 255 into its numeric value (string-to-codepoints) and write it (under the rules of rtf) into my target document.

The problem is, when I use Saxon8B out of Oxygen everything works fine, but if I call the same template out of my Java-Application also using Saxon8B, umlauts are not translated correct.

E.g.
With Saxon out of Oxygen Ä remains "Ä" (Decimal code points 196)
With Saxon out of my Application Ä becomes "Ä" (Decimal code points 195 8222)

Are there any 'special' settings or parameters set for the saxon engine in oxygen that could be accountable for that differences?

Any idea? I would be thankful for any suggestion.

Posted: Tue Oct 24, 2006 10:31 pm
by Toralion
Ha!
I fixed the problem today.

The problem was the way I read the xml.
When I use StreamSource to read the xmlFile I get the mentioned problem.
--> Source source = new StreamSource(xmlFile);

The Solution was to use a SAXSource to read the xml
--> Source source = new SaxSource(xmlFile);

So long,
Toralion

Posted: Wed Oct 25, 2006 8:59 am
by george
That was an encoding problem. When you use StreamSource you will get the default platform encoding. When you use SaxSource the encoding will be detected from the file.

Best Regards,
George

Posted: Wed Oct 25, 2006 10:30 am
by Toralion
george wrote:That was an encoding problem. When you use StreamSource you will get the default platform encoding. When you use SaxSource the encoding will be detected from the file.

Best Regards,
George
Ah yes, I kind of thought that also I expected that the encoding would be the one I safed the file with... never mind. It works! 8)

Thanks for the info George!

Best Regards,
Toralion