I have the following xml file:
<persons> <person name="shawn"> <age>34</age> <hair style="spikes">red</hair> </person> <person name="mike"> <age>36</age> <hair style="bald">red</hair> </person> <person name="shawn"> <age>38</age> <hair style="bald">red</hair> </person> </persons>
Using XPath in C #, is it possible to select the person element, where the name is "Shawn" and the style is hair = "bald"?
I tried using:
XElement.XPathSelectElement("//person[@name='shawn'] | //person/hair[@style='bald']
but it gives me a link to the hair element, not the human element.
Thanks in advance:)
Peter
source share