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: 2.1 Must Allow Matching on Default Namespace Without Explicit Prefix


> okay, so something like:
>
> <xsl:stylesheet match-on-default="yes"...

I haven't thought through all the practicalities of this, but how about
something along the lines of:
   <xsl:stylesheet xmlns:xsl="..." xsl:xmlns="some_uri" ...

This could then be applied to individual templates or any other element if
needed, and would be expected to apply to all XPaths in the element's scope
unless overridden by a descendent element:
    <xsl:template match="/foo/bar" xsl:xmlns="some_uri">
        <!-- count baz children in the some_uri namespace -->
        <xsl:value-of select="count(baz)"/>
        <!-- count baz children in the null namespace -->
        <xsl:value-of select="count(baz)" xsl:xmlns=""/>
    </xsl:template>

I can see that the use of xsl:'xmlns' might cause parser compatibility
problems, but some other name like xsl:xpathns would work almost as well.

Dave Hartnoll.



 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]