This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: xsl:extension-element-prefixes




Andrew Kimball wrote:
> 
> James, Mike,
> 
> Thanks for your helpful spec interpretations thus far.  I've now found
> myself a new puzzler.  Given the following stylesheet:
> 
> <xsl:stylesheet xsl:version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>         <xsl:template match="/">
>                 <foo:x xsl:extension-element-prefixes="foo"
> xmlns:foo="http://my.com"/>
>         </xsl:template>
> </xsl:stylesheet>
> 
> 1. Should foo:x be interpreted as an extension element or as a literal
> result element?

An extension element.

> The spec says:
> "The designation of a namespace as an extension namespace is effective
> within the subtree of the stylesheet rooted at the element bearing the
> extension-element-prefixes or xsl:extension-element-prefixes attribute"
> 
> If I interpret "within the subtree" as not including the subtree root, then
> foo:x would be a literal result element.  There are no particular technical
> problems with this interpretation (however, it does seem inconvenient from a
> user point of view).
> 
> However, if "within the subtree" includes the subtree root, then foo:x must
> be extension element. 

When the spec says "within the subtree rooted at a node x", then the
root of the subtree is x, and hence the subtree includes x.

> But if foo:x is an extension element, then I should
> not consult the xsl:extension-element-prefixes attribute (since it's only
> effective if used on literal result elements).

14.1: "A namespace is designated as an extension namespace by using ...
an xsl:extension-element-prefixes attribute on a literal result element
***or extension element***"

>  But if I never consult the
> xsl:extension-element-prefixes attribute, then foo:x cannot be an extension
> element.  This interpretation therefore leads to a circular definition.


> 2. How about "xsl:exclude-result-prefixes"?  Does this take effect
> immediately on the literal result element upon which it is defined, or only
> for descendants?  Once again, the spec only says "within the subtree"
> (section 7.1.1).

As before, a subtree includes its root.

James


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]