I have an XML document like this:
<wii>
<game>
<type genre="arcade" />
<type genre="sport" />
</game>
<game>
<type genre="platform" />
<type genre="arcade" />
</game>
</wii>
How to list all genres without repetition using only XPath?
Thanks.
In plain English this selects any
@genreattribute node for which there is no equally valued@genrenode in the preceding part of the document.The equality
=operator, when given a plain value and a node-set, it compares the plain value to every node in the node-set, returningtrueonly if all nodes match (note that!=does not do that, it compares to the first node of the set only!). The result must be negated withnot().