Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] I18N / UTF-8 versus US-ASCII

From: David Carlisle <davidc@--------->
To:
Date: 4/4/2006 1:04:00 PM
I wrote

> Of course the other cases where you can not use a restricted encoding
> are cases where the element or attribute names use non-ascii characters.

or in comments or processsing instructions or CDATA sections.

An XSL system will just avoid using CDATA sections if it needs to wite a
character reference, but even an "identity" transform will die if there
is a non ascii character in a comment in the source and the stylesheet
has <xsl:output encoding="US-ASCII"/>

er....

After writing the above I made a small test file to demonstrate this but.....

I hope this gets through without having non-ascii character mangled.,
the xml source  is supposed to have a latin1-encode e acute.


<?xml version="1.0" encoding="iso-8859-1"?>
<!-- i -->
<x/>


and the stylesheet just copies everything:

 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 <xsl:output encoding="US-ASCII"/> 

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


 
</xsl:stylesheet>


unfortunately I think both saxon 6 and 8 get this wrong, I'll forward
this to saxon's bug reporting list.

$ saxon comment.xml comment.xsl 
<?xml version="1.0" encoding="US-ASCII"?>&lt;!-- &#233; --&gt;<x/>

saxon6.5.4 seems to have made the comment into text so that it could use a
character reference for the e-acute.



$ saxon8  comment.xml comment.xsl
Warning: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
<?xml version="1.0" encoding="US-ASCII"?><!-- ? --><x/>

saxon 8.7J keeps the comment but converts the non printable character to
a ?, I think that it's supposed to moan with err:SERE0008


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. 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
________________________________________________________________________


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent