Hi
I have a XML file like below.
This XML is loaded into a DataSet, and I then create a XmlDataDocument. (Environment = VS, C#)
Using this document, I create a XPathNavigator:
I now want to pick all <author>s who has written book "Book nr 1" (only one in this case).
But how do I do this?
How do I connect bookID in one single XPath-query?
Kind Regards
I have a XML file like below.
This XML is loaded into a DataSet, and I then create a XmlDataDocument. (Environment = VS, C#)
Code:
XmlDataDocument doc = new XmlDataDocument(dataset);
Using this document, I create a XPathNavigator:
Code:
XPathNavigator nav = doc.CreateNavigator();
I now want to pick all <author>s who has written book "Book nr 1" (only one in this case).
But how do I do this?
Code:
XmlNodeList nodeList = doc.SelectNodes("//root/authors/author[bookID=...]");
How do I connect bookID in one single XPath-query?
Kind Regards
Code:
<root>
<authors>
<author>
<name>John</name>
<bookID>1</bookID>
</author>
<author>
<name>Peter</name>
<bookID>2</bookID>
</author>
</authors>
<books>
<book>
<bookID>1</bookID>
<name>Book nr 1</name>
</book>
<book>
<bookID>2</bookID>
<name>Book nr 2</name>
</book>
</books>
</root>