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

The preceding-sibling axis contains all the preceding siblings of the context node
 
/AAA/XXX/preceding-sibling::*

     <AAA>
          <BBB>
               <CCC/>
               <DDD/>
          </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/preceding-sibling::*

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