Page 1 of 1

Problem Special characters - xslt to tex (Oxygen to TexShop)

Posted: Wed Mar 09, 2016 2:32 am
by mattlev
Hi,


I'm experimenting some issue with Oxygen, that envolves TexShop too.


I have a xsl sheet to transform my xml into a tex file. The problem is about special characters (in this case, "ç" and "ñ". When I run the xsl and compile the tex file produced, it displays "ç" and "ñ" and the compilation fails.

It's surprising because Oxygen is configured to encode with the ISO 8859-1 standard, so is my xml, my tex file and my tex editor...


It isn't a big problem but it forces me to make a manual modification of my tex file everytime I run my xsl...




I hope I've been clear enough... Does someone have an idea about how to solve this problem?


Thank you for your answers !


Matthias

Re: Problem Special characters - xslt to tex (Oxygen to TexShop)

Posted: Wed Mar 09, 2016 7:00 pm
by adrian
Hi,

Oxygen's encoding setting applies to the opening of documents in the editor when no specific encoding is specified in the document, it does not affect the transformation output.
Your XSLT stylesheet must specify the desired output encoding. e.g.

Code: Select all

<xsl:output method="text" encoding="ISO-8859-1"/>
Use Saxon-PE as the transformer. Other transformers may not report encoding errors in the output.

While the two specific characters you mentioned are fine, note that in some situations there may be some characters in your XML source (if it has an encoding with a wider range, e.g. UTF-8) that cannot be written with a more restrictive encoding in the output. If that's the case, after you set the output encoding as above, you may obtain errors like: "Output character not available in this encoding (decimal nnnnn)".

Regards,
Adrian

Re: Problem Special characters - xslt to tex (Oxygen to TexShop)

Posted: Thu Mar 10, 2016 2:56 pm
by mattlev
Thank you for your answer. I had forgotten to change the encoding in the XML declaration; I also changed the transformer and it works well now.

Regards,

Matthias