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

RE: xsl to format an ugly xml file to a neat xml file

Subject: RE: xsl to format an ugly xml file to a neat xml file
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Tue, 21 Sep 2004 10:51:54 +0100
format xml file indent
> no, all I needed was a stylesheet to do this job, not an
> application! although jarno's link helped me in a way,
> mysteriously enough the transformation always converted <?xml
> version="1.0" encoding="utf-8"?> to <?xml version="1.0"
> encoding="utf-16"?> which my application did not like at all.
> I tried to investigate a little (changing encoding types here
> and there), but then decided the feature was not important
> enough, because I had no clue and there were other things
> more important at the time. anyway, if this error is somewhat
> common and an easy fix is at hand, I'd be glad to hear about it...

It's because you are using MSXML - if you don't specify an output
encoding MSXML will default to UTF-16.  The encoding specified in your
xml source applies to your xml source, not to  the xml produced by the
transformation, so the processing isn't changing the xml declation it is
creating a new one.  If you want your output to be encoded in UTF-8 and
you are using MSXML you will need to be explicit:

<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
                         ^^^^^^^^^^^^^^^^
cheers
andrew

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-2013 All Rights Reserved.