Home : Tutorials : XML and Related Technologies


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

Extra XPointer features

XPointer provides a more fine-grained addressing than XPath.

  • Instead of just nodes, XPointers address locations, which can be nodes, points, or ranges.

  • A point can represent the location preceding or following any individual character in e.g. chardata nodes.
    The special node test
      point()
    selects the set of points of a node.

  • A range consists of two points in the same document, and is specified using a special range-to location step construct.

  • XPointer provides some extra functions:
    here()   get location of element containing current XPointer
    origin()   get location where user initiated link traversal
    start-point(location-set)   get start point of location set
    string-range(...)   find matching substrings
    ...  

Example:

  /descendant::text()/point()[position()=0]

selects the locations right before the first character of all character data nodes in the document.

Example:

  /section[1] / range-to(/section[3])

selects everything from the beginning of the first section to the end of the third.

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.