>> English << | česky | Nederlands | Français | Español | По-русски | Deutsch | 中文 | Italiano | Polski ZVON > Tutorials > XPath Tutorial
>> Example 19 << | Prev | Next

The descendant-or-self axis contains the context node and the descendants of the context node
 
/AAA/XXX/descendant-or-self::*

     <AAA>
          <BBB>
               <CCC/>
               <ZZZ>
                    <DDD/>
               </ZZZ>
          </BBB>
          <XXX>
               <DDD>
                    <EEE/>
                    <DDD/>
                    <CCC/>
                    <FFF/>
                    <FFF>
                         <GGG/>
                    </FFF>
               </DDD>
          </XXX>
          <CCC>
               <DDD/>
          </CCC>
     </AAA>
Open the example in XLab. | Tree view (JPG)
 
//CCC/descendant-or-self::*

     <AAA>
          <BBB>
               <CCC/>
               <ZZZ>
                    <DDD/>
               </ZZZ>
          </BBB>
          <XXX>
               <DDD>
                    <EEE/>
                    <DDD/>
                    <CCC/>
                    <FFF/>
                    <FFF>
                         <GGG/>
                    </FFF>
               </DDD>
          </XXX>
          <CCC>
               <DDD/>
          </CCC>
     </AAA>
Open the example in XLab. | Tree view (JPG)