string-length函数返回字符串的字符数,你应该用&lt;替代<, 用&gt;代替>
//*[string-length(name()) = 3]
选择名字长度为3的元素

     <AAA>
          <Q/>
          <SSSS/>
          <BB/>
          <CCC/>
          <DDDDDDDD/>
          <EEEE/>
     </AAA>
 
//*[string-length(name()) < 3]
选择名字长度小于3的元素

     <AAA>
          <Q/>
          <SSSS/>
          <BB/>
          <CCC/>
          <DDDDDDDD/>
          <EEEE/>
     </AAA>
 
//*[string-length(name()) > 3]
选择名字长度大于3的元素

     <AAA>
          <Q/>
          <SSSS/>
          <BB/>
          <CCC/>
          <DDDDDDDD/>
          <EEEE/>
     </AAA>
posted on 2006-07-01 11:11  滋心  阅读(623)  评论(0编辑  收藏  举报