[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: xslt 3.0 exclude-result-prefixes question
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 8 Oct 2026 15:34:49 -0000
On 08/10/2026 17:07, Mukul Gandhi mukulg@xxxxxxxxxxxxxxxxx wrote:
> W3C XSLT 3.0 test suite, specifies the following expected result for
> this XSL stylesheet,
>
> <zzz><ns>http://a.uri/,http://www.w3.org/XML/1998/namespace</ns></zzz>
>
> Whereas I think, the correct output for this XSL stylesheet should be
> following,
>
>
<zzz><ns>http://a.uri/,http://s.com/,http://www.w3.org/XML/1998/namespace</ns
></zzz>
>
> XSLT 3.0 spec, specifies that
> [xsl:]exclude-result-prefixes is applicable to 'Literal Result
> Elements', and refers the reader to following section of XSLT 3.0 spec,
> see 11.1.3 Namespace Nodes for Literal Result Elements
>
>
> Any thoughts please?


Hi Mukul,

reading https://www.w3.org/TR/xslt-30/#lre-namespaces I find

The created element node will have a copy of the namespace nodes that
were present on the element node in the stylesheet tree with the
exception of any namespace node whose string value is designated as an
excluded namespace.

and

A namespace URI designated by using an [xsl:]exclude-result-prefixes
attribute either on the literal result element itself or on an ancestor
element.

As your code clearly has

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 B  B  B  B  B  B  B  B  B  B  B  B  B xmlns:s="http://s.com/"
 B  B  B  B  B  B  B  B  B  B  B  B  B exclude-result-prefixes="s"


why do you think the http://s.com/ should be a namespace node of the
literal result elements, it seems excluded, no?

Current Thread
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member