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]
Other format: [Raw text]

Re: key() question?


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.]
Jeni,

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>
--
Steven Noels http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
stevenn@outerthought.org stevenn@apache.org


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]