比如我有一个xml:的XPath/XSLT等检查多个值
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<TemporaryRoot>
<ProcessPurchaseOrder>
<DocumentReference>
<AlternateDocumentID>
<ID>0171688401</ID>
</AlternateDocumentID>
<AlternateDocumentID>
<ID>0171688404</ID>
</AlternateDocumentID>
<AlternateDocumentID>
<ID>0171688405</ID>
</AlternateDocumentID>
</DocumentReference>
</ProcessPurchaseOrder>
<DbResponse>
<ResultSet>
<Row>
<Cell name="WEANR" type="VARCHAR2">0171688401</Cell>
</Row>
<Row>
<Cell name="WEANR" type="VARCHAR2">0171688404</Cell>
</Row>
</ResultSet>
</DbResponse>
</TemporaryRoot>
如何编写XPath或XSLT代码以检查是否DbResponse/ResultSet/Row/Cell[@name="WEANR"]
含有的
AlternateDocumentID/ID
在这个例子中的所有值结果是假的,因为DbResponse/ResultSet/Row/Cell[@name="WEANR"]
没有0171688405
值
谢谢!你能解释一下这是如何工作的吗? – VextoR 2013-03-07 05:31:56
@VextoR,在这个答案中,我提出了一个双重否定定律的链接。因此,集合中的所有项都具有属性X,如果没有不具有此属性X的项目。现在,只需用'/ */ProcessPurchaseOrder/*/*/ID'和'property X'与'=/*/DbResponse/*/*/Cell [@ name ='WEANR']' – 2013-03-07 05:41:01