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

Re: change stylesheet encoding

Subject: Re: change stylesheet encoding
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 14 May 2004 23:00:16 +0100
xsl stylesheet encoding
> I was wondering what is the best way to change the encoding in the
> processing statement for an XSL stylesheet.

It's just an XML file so any xml encoding method should work, 
I tend to use xsl for that, if you want the stylesheet to be written in
latin 1 transform it with

<xsl:styleseet...

<xsl:output encoding="iso-8859-1"/>

<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>


> I am concerned about users with xml documents with other encodings
> trying to use the stylesheet.

Huh??? The encoding used in the stylesheet is totally irrelevant to all
processing. Except if you choose to write yue your stylesheet in an
encoding that an XML parser does not know, there will be no processing
at all. Every parser will accept utf8 (or ascii pretending to be utf8)
but if you make it latin1 then any system may reject it.

> I originally wrote the stylesheet for UTF-8.
You are wording that as if you mean you wrote it for utf8 documents, but
xslt can't even see the original document encoding the encodings used in
the stylesheet and in the documents are all resolved before xslt starts.

> There are some UTF-8 NCRs in it
> (&amp;#xA;, &amp;#x20;), but that is about it.

NCRs have nothing to do with utf8, thge numbers are unicode code points
and you'd use the same numbers whatever encoding the file was in.


> Is there a good way to check the character set in a stylesheet in
> order to change it to another encoding?
The stylesheet above will change the encoding without knowing the
original encoding.

> Specifically, I would like to change UTF-8 to ISO-8859-1.
The only effect this can have on the xslt stylesheet is to potentially
reduce the number of systems on which it runs. 

David

-- 
The LaTeX Companion
  http://www.awprofessional.com/bookstore/product.asp?isbn=0201362996
  http://www.amazon.co.uk/exec/obidos/tg/detail/-/0201362996/202-7257897-0619804


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.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-2013 All Rights Reserved.