Hello!
I have the following document structure
<Items>
<Item>
<Type>foo</Type>
<Value>1.00</Value>
</Item>
<Item>
<Type>bar</Type>
<Value>-2.00</Value>
</Item>
<Item>
<Type>foo</Type>
<Value>1.00</Value>
</Item>
<!-- more <Item>s here -->
</Items>
To summarize, <Items> can contain any number of <Item>
tags. Each <Item> tag contains <Type> and <Value> tags.
What I need to do is the following. Given value of "foo",
I need to find all <Item> tags with <Type> set to "foo"
and print out the sum of all <Value>s.
Is this something that can be done? I can't figure this
out for the life of me... heh
Thanks!
I have the following document structure
<Items>
<Item>
<Type>foo</Type>
<Value>1.00</Value>
</Item>
<Item>
<Type>bar</Type>
<Value>-2.00</Value>
</Item>
<Item>
<Type>foo</Type>
<Value>1.00</Value>
</Item>
<!-- more <Item>s here -->
</Items>
To summarize, <Items> can contain any number of <Item>
tags. Each <Item> tag contains <Type> and <Value> tags.
What I need to do is the following. Given value of "foo",
I need to find all <Item> tags with <Type> set to "foo"
and print out the sum of all <Value>s.
Is this something that can be done? I can't figure this
out for the life of me... heh
Thanks!