Subject: Re: [xsl] Selecting only the first node that matches. From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 04 Nov 2002 21:06:45 -0500 |
If possible, I need to be able to select only the first instance of a match.
Consider the following:
<ancestor name="1"> <propertyref name="foo"/> <ancestor name="2"> <propertyref name="bar"/> <ancestor name="3"> <propertyref name="foo"/> <ancestor name="4"> <propertyref name="fnord"/>
</ancestor> </ancestor> </ancestor> </ancestor>
I would like to be able to match on the first ancestor element that has a propertyref/@name of foo, but not the second one. These nested "ancestor" elements vary in depth and can have any number of propertyref attributes.
I plan to solve this with recursion,
-- Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO: - North America: Feb 3 - Feb 7,2002
G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-10-1 Practical Formatting Using XSL-FO Next public training: 2002-12-08,2003-02-03,06,03-03,06
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Selecting only the first node, Shawn O. McKenzie | Thread | [xsl] Incorrect output with IE6, Adrian |
[xsl] Incorrect output with IE6, Adrian | Date | RE: [xsl] Incorrect output with IE6, Richard Lander |
Month |