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<='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']
精彩评论