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

RE: Changing encoding using a parameter

Subject: RE: Changing encoding using a parameter
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Thu, 29 Mar 2001 09:59:52 +0100
transformerfactory changes encoding
> I want to change the encoding of an XML file based on a
> parameter that I
> pass into the XSL.  How would I go about doing that?

As others have pointed out, you can't parameterise the encoding in standard
XSLT 1.0, though you can in XSLT 1.1. (it's allowed in Saxon).

But XSLT is rather heavyweight if all you want to do is change the encoding:
you could simply use a JAXP 1.1 identity transformer:

Transformer t = TransformerFactory.newInstance().newTransformer();
t.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");
t.transform(source, result);

No stylesheet needed, and a typical implementation will not need to build
the source document tree.

Mike Kay
Software AG


 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.