C
Christofer Dutz
Hi,
I just ran into an interesting situation, where I was not able to write
an xpath expression doing what I want it to. Mabe someone here can help
me ... I hope
Here a sample xml-file I want to do the query on:
<?xml version="1.0" encoding="UTF-8"?>
<cart>
<product count="2" price="10.00" id="sdkjfhdaf-A"/>
<product count="1" price="10.00" id="sdkjfhdaf-A"/>
<product count="1" price="30.00" id="sdkjfhdaf-B"/>
<product count="4" price="12.50" id="sdkjfhdaf-C"/>
<product count="2" price="16.00" id="sdkjfhdaf-A"/>
<product count="3" price="119.00" id="sdkjfhdaf-C"/>
<product count="2" price="13.99" id="sdkjfhdaf-A"/>
<product count="10" price="12.34" id="sdkjfhdaf-B"/>
<product count="3" price="11.00" id="sdkjfhdaf-B"/>
<product count="1" price="1.00" id="sdkjfhdaf-A"/>
</cart>
I would like to test, if the total price for all products in the cart
which have an Id containing "-C" in their id-attribute is biger than
lets say 100.
I have no problem selecting either the price or count attribute of these
but I am unable to get "price * count".
Any suggestions?
I created a workaround by adding an additional total-attribute and
everything is working fine, it's just my scientiffic curiosity
Chris
I just ran into an interesting situation, where I was not able to write
an xpath expression doing what I want it to. Mabe someone here can help
me ... I hope
Here a sample xml-file I want to do the query on:
<?xml version="1.0" encoding="UTF-8"?>
<cart>
<product count="2" price="10.00" id="sdkjfhdaf-A"/>
<product count="1" price="10.00" id="sdkjfhdaf-A"/>
<product count="1" price="30.00" id="sdkjfhdaf-B"/>
<product count="4" price="12.50" id="sdkjfhdaf-C"/>
<product count="2" price="16.00" id="sdkjfhdaf-A"/>
<product count="3" price="119.00" id="sdkjfhdaf-C"/>
<product count="2" price="13.99" id="sdkjfhdaf-A"/>
<product count="10" price="12.34" id="sdkjfhdaf-B"/>
<product count="3" price="11.00" id="sdkjfhdaf-B"/>
<product count="1" price="1.00" id="sdkjfhdaf-A"/>
</cart>
I would like to test, if the total price for all products in the cart
which have an Id containing "-C" in their id-attribute is biger than
lets say 100.
I have no problem selecting either the price or count attribute of these
but I am unable to get "price * count".
Any suggestions?
I created a workaround by adding an additional total-attribute and
everything is working fine, it's just my scientiffic curiosity
Chris