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