[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Re: encoding error when using cdata

Subject: Re: Re: encoding error when using cdata
From: "Nick Fitzsimons" <nick@xxxxxxxxxxxxxx>
Date: Wed, 25 Feb 2009 10:55:37 -0000 (GMT)
Re:  Re: encoding error when using cdata
Hi,

One point worthy of note is that you aren't specifying your output
encoding in the <xsl:output /> element. Although you have specified
Windows-1252 encoding in the XML declaration, this refers to the encoding
of the stylesheet itself, not its output. I believe that modifying your
output element thus:

<xsl:output
    indent="yes"
    method="xml"
    cdata-section-elements="Name LongDesc"
    encoding="Windows-1252"
/>

will be necessary if your input document is UTF-8.

Also, you might want to look at a reply I sent to the list a few years back:
<http://www.biglist.com/lists/xsl-list/archives/200710/msg00105.html>

HTH,

Nick.

On Tue, February 24, 2009 6:22 am, Mike Stroud wrote:
> Many thanks for your reply. What I don't understand is why the
> resultant XML file is encoded like this: <?xml version="1.0"
> encoding="UTF-16"?>. I can't seem to change it! What I want is
> WINDOWS-1252, but I end up with UTF-16 no matter what I do (The source
> XML document is UTF-8). My XSL looks like this:
>
> <?xml version="1.0" encoding="Windows-1252"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output indent="yes" method="xml" cdata-section-elements="Name
> LongDesc"/>
> <xsl:template match="/" xmlns:wc="http://www.ptc.com/infoengine/1.0">
> <xsl:copy-of select="."/>
> </xsl:template>
> </xsl:stylesheet>
>

-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.