xsl-list
[Top] [All Lists]

Re: [xsl] Compact XPath syntax

2007-12-26 07:33:42
At 2007-12-26 18:17 +0530, Mukul Gandhi wrote:
Incidentally, for the above example, I would write the expression as:
//c[parent::b]
//c[parent::f]
(in these examples, we filter nodes using a predicate).

Have you considered instead the following equivalent addresses:

  //b/c
  //f/c

or //c (if you want to select all 'c' elements everywhere in the tree).

Remembering, though, in all the above cases that "//" can be an expensive XPath address and should be used sparingly.

I hope this helps.

. . . . . . . . . . . Ken


--
Comprehensive in-depth XSLT2/XSL-FO1.1 classes: Austin TX,Jan-2008
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>