Re: [xsl] key() question?

Subject: Re: [xsl] key() question?
From: Steven Noels <stevenn@xxxxxxxxxxxxxxxx>
Date: Wed, 10 Jul 2002 13:57:44 +0200
Jeni Tennison wrote:
Hi Steven,

I have some keys declared for easy access to the attributes declared for
a specific element, and to retrieve the contentModels in which an element is referred to:

<xsl:key name="attlistbyname" match="/dtd/attlist" use="@ename"/>
<xsl:key name="contentmodelbychildren" match="//contentModel" use="descendant::element/@name"/>

[A // beginning a pattern (match attribute) is always superfluous --
you're matching "any contentModel element that is a descendant of the
root node" when you may as well match "any contentModel element" since
all elements must be descendants of the root node by definition.]


I want to understand this: is this the behaviour of the key construct? Will it always do a full recursive traversal of the entire tree to locate nodes matches by the pattern? Or is there something else that I need to keep in mind when specifying patterns for keys?

Steven Noels                  
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@xxxxxxxxxxxxxxxx                      stevenn@xxxxxxxxxx

XSL-List info and archive:

Current Thread