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

If the path starts with // then all elements in the document which fulfill following criteria are selected.
 
//BBB
Select all elements BBB

     <AAA>
          <BBB/>
          <CCC/>
          <BBB/>
          <DDD>
               <BBB/>
          </DDD>
          <CCC>
               <DDD>
                    <BBB/>
                    <BBB/>
               </DDD>
          </CCC>
     </AAA>
Open the example in XLab. | Tree view (JPG)
 
//DDD/BBB
Select all elements BBB which are children of DDD

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