11.2 Child-Parent Axis Paths

Path segment: node-test

. current node
.. parent node
name named element node
@namenamed attribute node
/ root; paths concatenation
* wildcard for elements
@* wildcard for attributes
// any subpath
<article title="red"  
         canvas="yellow">  
  <section>  
    <title>First  
       section</title>  
    <sentence>Some  
       text.</sentence>  
    <sentence>More  
       text.</sentence>  
  </section>  
  <ns:appendix xmlns:ns="none"/>  
</article>

                      root
canvas="yellow"||--|      | xmlns:ns="none"
                 |     ||         |
    title= "red"||--|-<article>     |||
                        |         |
                ||------------||  |
                                  |
            <section>   <ns:appendix>
     |----------|------------|
    |||         ||          ||
  <title>  <sentence>   <sentence>
     |          |            |
    |||         ||          ||

   First       Some         More
  section      text.         text.
/

 



/article

 



/article/title

 



//@canvas

all the attribute nodes named ‘canvas’



//@*

 



./sentence

the children node elements ‘sentence’ of the current node



./*

all the children element nodes of the current node



./*/sentence

all the grandchildren node elements named ‘sentence’ of the context node



./@*

all the children attribute nodes of the current node



.//

all the descendant element nodes of the current node



//ns:appendix

all the ‘ns:appendix’ element nodes of the document