|
Subject: Re: [xsl] Testing by counting or positional predicate From: Francis Norton <francis@xxxxxxxxxxx> Date: Fri, 12 Jan 2001 11:10:03 +0000 |
Daniel Bowen wrote:
>
> Just for an opposing view point on this, on one stylesheet that I use
> Muenchian grouping, I have a filter on the key "match". When I use the
> "count" method, I have to use the filter again when selecting the nodes, but
> when I use the "generate-id" method, I don't have to use the filter again.
> In my case, the "generate-id" method is 2-3 times faster!
>
> Example:
>
> <xsl:key
> name="key-texture"
> match="Texture[0=count(preceding-sibling::Texture[1])]"
> use="concat(@texture, ':', @u, ':', @v)" />
> <xsl:variable
> name="primary-textures"
> select="//Texture[generate-id(.) = generate-id(key('key-texture',
> concat(@texture, ':', @u, ':', @v))[1])]" />
>
> is faster for me than:
>
> <xsl:key
> name="key-texture"
> match="Texture[0=count(preceding-sibling::Texture[1])]"
> use="concat(@texture, ':', @u, ':', @v)" />
> <xsl:variable
> name="primary-textures"
>
> select="//Texture[0=count(preceding-sibling::Texture[1])][count(.|key('key-t
> exture', concat(@texture, ':', @u, ':', @v))[1])]" />
>
Did you try
<xsl:variable
name="primary-textures"
select="//Texture[count(. | (key('key-texture', concat(@texture, ':',
@u, ':', @v))[1]) = 1]"
/>
which seems to me to be the equivalent to your generate-id()version?
Francis.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Testing by counting or po, Daniel Bowen | Thread | Re: [xsl] Beware the count method w, Daniel Bowen |
| Re: [xsl] Recursive xsl parsing., Francis Norton | Date | RE: [xsl] Passing text() or element, Kay Michael |
| Month |