org.vivoweb.harvester.util
Class XPathTool

java.lang.Object
  extended by org.vivoweb.harvester.util.XPathTool

public class XPathTool
extends java.lang.Object

Export xpath selection from xml file

Author:
Christopher Haines (hainesc@ctrip.ufl.edu)

Field Summary
protected static org.slf4j.Logger log
          SLF4J Logger
 
Constructor Summary
XPathTool(ArgList argList)
          Constructor
XPathTool(java.lang.String[] args)
          Constructor
XPathTool(java.lang.String xmlFile, java.lang.String expression)
          Constructor
 
Method Summary
 void execute()
          Runs the xpath
static java.lang.String getXPathResult(java.lang.String xmlFile, java.lang.String expression)
          Export xpath selection from xml file
static void main(java.lang.String... args)
          Main method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.slf4j.Logger log
SLF4J Logger

Constructor Detail

XPathTool

public XPathTool(java.lang.String xmlFile,
                 java.lang.String expression)
Constructor

Parameters:
xmlFile - path to xml file to read data from
expression - xpath expression to export

XPathTool

public XPathTool(java.lang.String[] args)
          throws java.io.IOException
Constructor

Parameters:
args - commandline arguments
Throws:
java.io.IOException - error creating task

XPathTool

public XPathTool(ArgList argList)
Constructor

Parameters:
argList - arguments
Method Detail

getXPathResult

public static java.lang.String getXPathResult(java.lang.String xmlFile,
                                              java.lang.String expression)
                                       throws java.io.IOException
Export xpath selection from xml file

Parameters:
xmlFile - path to xml file to read data from
expression - xpath expression to export
Returns:
the value of the selection
Throws:
java.io.IOException - error reading xml file

execute

public void execute()
             throws java.io.IOException
Runs the xpath

Throws:
java.io.IOException - error executing

main

public static void main(java.lang.String... args)
Main method

Parameters:
args - commandline arguments