Jump to content

XPATH - Select elements by attribute value


Andreas42

Recommended Posts

Hi,

I struggle with choosing unique elements from a list that are given their uniqueness by an attribute.

The XML is the following:

<elemente>
	<element>
		<subelement wert="1"/>
	</element>
	<element>
		<subelement wert="2"/>
	</element>
	<element>
		<subelement wert="3"/>
	</element>
	<element>
		<subelement wert="2"/>
	</element>
	<element>
		<subelement wert="1"/>
	</element>
	<element>
		<subelement wert="4"/>
	</element>
	<element>
		<subelement wert="1"/>
	</element>
</elemente>

The result should be a list of odes like:

<element>
	<subelement wert="1"/>
</element>
<element>
	<subelement wert="2"/>
</element>
<element>
	<subelement wert="3"/>
</element>

Would be great if anybody could help me with that.

Thanks Andreas

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...