XPATH Java String / glob matching
Questions about XML that are not covered by the other forums should go here.
XPATH Java String / glob matching
Hi,
Two questions. For the following XML snippet:
<slide>
<item>running</item>
<item>hi</item>
<item>40</item>
</slide>
//item[.='hi']
Will return the item node with text hi.
But, (using Java):
String s = "hi";
//item[.=s]
does not work. How do I get a Java string value in there?
Also - re matching, if the user enters a*b?c I need to return any values where * = one or more char matching and ? = exactly one char matching. I believe this is called Glob matching. Any way to do this using XML/XPath. Not sure about using XSLT within Java, but I suppose that is also a possibility.
All advice appreciated.
Thanks
Laura
Two questions. For the following XML snippet:
<slide>
<item>running</item>
<item>hi</item>
<item>40</item>
</slide>
//item[.='hi']
Will return the item node with text hi.
But, (using Java):
String s = "hi";
//item[.=s]
does not work. How do I get a Java string value in there?
Also - re matching, if the user enters a*b?c I need to return any values where * = one or more char matching and ? = exactly one char matching. I believe this is called Glob matching. Any way to do this using XML/XPath. Not sure about using XSLT within Java, but I suppose that is also a possibility.
All advice appreciated.
Thanks
Laura
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