[xsl] Namespace-aliasing and excluded namespaces

Subject: [xsl] Namespace-aliasing and excluded namespaces
From: "Buchcik, Kasimier" <k.buchcik@xxxxxxxxxxxx>
Date: Wed, 10 May 2006 19:48:41 +0200
Hi,

Can someone confirm that the stylesheet below should
generate the following?

1) With XSLT 1.0 processors (with MSXML.NET, Xalan-J, Saxon 6.5.3):
  <foo/>

2) With XSLT 2.0 processors (run with Saxon 8.1.1):
  <foo xmlns:ext="urn:test:ext" xmlns:ext-literal="urn:test:ext"
xmlns:ext-target="urn:test:ext"/>

For 2) the relevant pieces of spec seem to be:

"A namespace node whose string value is a target namespace URI is copied
to the result tree, whether or not the URI identifies an excluded
namespace."
"In the event that the same URI is used as a literal namespace URI and a
target namespace URI, the second of these rules takes precedence."

Libxslt seems to be confused by the aliasing of the same namespaces, and
reports:
<foo xmlns:ext="urn:test:ext" xmlns:ext-literal="urn:test:ext"/>

Scenario:

<?xml version='1.0'?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xmlns:ext-literal="urn:test:ext"
  xmlns:ext-target="urn:test:ext"
  extension-element-prefixes="ext-target">

  <xsl:namespace-alias stylesheet-prefix="ext-literal"
result-prefix="ext-target"/>

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

</xsl:stylesheet>

Regards,

Kasimier

Current Thread