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: selecting text node where one of its parents...


At 15:33 14-09-2000 +0000, David Carlisle wrote:
> > How can I select
>
> >a text() node
>  text()
> > that
>       [
> > has a parent (not a direct parent)
>        ancestor::
> > which is a node named label
>                  label
> >  which has
>                       [
> >  an attribute
>                         @
> > title
>                          title
> > which equals
>                                =
> >xxx?
>                                  'xxx'
>                                       ]]

Nested square brackets are rarely necessary (as David of course knows), 
though quite useful in this explanatory example:

text()[ancestor::label/@title='xxx'] will work as well, as will (as someone 
else noted) label[@title='xxx']//text().  In theory, there shouldn't be a 
difference in speed of the implementations of one or the other, but I'm not 
sure how true that is in practice.

-Chris
--
Christopher R. Maden, Senior XML Analyst, Lexica LLC
222 Kearny St., Ste. 202, San Francisco, CA 94108-4510
+1.415.901.3631 tel./+1.415.477.3619 fax
<URL:http://www.lexica.net/> <URL:http://www.oreilly.com/%7Ecrism/>


 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]