This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Wanted: minimal XPath sample Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Wanted: minimal XPath sample" Watch "Wanted: minimal XPath sample" New topic
Author

Wanted: minimal XPath sample

Siegfried Heintze
Ranch Hand

Joined: Aug 11, 2000
Posts: 359
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?
Thanks,
Siegfried


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

Joined: Oct 14, 2005
Posts: 16483
    
    2

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: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Wanted: minimal XPath sample
 
Similar Threads
Sample on how to work with XPATH
XPath problem
? How to call JAXP/JDOM from other class
XPath expression constrained by a predicate doesn't work (//element[@attribute="value"])
How to detect EOF when using java.io.BufferedReader?