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

<&#220;belkeit/> - ASCIIfied element name (LibXSLT/xs

Subject: <&#220;belkeit/> - ASCIIfied element name (LibXSLT/xsltproc)
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Thu, 03 Jul 2008 10:19:45 +0200
 <&#220;belkeit/> - ASCIIfied element name  (LibXSLT/xs
Any valid Unicode character is allowed in an element name,
which is great.

<Urmel>
  <Vorspeise>S|_kirschen mit Kdseso_e</Vorspeise>
  <\belkeit/>
</Urmel>

Now let's transform this encoding it in ASCII.

<xsl:transform version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output encoding="us-ascii"/><!-- Alles ASCII ! -->
  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>
</xsl:transform>

It doesn't work using Saxon 6.5, 9, or Xalan-C.

#### Xalan-C reports an error:

SAXException Message is: 'DC' is an invalid Unicode scalar value.

#### So does Saxon 6.5:

Error at xsl:copy on line 5 of file:/home/mludwig/Werkstatt/xsl/ascii.xsl:
  Invalid character in output name (\belkeit)
Transformation failed: Run-time errors were reported

#### So does Saxon 9.0:

Error at xsl:copy on line 5 of file:/home/mludwig/Werkstatt/xsl/ascii.xsl:
SERE0008: Element name contains a character (decimal + 220) not available in the selected encoding
Transformation failed: Run-time errors were reported


#### LibXSLT (1.1.22) to the rescue!

$ xsltproc ascii.xsl ascii-soll-es-werden.xml

<?xml version="1.0" encoding="us-ascii"?>
<Urmel>
        <Vorspeise>S&#252;&#223;kirschen mit K&#228;seso&#223;e</Vorspeise>
        <&#220;belkeit/>
</Urmel>

So is LibXSLT preferable in this respect? Or would I be justified
reporting this as a bug?

Michael Ludwig

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-2011 All Rights Reserved.