gov.grants.apply.xpath
Class XPathExecutor
java.lang.Object
gov.grants.apply.xpath.XPathExecutor
- public class XPathExecutor
- extends java.lang.Object
Class processes XPath Queries.
- Author:
- Brian Husted
Method Summary |
java.lang.String |
execute(java.lang.String xPath)
Method evaulates the XPath expression against the xml string. |
org.w3c.dom.Document |
getDoc()
|
org.w3c.dom.Node |
getNode(java.lang.String xpath)
For a given XPath, a DOM Node that the XPath resolve to is returned. |
void |
setDoc(org.w3c.dom.Document doc)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XPathExecutor
public XPathExecutor(java.lang.String xml)
throws java.lang.Exception
execute
public java.lang.String execute(java.lang.String xPath)
throws java.lang.Exception
- Method evaulates the XPath expression against the xml string.
Currently utilizing a DOM implementation.
- Parameters:
xPath
-
- Returns:
- first node value returned
- Throws:
java.lang.Exception
getNode
public org.w3c.dom.Node getNode(java.lang.String xpath)
throws javax.xml.transform.TransformerException
- For a given XPath, a DOM Node that the XPath resolve to is returned.
- Parameters:
xpath
- A valid XPath referring to the Node that is to be returned
- Returns:
- The Node referred to by the xpath argument.
- Throws:
javax.xml.transform.TransformerException
getDoc
public org.w3c.dom.Document getDoc()
- Returns:
- the Document.
setDoc
public void setDoc(org.w3c.dom.Document doc)
- Parameters:
doc
- the Document.