Child sequences
Navigating by the numbers
-
IDs are intrusive
Sometimes you need to establish a quick link, but don't want to add IDs to your document (or someone else's), or can't count on the environment to support IDs. Child sequences let you 'walk a tree' to reach a target destination.
-
This number child, then that number child...
A child sequence starts with a /, representing the root of the document. The number following that identifies which child element to move to next - typically 1, for the root element. (External parsed entities may have multiple top-level elements.) If you need to navigate beyond the root element, you add a slash followed by an integer value identifying which child element you want - 1 is first, 2 is second, etc. You produce an identifier like
/1/4/5
, for the fifth child element of the fourth child element of the root element.
-
Combining with bare names
If you wanted to reference the third child of the fourth child of the element whose ID was 'neato', you could write:
neato/4/3
.
-
Integrating with URIs
Child sequences and bare name/child seqence combinations can appear directly after the pound sign (#)in the URI:
http://www.example.com/mydoc.xml#neato/4/3
Previous Page <
TOC
> Next Page