Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 在xpath中使用[not]检索与给定值不匹配的内容(PLSQL)_Xml_Xpath_Plsql - Fatal编程技术网

Xml 在xpath中使用[not]检索与给定值不匹配的内容(PLSQL)

Xml 在xpath中使用[not]检索与给定值不匹配的内容(PLSQL),xml,xpath,plsql,Xml,Xpath,Plsql,我尝试使用以下代码过滤掉不包含给定状态代码的xml返回标记: l_xml_return := (xmltype(l_xml_response).extract('//return[not(issueStatusId=84388)]| //return[not(issueStatusId=73630)]|

我尝试使用以下代码过滤掉不包含给定状态代码的xml返回标记:

l_xml_return := (xmltype(l_xml_response).extract('//return[not(issueStatusId=84388)]|
                                                                      //return[not(issueStatusId=73630)]|
                                                                      //return[not(issueStatusId=67539)]|
                                                                      //return[not(issueStatusId=42527)]|
                                                                      //return[not(issueStatusId=22702)]|
                                                                      //return[not(issueStatusId=20643)]|
                                                                      //return[not(issueStatusId=4368)]|
                                                                      //return[not(issueStatusId=4363)]|
                                                                      //return[not(issueStatusId=4364)]
                                                                     ').getclobval());
我的xml由以下内容组成:

<results>
  <return>
    <issueStatusId>84388</issueStatusId>
    <name>Test 1</name>
  </return>
  <return>
    <issueStatusId>4364</issueStatusId>
    <name>Test 2</name>
  </return>
  <return>
    <issueStatusId>999999</issueStatusId>
    <name>Test 3</name>
  </return>
</results>

84388
测试1
4364
测试2
999999
测试3
使用此xml代码和xpath语句,只应返回问题状态为999999的返回标记,但实际情况并非如此

有人知道这是为什么吗

干杯

杰齐平

|
运算符计算其操作数的并集,这些操作数必须是节点集

而您需要这些多个元素的交集
//返回[not(…)]

可以对多个
not()
条件使用
作为谓词

//return[
    not(issueStatusId=84388) and
    not(issueStatusId=73630) and
    not(issueStatusId=67539) and
    not(issueStatusId=42527) and
    not(issueStatusId=22702) and
    not(issueStatusId=20643) and
    not(issueStatusId=4368) and
    not(issueStatusId=4363) and
    not(issueStatusId=4364)]
或相当于:

//return[
    not(
        issueStatusId=84388 or
        issueStatusId=73630 or
        issueStatusId=67539 or
        issueStatusId=42527 or
        issueStatusId=22702 or
        issueStatusId=20643 or
        issueStatusId=4368 or
        issueStatusId=4363 or
        issueStatusId=4364
        )
    ]

+最后一个为1:)非常感谢。最后一个是我需要的。遗憾的是,W3CSCHOOLS关于XPATH的信息有点缺乏,而且我并不经常使用XML,因此不确定是否有or运算符。