English | česky | Nederlands | Français | Español | По-русски | Deutsch | 中文 | >> Italiano << | Polski ZVON > Tutorials > XPath Tutorial
>> Esempio 20 << | Precedente | Successivo

L'asse ancestor-or-self contiene il nodo contesuale e i suoi progenitori: dunque, l'asse ancestor-or-self includerà sempre il nodo radice.
 
/AAA/XXX/DDD/EEE/ancestor-or-self::*

     <AAA>
          <BBB>
               <CCC/>
               <ZZZ>
                    <DDD/>
               </ZZZ>
          </BBB>
          <XXX>
               <DDD>
                    <EEE/>
                    <DDD/>
                    <CCC/>
                    <FFF/>
                    <FFF>
                         <GGG/>
                    </FFF>
               </DDD>
          </XXX>
          <CCC>
               <DDD/>
          </CCC>
     </AAA>
Apri l'esempio in XLab. | Vista ad albero (JPG)
 
//GGG/ancestor-or-self::*

     <AAA>
          <BBB>
               <CCC/>
               <ZZZ>
                    <DDD/>
               </ZZZ>
          </BBB>
          <XXX>
               <DDD>
                    <EEE/>
                    <DDD/>
                    <CCC/>
                    <FFF/>
                    <FFF>
                         <GGG/>
                    </FFF>
               </DDD>
          </XXX>
          <CCC>
               <DDD/>
          </CCC>
     </AAA>
Apri l'esempio in XLab. | Vista ad albero (JPG)