org.vfny.geoserver.zserver
Class ApplyXPath

java.lang.Object
  extended byorg.vfny.geoserver.zserver.ApplyXPath

public class ApplyXPath
extends java.lang.Object

Very basic utility for applying an XPath epxression to an xml file and printing information about the execution of the XPath object and the nodes it finds. Takes 2 arguments: (1) an xml filename (2) an XPath expression to apply to the file Examples: java ApplyXPath foo.xml / java ApplyXPath foo.xml /doc/name[1]/last From xalan source, in the samples section of the source tree. See http://xml.apache.org/xalan-j/samples.html#applyxpath Modified:


Field Summary
protected  java.lang.String filename
           
protected  java.lang.String xpath
           
 
Constructor Summary
ApplyXPath()
           
 
Method Summary
static java.lang.String[] apply(java.lang.String filename, java.lang.String xpath)
          Applies the xpath to the file, getting an array of strings of the values.
 void doMain(java.lang.String[] args)
          Process input args and execute the XPath.
static void main(java.lang.String[] args)
          Main method to run from the command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filename

protected java.lang.String filename

xpath

protected java.lang.String xpath
Constructor Detail

ApplyXPath

public ApplyXPath()
Method Detail

apply

public static java.lang.String[] apply(java.lang.String filename,
                                       java.lang.String xpath)
                                throws java.io.FileNotFoundException
Applies the xpath to the file, getting an array of strings of the values.

Parameters:
filename - the name of XML file to be analyzed.
xpath - the string of the xpath to query the xml with.
Returns:
an array of the values of the xpath.
Throws:
java.io.FileNotFoundException - DOCUMENT ME!

doMain

public void doMain(java.lang.String[] args)
            throws java.lang.Exception
Process input args and execute the XPath. Prints to System output.

Parameters:
args - a String array containing the filename and xpath
Throws:
java.lang.Exception - DOCUMENT ME!

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Main method to run from the command line. Used as utility to make sure xpaths are functioning correctly.

Parameters:
args - DOCUMENT ME!
Throws:
java.lang.Exception - DOCUMENT ME!