English | česky | Nederlands | Français | Español | По-русски | Deutsch | >> 中文 << | Italiano | Polski ZVON > Tutorials > XPath Tutorial
>> 实例 19 << | 前页 | 后页

descendant-or-self 轴(axis)包含上下文节点本身和该节点的后代节点
 
/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>
在XLab中打开实例 | 树视图 (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>
在XLab中打开实例 | 树视图 (JPG)