11.4 Node Types

node()

any node of any type



/

root



*

any element node



@*

any attribute node



text()

any text node



comment()

 



processing-instruction()

 

processing-instruction(’target’)

 

<article title="red"  
         canvas="yellow">  
  <section>  
    <title>First  
       section</title>  
    <sentence>Some  
       text.</sentence>  
    <sentence>More  
       text.</sentence>  
    <!--comment-->  
    <?pi ...>  
    <?pia ...>  
  </section>  
  <ns:appendix xmlns:ns="none"/>  
</article>

//*/text()

 



//comment()

 



//processing-instruction()

 



//processing-instruction(’pi’)

 



//node()/*/@*