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 DOMDocument
public Document getOriginalDocument()
DOMDocument
getOriginalDocument
in interface DOMDocument
public List<Node> getNodes(String xPath)
DOMDocument
getNodes
in interface DOMDocument
xPath
- a valid XPathpublic Node getNode(String xPath)
DOMDocument
getNode
in interface DOMDocument
xPath
- a valid XPath.null
if nothing found.public void addAttribute(String xPath, String attrName, String attrValue)
DOMDocument
addAttribute
in interface DOMDocument
xPath
- the XPath pointing the node.attrName
- the name of the attribute.attrValue
- the value of the attribute.public List<Node> getNodesWithAttribute(String attrName)
DOMDocument
getNodesWithAttribute
in interface DOMDocument
attrName
- name of attribute to use for filtering.null if no matches found.
Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.