[Home] [By Thread] [By Date] [Recent Entries]
At 11:10 AM 9/12/2008, David wrote:
> (//para)[1] > > and > > /descendant::para[1] > > are equivalent? Yes. Their semantics are different, but they return the same node, which I guess makes them equivalent. The difference between //para[1] and (//para)[1] is that in the former case, the predicate operates only on the final step of a path with two steps, whereas in the latter, the predicate operates on the node set returned by the expression as a whole. This is much easier to see in the long form: //para[1] is /descendant-or-self::node()/child::para[1] (//para)[1] is (/descendant-or-self::node()/child::para)[1] Cheers, Wendell ====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
|

Cart



