开发者

xpath query value comparison problem

I have got a xml file that has a element, called property which contains a v开发者_高级运维alue element. Somhow in another connected system the value has changed from integer to decimal and therefor the comparison does not work anymore. Is there someway to do the comparison anyway? Xml and xpath will follow below.

xml:

<product>
   <properties>
       <property type="decimal" name="Volume" unit="l">
           <value>100,0</value>
       </property>
   </properties>
</product>

xpath:

/product/properties/property[@name='Volume' and value&lt;='200']

How do i write the xpath to work with the decimal value instead?

Thanks.


You can use translate to convert the

/product/properties/property[@name='Volume' and translate(value, ',', '.')<='200']
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜