Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wildcard search support in XPath

843834Mar 2 2006 — edited Mar 2 2006
Hi 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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 30 2006
Added on Mar 2 2006
1 comment
370 views