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

namespace declarations in generated stylesheet

Subject: namespace declarations in generated stylesheet
From: "Mike Haarman" <mhaarman@xxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Apr 2003 12:52:29 -0500
stylesheet namespace
Hey all,

I have noticed a remarkable discrepancy between the behavior of Saxon and Xalan
over the following stylesheet and instance:

--------------------------------------------------------------------------------
--------
<?xml version="1.0" encoding="utf-8"?>
<my:document xmlns:my="http://www.my.net/MyMarkup">
<element status="current" name="report"/>
</my:document>


--------------------------------------------------------------------------------
--------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format"
  xmlns:fox="http://xml.apache.org/fop/extensions"
  xmlns:my="http://www.my.net/MyMarkup"
>
  <xsl:output method="xml"
    encoding="utf-8"/>
  <xsl:template match="/">
    <xsl:element name="xsl:stylesheet">
      <xsl:element name="xsl:param">
        <xsl:attribute name="name">
          <xsl:text>report.style</xsl:text>
        </xsl:attribute>
        <xsl:attribute name="select">
          <xsl:text>/root/param[@name = 'style']/@value</xsl:text>
        </xsl:attribute>
      </xsl:element>
    </xsl:element>
    <xsl:apply-templates/>
  </xsl:template>
</xsl:stylesheet>



In generating the xsl:stylesheet declaration in the result, Saxon won't allow me
to declare anything other than xslns:xsl and this it does for me.  Xalan also
won't let me change it but returns all the namespaces declared on the stylesheet
generating the output.

Saxon output:
--------------------------------------------------------------------------------
--------
<?xml version="1.0" encoding="utf-8"?><xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="report.style" select="/root/param[@name =
'style']/@value"/></xsl:stylesheet>

Xalan output:
--------------------------------------------------------------------------------
--------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:my="http://www.my.net/MyMarkup"
xmlns:fox="http://xml.apache.org/fop/extensions"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="report.style" select="/root/param[@name =
'style']/@value"/></xsl:stylesheet>


The question is, who's right?  What behavior should I be expecting?  I thought I
ought to be able to just whip up a set of namespace declarations with something
like:

<xsl:element name="xsl:stylesheet">
  <xsl:attribute name="xmlns:my">
    <xsl:text>http://www.my.net/my markup</xsl:text>
  </xsl:attribute>
</xsl:element>

But that don't work for either tool and I think I am just beginning to see why.
Can anyone enlighten me?


Much obliged,

Mike Haarman


 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.