Hello My Friends i have an xml like this:
<?xml version="1.0" encoding="utf-8" ?>
<books>
<book category="Fiction" >
<author>Jack Kerouac</author>
<title>On the Road</title>
</book>
<book category="IT" >
<author>Stephen Walther</author>
<title>ASP.NET Unleashed</title>
</book>
</books>
It is OK if i use this xpath query :
string query = "//book[@category='Fiction']//title";
XPathNodeIterator xPathIt = p_xPathNav.Select(query);
and I'll get the answer right : Jack Kerouac
But the problem is here,when i don't have attributes name like this:
string query = "//book['Fiction']//title";
And I don't know what is the name of the first attributes of nodes.
How can i find a node with xpath , without knowing first attribute name of any nodes? (i just have attribute value for filtering the nodes)
Thanks
"//book[@*='Fiction']//title"? - Andersson