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

Subject: Re: xslt 3.0 exclude-result-prefixes question
From: "Mukul Gandhi mukulg@xxxxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 8 Oct 2026 16:10:28 -0000
Hi Martin,
     The stylesheet which I've provided, specifies

<xsl:stylesheet xmlns:s="http://s.com/"
                         exclude-result-prefixes="s"

And accordingly, an XML namespace declaration xmlns:s="http://s.com/" is
not appearing on any XML elements produced by the stylesheet that I've
cited.

But an XSL instruction

 <xsl:value-of select="s:sort(namespace::*)" separator=","/>

seems to exclude http://s.com/ from the result, using information from XSL
attribute exclude-result-prefixes. I think, this is probably not correct,
because the result produced by  <xsl:value-of select="s:sort(namespace::*)"
separator=","/>  is not an XML element node.

On Thu, Oct 8, 2026 at 9:05b/PM Martin Honnen martin.honnen@xxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> 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"
> <http://www.w3.org/1999/XSL/Transform>
>                          xmlns:s="http://s.com/" <http://s.com/>
>                          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?
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3430162> (by
> email <>)
>



--
Regards,
Mukul Gandhi

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