[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: selecting text node where one of its parents...

Subject: Re: selecting text node where one of its parents...
From: "Christopher R. Maden" <crism@xxxxxxxxxx>
Date: Thu, 14 Sep 2000 17:39:42 -0700
select text of a node
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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.