Setting Character Encoding

Now that we’re doing more substantial rewrites of source documents, it’s useful to know that you can set the character encoding of result documents with the encoding attribute of the <xsl:output> element. However, that’s no guarantee that your XSLT processor supports the encoding you want to use, because XSLT processors are required to support only UTF-8 and UTF-16. On the other hand, if you use a character that is not supported in the character encoding you’re using, the XSLT processor should either output the character as an entity reference or generate an error.

More on Character Encoding

For more on character encoding, see Inside XML. The only approved character encodings are specified in the XML 1.0 recommendation, ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.