|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.custommonkey.xmlunit.SimpleXpathEngine
Simple class for accessing the Nodes matched by an Xpath expression, or
evaluating the String value of an Xpath expression.
Uses a copy-of
or value-of
XSL template (as
appropriate) to execute the Xpath.
This is not an efficient method for accessing XPaths but it is portable
across underlying transform implementations. (Yes I know Jaxen is too, but
this approach seemed to be the simplest thing that could possibly work...)
Examples and more at xmlunit.sourceforge.net
Field Summary |
Fields inherited from interface org.custommonkey.xmlunit.XSLTConstants |
XSLT_END, XSLT_IDENTITY_TEMPLATE, XSLT_START, XSLT_STRIP_WHITESPACE, XSLT_XML_OUTPUT_NOINDENT |
Fields inherited from interface org.custommonkey.xmlunit.XMLConstants |
CLOSE_NODE, END_CDATA, END_COMMENT, END_PROCESSING_INSTRUCTION, OPEN_END_NODE, OPEN_START_NODE, START_CDATA, START_COMMENT, START_DOCTYPE, START_PROCESSING_INSTRUCTION, XML_DECLARATION, XMLNS_PREFIX, XPATH_ATTRIBUTE_IDENTIFIER, XPATH_CHARACTER_NODE_IDENTIFIER, XPATH_COMMENT_IDENTIFIER, XPATH_NODE_INDEX_END, XPATH_NODE_INDEX_START, XPATH_PROCESSING_INSTRUCTION_IDENTIFIER, XPATH_SEPARATOR |
Constructor Summary | |
SimpleXpathEngine()
|
Method Summary | |
java.lang.String |
evaluate(java.lang.String select,
org.w3c.dom.Document document)
Evaluate the result of executing the specified xpath syntax select expression on the specified document |
org.w3c.dom.NodeList |
getMatchingNodes(java.lang.String select,
org.w3c.dom.Document document)
Execute the specified xpath syntax select expression
on the specified document and return the list of nodes (could have
length zero) that match |
protected org.w3c.dom.Document |
getXPathResultAsDocument(java.lang.String select,
org.w3c.dom.Document document)
Execute the copy-of transform and return the resulting Document. |
protected org.w3c.dom.Node |
getXPathResultNode(java.lang.String select,
org.w3c.dom.Document document)
Testable method to execute the copy-of transform and return the root node of the resulting Document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleXpathEngine()
Method Detail |
protected org.w3c.dom.Node getXPathResultNode(java.lang.String select, org.w3c.dom.Document document) throws javax.xml.transform.TransformerException
select
- document
-
javax.xml.transform.TransformerException
protected org.w3c.dom.Document getXPathResultAsDocument(java.lang.String select, org.w3c.dom.Document document) throws javax.xml.transform.TransformerException
select
- document
-
javax.xml.transform.TransformerException
public org.w3c.dom.NodeList getMatchingNodes(java.lang.String select, org.w3c.dom.Document document) throws javax.xml.transform.TransformerException, javax.xml.transform.TransformerConfigurationException
select
expression
on the specified document and return the list of nodes (could have
length zero) that match
select
- document
-
javax.xml.transform.TransformerException
javax.xml.transform.TransformerConfigurationException
public java.lang.String evaluate(java.lang.String select, org.w3c.dom.Document document) throws javax.xml.transform.TransformerException, javax.xml.transform.TransformerConfigurationException
select
expression on the specified document
select
- document
-
javax.xml.transform.TransformerException
javax.xml.transform.TransformerConfigurationException
|
XMLUnit is hosted by sourceforge.net |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |