如果路径以双斜线 // 开头, 则表示选择文档中所有满足双斜线//之后规则的元素(无论层级关系)
 
//BBB
选择所有BBB元素

     <AAA>
          <BBB/>
          <CCC/>
          <BBB/>
          <DDD>
               <BBB/>
          </DDD>
          <CCC>
               <DDD>
                    <BBB/>
                    <BBB/>
               </DDD>
          </CCC>
     </AAA>
 
//DDD/BBB
选择所有父元素是DDD的BBB元素

     <AAA>
          <BBB/>
          <CCC/>
          <BBB/>
          <DDD>
               <BBB/>
          </DDD>
          <CCC>
               <DDD>
                    <BBB/>
                    <BBB/>
               </DDD>
          </CCC>
     </AAA>


posted on 2006-06-22 19:04  滋心  阅读(631)  评论(0编辑  收藏  举报