public class DefaultDOMDocument extends Object implements DOMDocument
| Constructor and Description |
|---|
DefaultDOMDocument(URI documentURI,
Document document) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(String xPath,
String attrName,
String attrValue)
Adds an attribute to a node addressed by the given XPath.
|
URI |
getDocumentURI() |
Node |
getNode(String xPath)
Returns the node addressed by the given XPath, if more then
one an exception will be raised.
|
List<Node> |
getNodes(String xPath)
Returns the list of nodes addressed by the given XPath.
|
List<Node> |
getNodesWithAttribute(String attrName)
Returns all the nodes declaring an attribute with the specified name.
|
Document |
getOriginalDocument()
Returns the original document.
|
public URI getDocumentURI()
getDocumentURI in interface DOMDocumentpublic Document getOriginalDocument()
DOMDocumentgetOriginalDocument in interface DOMDocumentpublic List<Node> getNodes(String xPath)
DOMDocumentgetNodes in interface DOMDocumentxPath - a valid XPathpublic Node getNode(String xPath)
DOMDocumentgetNode in interface DOMDocumentxPath - a valid XPath.null if nothing found.public void addAttribute(String xPath, String attrName, String attrValue)
DOMDocumentaddAttribute in interface DOMDocumentxPath - the XPath pointing the node.attrName - the name of the attribute.attrValue - the value of the attribute.public List<Node> getNodesWithAttribute(String attrName)
DOMDocumentgetNodesWithAttribute in interface DOMDocumentattrName - name of attribute to use for filtering.null if no matches found.Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.