xsl-list
[Top] [All Lists]

[xsl] Namespace-alias using #default with no default namespace in scope

2006-05-11 12:55:20
Hi,

This is an XSLT 1.0 issue.

With XSLT 2.0 processors, a value of "#default" either for the
stylesheet-prefix or result-prefix of an xsl:namespace-alias
will raise a static error.

For XSLT 1.0 processors, the spec has not provided a rule (I can't
find such a rule) for not-is-scope default namespaces wrt
xsl:namespace-alias;
the results of some XSLT 1.0 processors differ.

What would be the best/intuitive/logical result for the following
scenario (run with an XSLT 1.0 processor)?

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";  
  xmlns:foo="urn:test:foo">  

  <xsl:namespace-alias stylesheet-prefix="foo"
result-prefix="#default"/>

  <xsl:template match="/">    
    <foo:foo xmlns="urn:test:default">
      <foo:bar/>
    </foo:foo>
  </xsl:template>

</xsl:stylesheet>

Libxslt (looks like a bug):
<?xml version="1.0"?> 
<foo xmlns="urn:test:default"
xmlns:foo="urn:test:default"><foo:bar/></foo>

Xalan-J:
"java.lang.RuntimeException: java.lang.NullPointerExceptio"

Saxon 6.5.3 (isn't xmlns:foo="" allowed only for XML 1.1 ?):
<?xml version='1.0' ?>
<foo:foo xmlns:foo="" xmlns="urn:test:default"><foo:bar/></foo:foo>

MSXML .NET (this is my favorite result, although the ns-declaration is
gone):
<?xml version='1.0' encoding='utf-8' ?>
<foo><bar/></foo>

Any other ideas for a possible result?

Regards,

Kasimier



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--