xpath: implementing search
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 4
- Joined: Wed Nov 09, 2005 4:48 pm
xpath: implementing search
Post by zqzproject »
hi, in my java code, i have the following string as asearch string so as to look up for some particular nodes in an xml file:
xpathselect="//contact[child::"+ keywords + "/child::text()='" + keywordsvalue + "'";
however that selects the element with EXACTLY THE SAME value of keywords, not a sensible mechanism. so i d like to know if there are any wildcards in xpath or any way that i can do that so that i can do something like:
xpathselect = ""//contact[child::name/child::text()='*myname*']""
whihc then returns any contact whose name CONTAINS THE string myname? i know there is a function 'contains' in xpath, but have experimented alot still cant get it work. any hints pls?
thanks alot!!
xpathselect="//contact[child::"+ keywords + "/child::text()='" + keywordsvalue + "'";
however that selects the element with EXACTLY THE SAME value of keywords, not a sensible mechanism. so i d like to know if there are any wildcards in xpath or any way that i can do that so that i can do something like:
xpathselect = ""//contact[child::name/child::text()='*myname*']""
whihc then returns any contact whose name CONTAINS THE string myname? i know there is a function 'contains' in xpath, but have experimented alot still cant get it work. any hints pls?
thanks alot!!
-
- Posts: 4
- Joined: Wed Nov 09, 2005 4:48 pm
Return to “General XML Questions”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service