File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Wanted: minimal XPath sample Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Wanted: minimal XPath sample" Watch "Wanted: minimal XPath sample" New topic

Wanted: minimal XPath sample

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 397
Xalan was supposed to contain an XPATH example that could run with only standard jar files. Unfortunately, I can find no such example in the latest xalan.

Can someone convert the example below (or provide a similar example) so it will run without putting xalan in the class path?

(Edited to remove extremely long line that made the post far too wide - PC)
[ December 06, 2007: Message edited by: Paul Clapham ]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Make sure you are using Java 5 or later. Start by replacing "import org.apache.xpath.XPathAPI;" with "import javax.xml.xpath.*". Then replace the beginning of the XPath code like this:I will let you do the rest of the changes and fix whatever I didn't do quite right there.
I agree. Here's the link:
subject: Wanted: minimal XPath sample
It's not a secret anymore!