Home : Tutorials : XML and Related Technologies


to the main page about the tutorial  THE XML REVOLUTION  -  TECHNOLOGIES FOR THE FUTURE WEB back up next

Location steps

A single location step has the form

    axis :: node-test [ predicate ]

  • The axis selects a rough set of candidate nodes (e.g. the child nodes of the context node).

  • The node-test performs an initial filtration of the candidates based on their
    • types (chardata node, processing instruction, etc.), or
    • names (e.g. element name).

  • The predicates (zero or more) cause a further, potentially more complex, filtration.
    Only candidates for which the predicates evaluate to true are kept.
The candidates that survive the filtration constitute the result.

This structure of location steps makes implementation rather easy and efficient, since the complex predicates are only evaluated on relatively few nodes.


The example from before:
  child::section[position()<6] / descendant::cite / attribute::href

selects all href attributes in cite elements in the first 5 sections of an article document.

back COPYRIGHT © 2000-2003 ANDERS MØLLER & MICHAEL I. SCHWARTZBACH next


Home : Tutorials : XML and Related Technologies

 

Copyright© 1998-2004 All Rights Reserved. No portion of this site may be reproduced or redistributed without prior written permission from VistaEdge Technologies

All registered trademarks appearing on this site are the property of their respective owners. Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. This site is not connected to Sun Microsystems, Inc. and is not sponsored by Sun Microsystems, Inc.