Project

Profile

Help

Namespace-alias, exclude-result-prefixes bug?

Added by Anonymous about 13 years ago

Legacy ID: #9100800 Legacy Poster: Jan-Willem van den Broek (jwbroek)

Hi all, I have a possible bug with namespace-alias and exclude-result-prefixes. The xslt below demonstrates the problem: <xsl:stylesheetversion="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ixsl="dummy" exclude-result-prefixes="#all" > <xsl:template match="/"> </xsl:template> <xsl:namespace-alias stylesheet-prefix="ixsl" result-prefix="xsl"/> <xsl:template name="dummy"> ixsl:stylesheet/ </xsl:template> </xsl:stylesheet> The output that I expect is as follows: Instead, it is I have run into this behavior with saxon 9-3-0-4j and an unknown version of 9.2j. Regards, Jan-Willem


Replies (4)

Please register to reply

RE: Namespace-alias, exclude-result-prefixes bug? - Added by Anonymous about 13 years ago

Legacy ID: #9100814 Legacy Poster: Jan-Willem van den Broek (jwbroek)

Hmm. For some reason the forum has put semicolons behind lines containing http URIs. Please remove these if you try the xslt.

RE: Namespace-alias, exclude-result-prefixes bug? - Added by Anonymous about 13 years ago

Legacy ID: #9101062 Legacy Poster: Markus Abt (mkabt)

Hi Jan-Willem, the spec states (in "11.1.4 Namespace Aliasing"): "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." Doesn't that mean that the result you get is correct? Regards, Markus

RE: Namespace-alias, exclude-result-prefixes bug? - Added by Anonymous about 13 years ago

Legacy ID: #9101540 Legacy Poster: Michael Kay (mhkay)

Markus is correct. The reason for this rule is that it's designed for the primary use case for xsl:namespace-alias, which is generating XSLT stylesheets.

RE: Namespace-alias, exclude-result-prefixes bug? - Added by Anonymous about 13 years ago

Legacy ID: #9103064 Legacy Poster: Jan-Willem van den Broek (jwbroek)

Hi Markus, Michael, Thanks for clearing that up. I completely missed that part of the spec. Sorry for posting a non-bug. (It's unfortunate, though, that it is not possible to scope xsl:namespace-alias to xsl:result-document somehow. In my own use case, I am using a single xslt to generate a large number of related xml files, some of which are xslts and some of which are not (but which still end up with xsl namespace declarations due to xsl:namespace-alias). Maybe something for xslt 3.0. ;-)) Regards, Jan-Willem

    (1-4/4)

    Please register to reply