NOTE:
These slides have not been updated since 2003. They have been superseded by the book
Anders Møller and Michael Schwartzbach, February 2006 |
THE XML REVOLUTION - TECHNOLOGIES FOR THE FUTURE WEB |
Normal syntax | Abbreviation | |
---|---|---|
child:: | nothing (so child is the default axis) | |
attribute:: | @ | |
/descendant-or-self::node()/ | // | |
self::node() | . (useful because location paths starting with / begin evaluation at the root) | |
parent::node() | .. |
Example:
.//@href |
selects all href attributes in descendants of the context node.
Furthermore, the coercion rules often allow compact notation, e.g.
foo[3] |
refers to the third foo child element of the context node (because 3 is coerced to position()=3).
COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH |