This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The XSLT 2.0 specification states: "[Definition: The namespace URI that is to be used in the result tree as a substitute for a literal namespace URI is called the target namespace URI.]" and later "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." Suppose we have two stylesheets: main.xsl <xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="http://www.example.org/alias" xmlns:y="http://www.example.org/My/Transform/Language"> <xsl:import href="import.xsl" /> <xsl:namespace-alias stylesheet-prefix="x" result-prefix="y"/> <xsl:template match="/"> <x:transform /> </xsl:template> </xsl:stylesheet> import.xsl <xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="http://www.example.org/alias" xmlns:y="http://www.example.org/My/Transform/Language"> <xsl:namespace-alias stylesheet-prefix="x" result-prefix="#default"/> </xsl:stylesheet> Is "http://www.w3.org/1999/XSL/Transform" (ordinarily an excluded namespace) considered as a target namespace URI, even though the xsl:namespace-alias is overridden by a higher priority xsl:namespace-alias for the same literal namespace URI? i.e. is the correct result: <y:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:y="http://www.example.org/My/Transform/Language"/> or <y:transform xmlns:y="http://www.example.org/My/Transform/Language"/> ? I would presume that the latter is correct, because "http://www.w3.org/1999/XSL/Transform" is not going to be used in the result tree as a substitute for a literal namespace URI due to the higher precedence xsl:namespace-alias declaration.
I guess that the statement "If a literal namespace URI is declared to be an alias for multiple different target namespace URIs, then the declaration with the highest import precedence is used." could be expanded with "..., and the other declarations have no effect." Would this remove any remaining doubts?
Yes. Just to be clear, do you agree that <y:transform xmlns:y="http://www.example.org/My/Transform/Language"/> is the correct answer?
I've added this as test case nspc-n144. The answer I get from Saxon is <?xml version="1.0" encoding="UTF-8"?> <y:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/XSL/Transform" xmlns:y="http://www.example.org/My/Transform/Language"/> which I believe is incorrect, for the reasons described.
Thanks. We believe we have found a number of errors in the test suite. Where should we report them?
Please report errors in the XSLT testsuite in the W3C "member-private" Bugzilla database, http://www.w3.org/Member/bugzilla/ - product "XSLT 2.0 CR Test Collection".
Closing as WORKSFORME - the spec is correct, the test case was wrong.