如何解决急需的XPATH表达式帮助
<?xml version="1.0" encoding="UTF-8"?>
<Restaurants>`enter code here`
<Restaurant1 Name = "Sir Martin Food">
<Address>Tirupattir,College South Gate</Address>
<Phone_Number>+91 901285479</Phone_Number>
<Cuisine>
<Breakfast_Menu>
<Food_Type>Italain</Food_Type>
<Price>Rs200</Price>
<Description>The full English breakfast consists of bacon,fried egg,sausage,mushrooms,baked beans,toast,grilled tomatoes,and accompanied with tea or coffee</Description>
<Calories>250</Calories>
<Food_Type>Indian</Food_Type>
<Price>Rs200</Price>
<Description>The full English breakfast consists of bacon,and accompanied with tea or coffee</Description>
<Calories>250</Calories>
</Breakfast_Menu>
</Cuisine>
</Restaurant1>
<Restaurant2 Name = "Son Continental">
<Address>Tirupattir,College South Gate</Address>
<Phone_Number>+91 901285479</Phone_Number>
<Cuisine>
<Breakfast_Menu>
<Food_Type>South African</Food_Type>
<Price>Rs200</Price>
<Description>The full English breakfast consists of bacon,and accompanied with tea or coffee</Description>
<Calories>250</Calories>
<Food_Type>Ghanaian</Food_Type>
<Price>Rs200</Price>
<Description>The full English breakfast consists of bacon,and accompanied with tea or coffee</Description>
<Calories>250</Calories>
</Breakfast_Menu>
</Cuisine>
</Restaurant2>
</Restaurants>
我对XML和XPATH表达式非常陌生,我编写了这段代码,并试图使用x路径表达式将所有Food_Type为Italian的所有饭店的所有
解决方法
最好在以下情况下使用一致的餐厅元素:
<Restaurant id="1"..
XPath
/Restaurants/*[Cuisine/Breakfast_Menu/Food_Type="Italain"]/Phone_Number
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。