public class DOMUtil extends Object
Modifier | Constructor and Description |
---|---|
protected |
DOMUtil()
This class cannot be instantiated.
|
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Attr |
getAttr(org.w3c.dom.Element elem,
String name) |
static org.w3c.dom.Attr |
getAttrNS(org.w3c.dom.Element elem,
String nsUri,
String localName) |
static org.w3c.dom.Attr[] |
getAttrs(org.w3c.dom.Element elem) |
static String |
getAttrValue(org.w3c.dom.Element elem,
String name) |
static String |
getAttrValueNS(org.w3c.dom.Element elem,
String nsUri,
String localName) |
static String |
getChildText(org.w3c.dom.Node node)
Returns the concatenated child text of the specified node.
|
static org.w3c.dom.Document |
getDocument(org.w3c.dom.Node node) |
static org.w3c.dom.Element |
getFirstChildElement(org.w3c.dom.Node parent)
Finds and returns the first child element node.
|
static org.w3c.dom.Element |
getFirstChildElement(org.w3c.dom.Node parent,
String elemName)
Finds and returns the first child node with the given name.
|
static org.w3c.dom.Element |
getFirstChildElement(org.w3c.dom.Node parent,
String[] elemNames)
Finds and returns the first child node with the given name.
|
static org.w3c.dom.Element |
getFirstChildElement(org.w3c.dom.Node parent,
String elemName,
String attrName,
String attrValue)
Finds and returns the first child node with the given name and
attribute name, value pair.
|
static org.w3c.dom.Element |
getFirstChildElementNS(org.w3c.dom.Node parent,
String[][] elemNames)
Finds and returns the first child node with the given qualified name.
|
static org.w3c.dom.Element |
getFirstChildElementNS(org.w3c.dom.Node parent,
String uri,
String localpart)
Finds and returns the first child node with the given qualified name.
|
static String |
getInputEncoding(org.w3c.dom.Document doc)
Get the input encoding of the document.
|
static org.w3c.dom.Element |
getLastChildElement(org.w3c.dom.Node parent)
Finds and returns the last child element node.
|
static org.w3c.dom.Element |
getLastChildElement(org.w3c.dom.Node parent,
String elemName)
Finds and returns the last child node with the given name.
|
static org.w3c.dom.Element |
getLastChildElement(org.w3c.dom.Node parent,
String[] elemNames)
Finds and returns the last child node with the given name.
|
static org.w3c.dom.Element |
getLastChildElement(org.w3c.dom.Node parent,
String elemName,
String attrName,
String attrValue)
Finds and returns the last child node with the given name and
attribute name, value pair.
|
static org.w3c.dom.Element |
getLastChildElementNS(org.w3c.dom.Node parent,
String[][] elemNames)
Finds and returns the last child node with the given qualified name.
|
static org.w3c.dom.Element |
getLastChildElementNS(org.w3c.dom.Node parent,
String uri,
String localpart)
Finds and returns the last child node with the given qualified name.
|
static String |
getLocalName(org.w3c.dom.Node node)
returns local name of this element if not null, otherwise
returns the name of the node
|
static String |
getName(org.w3c.dom.Node node) |
static String |
getNamespaceURI(org.w3c.dom.Node node) |
static org.w3c.dom.Element |
getNextSiblingElement(org.w3c.dom.Node node)
Finds and returns the next sibling element node.
|
static org.w3c.dom.Element |
getNextSiblingElement(org.w3c.dom.Node node,
String elemName)
Finds and returns the next sibling node with the given name.
|
static org.w3c.dom.Element |
getNextSiblingElement(org.w3c.dom.Node node,
String[] elemNames)
Finds and returns the next sibling node with the given name.
|
static org.w3c.dom.Element |
getNextSiblingElement(org.w3c.dom.Node node,
String elemName,
String attrName,
String attrValue)
Finds and returns the next sibling node with the given name and
attribute name, value pair.
|
static org.w3c.dom.Element |
getNextSiblingElementNS(org.w3c.dom.Node node,
String[][] elemNames)
Finds and returns the next sibling node with the given qualified name.
|
static org.w3c.dom.Element |
getNextSiblingElementNS(org.w3c.dom.Node node,
String uri,
String localpart)
Finds and returns the next sibling node with the given qualified name.
|
static org.w3c.dom.Element |
getParent(org.w3c.dom.Element elem) |
static org.w3c.dom.Element |
getRoot(org.w3c.dom.Document doc) |
static String |
getValue(org.w3c.dom.Attr attribute) |
static String |
getXmlEncoding(org.w3c.dom.Document doc)
Get the xml encoding of the document.
|
public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node parent)
public static org.w3c.dom.Element getLastChildElement(org.w3c.dom.Node parent)
public static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node)
public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node parent, String elemName)
public static org.w3c.dom.Element getLastChildElement(org.w3c.dom.Node parent, String elemName)
public static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node, String elemName)
public static org.w3c.dom.Element getFirstChildElementNS(org.w3c.dom.Node parent, String uri, String localpart)
public static org.w3c.dom.Element getLastChildElementNS(org.w3c.dom.Node parent, String uri, String localpart)
public static org.w3c.dom.Element getNextSiblingElementNS(org.w3c.dom.Node node, String uri, String localpart)
public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node parent, String[] elemNames)
public static org.w3c.dom.Element getLastChildElement(org.w3c.dom.Node parent, String[] elemNames)
public static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node, String[] elemNames)
public static org.w3c.dom.Element getFirstChildElementNS(org.w3c.dom.Node parent, String[][] elemNames)
public static org.w3c.dom.Element getLastChildElementNS(org.w3c.dom.Node parent, String[][] elemNames)
public static org.w3c.dom.Element getNextSiblingElementNS(org.w3c.dom.Node node, String[][] elemNames)
public static org.w3c.dom.Element getFirstChildElement(org.w3c.dom.Node parent, String elemName, String attrName, String attrValue)
public static org.w3c.dom.Element getLastChildElement(org.w3c.dom.Node parent, String elemName, String attrName, String attrValue)
public static org.w3c.dom.Element getNextSiblingElement(org.w3c.dom.Node node, String elemName, String attrName, String attrValue)
public static String getChildText(org.w3c.dom.Node node)
Node.TEXT_NODE
or the children of any child
node that is of type Node.CDATA_SECTION_NODE
for the concatenation.node
- The node to look at.public static String getName(org.w3c.dom.Node node)
public static String getLocalName(org.w3c.dom.Node node)
public static org.w3c.dom.Element getParent(org.w3c.dom.Element elem)
public static org.w3c.dom.Document getDocument(org.w3c.dom.Node node)
public static org.w3c.dom.Element getRoot(org.w3c.dom.Document doc)
public static org.w3c.dom.Attr getAttr(org.w3c.dom.Element elem, String name)
public static org.w3c.dom.Attr getAttrNS(org.w3c.dom.Element elem, String nsUri, String localName)
public static org.w3c.dom.Attr[] getAttrs(org.w3c.dom.Element elem)
public static String getValue(org.w3c.dom.Attr attribute)
public static String getAttrValueNS(org.w3c.dom.Element elem, String nsUri, String localName)
public static String getNamespaceURI(org.w3c.dom.Node node)
public static String getInputEncoding(org.w3c.dom.Document doc)
doc
- public static String getXmlEncoding(org.w3c.dom.Document doc)
doc
- getInputEncoding(Document)
Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.