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

strange behaviour in Xalan

Subject: strange behaviour in Xalan
From: Jörg Heinicke <joerg.heinicke@xxxxxx>
Date: Sat, 20 Oct 2001 15:27:53 +0200
select box strange behavior
Hello,

on another list there was a question about deleting the root-element. One
reply suggested

<xsl:template match="boxes">
    <xsl:copy-of select="*|@*"/>
</xsl:template>

, which in my eyes can cause problems, if the root-element has attributes.
So I tested it with Xalan 2.2.D11. But I get a really strange output:

XML

<?xml version="1.0" encoding="UTF-8"?>
<boxes test="1">
  <box id="1234">
    <title>Ciao</title>
    <body>This is the body of the box</body>
  </box>
</boxes>

XSL

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:output indent="yes"/>
  <xsl:template match="boxes">
    <xsl:copy-of select="*|@*"/>
  </xsl:template>
</xsl:stylesheet>

Output

<?xml version="1.0" encoding="UTF-8"?>
<box xmlns:xml="http://www.w3.org/XML/1998/namespace" test="1" id="1234">
  <title>Ciao</title>
  <body>This is the body of the box</body>
</box>

1. Why is the attribute test="1" not causing an error, but will be copied to
the new root-element?
2. Where does ' xmlns:xml="http://www.w3.org/XML/1998/namespace" ' come
from?

Changing the XSL to <xsl:copy-of select="*"/> the output is like expected.
In my eyes this is more than obviously a bug, but maybe I'm wrong. What can
you say about that?

Joerg


 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.