Hi I require help parsing the following XML.
<xmeml>
<Doc>
<Test>
<Unit>abc</Unit>
<Unit2>1234</Unit2>
</Test>
<Test>
<Unit>bcd</Unit>
<Unit2>2345</Unit2>
</Test>
</Doc>
<Doc>
<Test>
<Unit>abc</Unit>
<Unit2>3456</Unit2>
</Test>
<Test>
<Unit>cde</Unit>
<Unit2>3456</Unit2>
</Test>
</Doc>
<Doc>
<Test>
<Unit>abc</Unit>
<Unit2>1234</Unit2>
</Test>
<Test>
<Unit>def</Unit>
<Unit2>4567</Unit2>
</Test>
</Doc>
<Doc>
<Test>
<Unit>abc</Unit>
<Unit2>1234</Unit2>
</Test>
<Test>
<Unit>efg</Unit>
<Unit2>2345</Unit2>
</Test>
</Doc>
</xmeml>
ending up with the following
<xmeml>
<Doc>
<Test>
<Unit>bcd</Unit>
<Unit2>2345</Unit2>
</Test>
</Doc>
<Doc>
<Test>
<Unit>abc</Unit>
<Unit2>3456</Unit2>
</Test>
<Test>
<Unit>cde</Unit>
<Unit2>3456</Unit2>
</Test>
</Doc>
<Doc>
<Test>
<Unit>def</Unit>
<Unit2>4567</Unit2>
</Test>
</Doc>
<Doc>
<Test>
<Unit>abc</Unit>
<Unit2>1234</Unit2>
</Test>
<Test>
<Unit>efg</Unit>
<Unit2>2345</Unit2>
</Test>
</Doc>
</xmeml>
I am attempting to create a XSLT doc to do this but as yet have not found one that works. I should note that the required matching parameters within 'Doc' are , in this case "abc" and "1234', In the real world these are variables and will never be a static searchable entity.
So in english my XSL would be like this: For any parent containing both matching 'Unit' and 'unit2' values delete all preceding parents 'Test' containing a duplicate value of 'Unit' and 'Unit2' except the last.
All help most appreciated Thanks