[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Changing encoding using a parameter
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|