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

Re: Differing behavior of Xalan and Saxon with namespa

Subject: Re: Differing behavior of Xalan and Saxon with namespaces.Who's right?
From: "Roger L. Costello" <costello@xxxxxxxxx>
Date: Thu, 13 Mar 2003 15:26:33 -0500
roger l costello
Thanks Niko.  I gave your suggestion a try - I used a literal result
element, as shown here:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    <xsl:output method="xml"/>

    <xsl:template match="FitnessCenter">

    <xsl:template match="*">
        <xsl:element name="{name(.)}">
            <xsl:for-each select="@*">
                <xsl:attribute name="{name(.)}">
                    <xsl:value-of select="."/>


However, I got the same result - Xalan carried the namespace declaration
over, and Saxon did not.  /Roger

Niko Matsakis wrote:
> > Both Xalan and Saxon are correct.  True, the Xalan output declares an
> > extra namespace, but the FitnessCenter element does not belong to that
> > namespace. So the presence of the declaration has no effect on the
> > interpretation of the document.
> Not strictly true.  Depending on how the FitnessCenter element was
> created (literal result element vs xsl:element vs xsl:copy) the XSLT
> processor is obliged to copy over different sets of namespace bindings;
> there is some vagueness in the spec when it comes to xsl:element, but it
> is clear for literal result elements and xsl:copy.  In the former case,
> the namespace bindings from the stylesheet should be output, and in the
> latter the bindings from the input.
> Unfortunately, without seeing the rest of the stylesheet in question we
> can't say if either processor is wrong.  I'm going to guess that they're
> both right and that the author is using an xsl:element or xsl:copy; if
> so, I'd suggest to Roger that he create the FitnessCenter element with
> an LRE in which case I'm sure both saxon and xalan will output the
> correct bindings.
> Niko Matsakis
> --
> DataPower technology
> http://www.datapower.com
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.