I’m new to xml in .net, And I have this requirements that i need to search in xml file. For example i have this xml file.
<?xml version="1.0" encoding="utf-8"?>
<Books>
<Book>
<Title>Sample book1</Title>
</Book>
<Book>
<Title>Sample book2</Title>
</Book>
<Book>
<Title>Another book</Title>
And for example I use the word “sample” as search key so the output would be Sample book1 and Sample book2. and if I used “book” as search key, the output would be Sample book1,Sample book2 and Another book.
Base from what i have right now, it seems it’s not possible.
Dim xmlDocument As New XmlDocument()
Dim _xmlDataSource As New XmlDataSource
xmlDocument.Load(Server.MapPath("XML/Books.xml"))
Dim node = xmlDocument.DocumentElement.SelectSingleNode("./Books/Book[@title='SearchKey']")
Is this possible in .net? Can you review also if my xml file is in correct format base on the requirements.
Thanks in advance
I can show you example (you can use linq questions) This is my old project:
var billings = from damskie in billingData.Element(“ubrania”).Element(“damska”).Element(“pm”).Descendants(“item”)
select new dane_xml_panel((int)damskie.Element(“id”));
Class
and here you have got xml file(dane xml):