Из следующего мне нужно вернуть отдельный список значений с атрибутом Category
.
<root>
<classifications>
<classification name="Category">Category One</classification>
<classification name="Sub-Category">Sub-Category One</classification>
</classifications>
<classifications>
<classification name="Category">Category Two</classification>
<classification name="Sub-Category">Sub-Category One</classification>
</classifications>
<classifications>
<classification name="Category">Category One</classification>
<classification name="Sub-Category">Sub-Category Two</classification>
</classifications>
<classifications>
<classification name="Category">Category Three</classification>
<classification name="Sub-Category">Sub-Category One</classification>
</classifications>
<classifications>
<classification name="Category">Category One</classification>
<classification name="Sub-Category">Sub-Category Two</classification>
</classifications>
<classifications>
<classification name="Category">Category Two</classification>
<classification name="Sub-Category">Sub-Category One</classification>
</classifications>
</root>
Используя classifications/classification[@name="Category"]
Я получаю:
Category One
Category Two
Category One
Category Three
Category One
Category Two
Что мне нужно, это:
Category One
Category Two
Category Three