|
next
|
 Subject: return different result based on conditions Author: Steve Anderson Date: 16 Nov 2009 10:23 AM
|
Hi Alberto, thanks for responding.
In a nut shell this is what I have.
<dept>
<items>PS3, PSP, XBox, Wii</items>
</dept>
<dept>
<items>PS3, XBox</items>
</dept>
<dept>
<items>Wii</items>
</dept>
<dept>
<items>PSP, Wii</items>
</dept>
<item>
<name>PS3</name>
<price>300</price>
</item>
<item>
<name>PSP</name>
<price>150</price>
</item>
<item>
<name>Xbox</name>
<price>350</price>
</item>
<item>
<name>Wii</name>
<price>250</price>
</item>
the code that i have, looks like this
total = 0
for all departments
string array of <items> using tokenize with delimiter ", "
for all items found in the department
if item = "PS3"
then total = total + 300
else if item = "PSP"
then total = total + 150
and
so
on...
So, I found out the hard way that you can't change a variable in XQuery. So, this sudo code will not work.
|
|
|
|