根据子项的引用值返回引用字段

时间:2019-05-15 21:15:58

标签: xml xpath

我想返回所有类型为veg的产品。

但这是表达式似乎无效,我在做什么错:

Products/Product[Type[@ref="veg"]]

 <Products>
            <Product ref="apple">
                <Type ref="fr">FRUIT</Type>
                <Price>100</Price>                
            </Product>
            <Product ref="cabbage">
                <Type ref="veg">VEGETABLE</Type>
                <Price>200</Price>                
            </Product>
</Products>

0 个答案:

没有答案
相关问题