Hi,
I want to search an xml file for particular searchstrings and also
based on the date i.e. all items containing the date -----prior to the
specified date, or ----on that date or ----- after the specified date.
Also i want to search throught he xml nodes for more than one search string.
for e.g.
suppose i have an xml file
<books>
<book>
<title> abcdef </title>
<author> sdkfj </author>
<pubdate> 2004/12/02 </pubdate>
</book>
<book>
<title> kjdfj </title>
<author> kdjfk </author>
<pubdate> 2003/09/31 </pubdate>
</book>
<book>
<title> kjdfj </title>
<author> kdjfk </author>
<pubdate> 2001/02/21 </pubdate>
</book>
</books>
Now my web page can accept different search criterias.
like SEARCH FOR
searchtitle = "abc"
searchauthor = "kjk"
searchdate = before/after/on(dropdownlist) 2001/02/21
How can i specify the XPath expression for each of these search conditions.
uptil now what i have been able to do is i am able to search the xml nodes
based on one particular search string
i.e. in the following way
string matchFrom = "descendant::book[contains(title, '" +searchtitle +
"')]";
XmlNodeList nodelist = doc.SelectNodes(matchFrom);
How can i perform the search based on multiple search criterias and how can
i comapre for the date value.
Please help,
Any advice would be helpful,
regards
Smita.