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
XPath谓词中的通配符_Xpath - Fatal编程技术网

XPath谓词中的通配符

XPath谓词中的通配符,xpath,Xpath,我正在尝试编写一个xpath表达式,该表达式将计算为ItemInfo中的特定子字符串 <Catalog> <List> <Item> <ItemInfo> This describes the Item In which it is listed. </ItemInfo> </Item> <Item>

我正在尝试编写一个xpath表达式,该表达式将计算为ItemInfo中的特定子字符串

<Catalog>
   <List>
      <Item>
        <ItemInfo>
            This describes the Item In which it is listed.
        </ItemInfo>
      </Item>
      <Item>
        <ItemInfo>
            This is another item description.
        </ItemInfo>
      </Item>
   </List>
</Catalog>

没有通配符。只需指定文字子字符串:

/Catalog/List//Item/ItemInfo[包含(,'other')]

没有通配符。只需指定文字子字符串:

/Catalog/List//Item/ItemInfo[包含(,'other')]
> /Catalog/List//Item/ItemInfo[contains(.,*'another'*)]