I have an xml document that is constructed pretty poorly-- instead of child nodes, the items have multiple attributes.
For Example:
<makes>
<option make="FORD" year_start="1950" year_end="2009" />
<option make="CHEVROLET" year_start="1965" year_end="2009" />
...
</makes>
I'm trying to use XPath to select the value of the other attributes for all nodes that match a certain attribute. I'm populating 3 asp drop down menus with values from 2 xml documents based on a previous selection. I'm using .net/c#
For Example: *for all option nodes with a make attribute that has the value x, find the value of year_start.*
I tried something like this:
yearListData.XPath = string.Format("/makes/option[@year_start] and [@make={0}]", make);
where make = the previous selection. Obviously, it didn't work.
is there a way using XPath to do this?