public class XMLUtil
extends java.lang.Object
XMLUtil
...Constructor and Description |
---|
XMLUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getAttribute(org.w3c.dom.Element parent,
java.lang.String localName,
java.lang.String namespaceURI)
Returns the value of the named attribute of the current element.
|
static org.w3c.dom.Element |
getChildElement(org.w3c.dom.Node parent,
java.lang.String childLocalName,
java.lang.String childNamespaceURI)
Returns the first child element that matches the given local name and
namespace.
|
static java.lang.String |
getChildText(org.w3c.dom.Element parent,
java.lang.String childLocalName,
java.lang.String childNamespaceURI)
Calls
getText(Element) on the first child element that matches
the given local name and namespace. |
static java.lang.String |
getText(org.w3c.dom.Element element)
Concatenates the values of all child nodes of type 'Text' or 'CDATA'/
|
static java.lang.String |
getText(org.w3c.dom.Element element,
java.lang.String defaultValue)
Same as
getText(Element) except that 'defaultValue' is returned
instead of null , if the element does not contain any text. |
static boolean |
isText(org.w3c.dom.Node node) |
public static boolean isText(org.w3c.dom.Node node)
node
- public static java.lang.String getText(org.w3c.dom.Element element)
element
- null
if the length of the resulting String is 0.isText(org.w3c.dom.Node)
public static java.lang.String getText(org.w3c.dom.Element element, java.lang.String defaultValue)
getText(Element)
except that 'defaultValue' is returned
instead of null
, if the element does not contain any text.element
- defaultValue
- defaultValue
if the element does not contain any text.public static java.lang.String getChildText(org.w3c.dom.Element parent, java.lang.String childLocalName, java.lang.String childNamespaceURI)
getText(Element)
on the first child element that matches
the given local name and namespace.parent
- childLocalName
- childNamespaceURI
- null
.getText(Element)
public static org.w3c.dom.Element getChildElement(org.w3c.dom.Node parent, java.lang.String childLocalName, java.lang.String childNamespaceURI)
null
is returned.parent
- childLocalName
- childNamespaceURI
- null
.public static java.lang.String getAttribute(org.w3c.dom.Element parent, java.lang.String localName, java.lang.String namespaceURI)
parent
- localName
- attribute local name or 'nodeName' if no namespace is
specified.namespaceURI
- or null
null
if not found"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"