English | česky | Nederlands | Français | >> Español << | По-русски | Deutsch | 中文 | Italiano | Polski ZVON > Tutorials > XPath Tutorial
>> Ejemplo 16 << | Ant | Prox

El eje 'preceding-sibling' contiene todos los elementos hermanos que preceden el nodo del contexto.
 
/AAA/XXX/preceding-sibling::*

     <AAA>
          <BBB>
               <CCC/>
               <DDD/>
          </BBB>
          <XXX>
               <DDD>
                    <EEE/>
                    <DDD/>
                    <CCC/>
                    <FFF/>
                    <FFF>
                         <GGG/>
                    </FFF>
               </DDD>
          </XXX>
          <CCC>
               <DDD/>
          </CCC>
     </AAA>
Abrir el ejemplo en XLab. | Vista arborescente (JPG)
 
//CCC/preceding-sibling::*

     <AAA>
          <BBB>
               <CCC/>
               <DDD/>
          </BBB>
          <XXX>
               <DDD>
                    <EEE/>
                    <DDD/>
                    <CCC/>
                    <FFF/>
                    <FFF>
                         <GGG/>
                    </FFF>
               </DDD>
          </XXX>
          <CCC>
               <DDD/>
          </CCC>
     </AAA>
Abrir el ejemplo en XLab. | Vista arborescente (JPG)