I've an xml document that looks a bit like this
<Vendors>
<Vendor Stationery="Fred" />
<Vendor Stationery="bert" />
<Vendor Stationery="bert" />
</Vendors>
I want to extract a list of the distinct values of Stationery. I've found
some things on the web that suggest XPath statements to do this (in XSLT),
but I get the error 'The Expression passed to this should result in a node
set with my attempts. Here is my code
String XPathString = "Vendor/[not(@InvoiceStationery =
preceding-sibling::Vendor/@InvoiceStationery]@InvoiceStationery";
XmlNodeList Stationery = xmlVendors.SelectNodes(XPathString);
I can select fine with Vendor/@InvoiceStationery, but with the duplications.
I've tried several variations but I am unsure if it is the XPath or
something else. My GUESS is that the error means that the return is a
scalar value and not nodes, but I don't find it the clearest description
ever!
Iain