This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: selecting text node where one of its parents...
- To: xsl-list at mulberrytech dot com
- Subject: Re: selecting text node where one of its parents...
- From: "Christopher R. Maden" <crism at lexica dot net>
- Date: Thu, 14 Sep 2000 17:39:42 -0700
- References: <39C0DB6A.8F9591C0@redwood.nl><39C0DB6A.8F9591C0@redwood.nl>
- Reply-To: xsl-list at mulberrytech dot com
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