I have an XML element such as:
<items>
<item>
<size>360</size>
<quantity>400</quantity>
<item>
<item>
<size>540</size>
<quantity>1200</quantity>
<item>
<item>
<size>360</size>
<quantity>600</quantity>
<item>
<item>
<size>800</size>
<quantity>750</quantity>
<item>
</items>
What I need to do is iterate over this element and pull out ONLY the first item elements with a distinct size element. So I want to have:
<item>
<size>360</size>
<quantity>400</quantity>
<item>
<item>
<size>540</size>
<quantity>1200</quantity>
<item>
<item>
<size>800</size>
<quantity>750</quantity>
<item>
Removing the second item element with a size of 360. Is there a way of filtering these out in a for loop filter statement?
One way is:
another is
and yet another (more evil) way is