public class XMLDocument
extends java.lang.Object
| Constructor and Description |
|---|
XMLDocument(org.w3c.dom.Element root)
Create an XMLDocument rooted at the given element.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String[] |
getChildNames(java.lang.String query)
Get the names of all the nodes which are children of the node identified
by the given XPath expression.
|
org.w3c.dom.Node |
getElement(java.lang.String query)
Get the Node identified by the given XPath expression.
|
org.w3c.dom.NodeList |
getElements(java.lang.String query)
Get the node set identified by the given XPath expression.
|
int |
getNodeCount(java.lang.String query)
Get the number of nodes returned by the given xpath expression.
|
java.lang.String |
getNodeName(java.lang.String query)
Get as a String the name of the node identified by the given XPath
expression.
|
java.lang.String |
getNodeValue(java.lang.String query)
Get as a String the text content of a node identified by the given XPath
expression.
|
java.lang.String[] |
getNodeValues(java.lang.String query)
Get the text content of each node identified by the given XPath
expression.
|
java.lang.String |
getSourceXMLString()
Returns the XML used to produce the document.
|
java.lang.String |
toString()
Use an XMLWriter to serialize to XML form the DOM tree associated with
this XMLDocument.
|
public XMLDocument(org.w3c.dom.Element root)
root - The root element of the XML document.public java.lang.String getSourceXMLString()
public java.lang.String toString()
toString in class java.lang.Objectpublic int getNodeCount(java.lang.String query)
throws javax.xml.xpath.XPathExpressionException
query - The XPath expression to evaluate.javax.xml.xpath.XPathExpressionException - the XPath expression exceptionpublic java.lang.String getNodeValue(java.lang.String query)
throws javax.xml.xpath.XPathExpressionException
query - The XPath expression to evaluate.javax.xml.xpath.XPathExpressionException - the XPath expression exceptionpublic java.lang.String getNodeName(java.lang.String query)
throws javax.xml.xpath.XPathExpressionException
query - The XPath expression to evaluate.javax.xml.xpath.XPathExpressionException - the XPath expression exceptionpublic java.lang.String[] getChildNames(java.lang.String query)
throws javax.xml.xpath.XPathExpressionException
query - The XPath expression to evaluate.javax.xml.xpath.XPathExpressionException - the XPath expression exceptionpublic java.lang.String[] getNodeValues(java.lang.String query)
throws javax.xml.xpath.XPathExpressionException
query - The XPath expression to evaluate.javax.xml.xpath.XPathExpressionException - the XPath expression exceptionpublic org.w3c.dom.NodeList getElements(java.lang.String query)
throws javax.xml.xpath.XPathExpressionException
query - The XPath expression to evaluate.javax.xml.xpath.XPathExpressionException - the XPath expression exceptionpublic org.w3c.dom.Node getElement(java.lang.String query)
throws javax.xml.xpath.XPathExpressionException
query - The XPath expression to evaluate.javax.xml.xpath.XPathExpressionException - the XPath expression exception