dancko
dancko

Reputation: 53

How to modify xml declaration in XSLT

I want to modify processing instructions in a source xml with XSLT, for example:

XML INPUT

<?xml version="1.0" encoding="UTF-8"?>
<root>

</root>

XML OUTPUT

<?xml version="1.0" encoding="WINDOWS-1252"?>
<root>

</root>

Can I do this with XSLT? thanks in advance.

Upvotes: 1

Views: 382

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167516

That is the XML declaration, it is not a processing instruction. If you want a particular output encoding then use e.g. <xsl:output encoding="Windows-1252"/>. But any XML parser is required to support UTF-8 so using an 8-bit code page in the age of Unicode and XML does not improve interoperability.

Upvotes: 1

Related Questions