Wildcard search support in XPath
843834Mar 2 2006 — edited Mar 2 2006Hi all,
I am using XPath in querying XML file. My application uses an XML file as a database. I am having a search portal in which user can give wildcard search like name = "M*" etc. As I am using internally XPath to read a particular NodeList from XML, I need to do a wild card search using XPath. When I saw the XPath document it only gives //* etc but not like //M*. So I want to know a way by which I can do this wild card search using XPath.
To be more clear of my requirement consider the below xml:-
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book>
<title lang="eng">Harry Potter</title>
<price>29.99</price>
</book>
<book>
<title lang="eng">Learning XML</title>
<price>39.95</price>
</book>
<book>
<title lang="eng">Learning VSS</title>
<price>39.95</price>
</book>
</bookstore>
I want the XPath query to return all the books having title that starts with "Learning" string.
Thx in advance
MK.