"/history/item[@replace!='true']  ¦ not /history/item[name(@replace)!='replace']" 

解决方案 »

  1.   

    楼上的, 受教了不过用了not /history/item[name(@replace)!='replace' 或者把not删掉, 都滤不出来.  一个都没选到.可以帮我解释一下not和这个name吗?  谢谢.
      

  2.   

    还有, |的反义词可以用&吗? 还是&&还是什么的?
      

  3.   

    | 是Union
    and 是与 
    or 是或
      

  4.   


    谢谢.刚才大概查了一下.写成这样可以: /history/item[not(@replace)]
    现在就是不知道怎么把这三种合到一起如果写成/history/item[not(@replace)] | /history/item[@replace!='true'] | /history/item[@replace!='1']肯定不行
    后面的两个需要and但写成/history/item[not(@replace)] | /history/item[@replace!='true'] and /history/item[@replace!='1']就一个也不出来了.如果把and换成|就全部出来了,没有过滤.另外想知道有转换数据类型的函数吗?  比如/history/item[boolean(@replace)!=true].
      

  5.   


    按理说写成这样是可以的, 因为我查了很多资料都是用的boolean(@replace)=true"/history/item[boolean(@replace)=TRUE]"
    "/history/item[not(@replace)] | /history/item[boolean(@replace)=FALSE]"但只要用了boolean(@属性节)就不成功了. 不知道为什么转换不成布尔值, 但是string(@属性节)可以返回string, 真是奇怪了.
    找到不包含@replace属性的节用/history/item[not(@replace)]已经可以了.