J. G.
J. G.

Reputation: 1832

XPath to find duplicate attributes?

What is the XPath to find (incorrectly formed, yes) elements with duplicate attributes?

Specifically they will look like this:

<relatedItem type="constituent" ID="c011" type="constituent">

Upvotes: 2

Views: 510

Answers (1)

kjhughes
kjhughes

Reputation: 111531

XPath is defined over XML. What you show is not XML, because XML does not allow two attributes on the same element to have the same name. Therefore, you cannot use XPath to select parts of your textual (non-XML) data.

Upvotes: 3

Related Questions