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

Re: XML transformation output to be in NON UTF-16 on M

Subject: Re: XML transformation output to be in NON UTF-16 on MSXML 3.0.
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 22 Jul 2002 18:08:23 +0100
xsl change utf 16
Brad Miller wrote:
> I just read this in the Microsoft XML 4.0 parser SDK help.
> If you want the output to be SHIFT-JIS you need to declare it like
> this <?xml version="1.0" encoding="Shift-JIS"?>
> I would assume that this is the same for 3.0 but I can't verify that.

Either the help's wrong or Brad's interpreting it incorrectly (or
perhaps I'm misinterpreting what Brad's saying). The encoding
specified by an XML declaration indicates the encoding for the XML
document in which the XML declaration is used. Changing the encoding
for the stylesheet (what I think Brad's suggesting) will have no
effect on the encoding used in the output of the transformation.

The only thing within XSLT that does have an effect on the encoding
used in the output of the transformation is the encoding attribute on
xsl:output:

<xsl:output encoding="Shift-JIS" />

but that only has an effect if the XSLT processor has control of the
serialization of the result constructed through the transformation.

When you use MSXML to run a transformation, if you access the result
of the transformation as a string, the string is always in UTF-16
because MSXML's XSLT processor isn't in charge of the serialization.
To put the XSLT processor in charge of the serialization, and thus get
a different encoding, you need to send the result of the
transformation to an object rather than access it as a string. See the
MSXML documentation on the 'output' property of IXSLProcessor for a
description.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.