public interface DOMWrapper
Modifier and Type | Field and Description |
---|---|
static int |
CDATA
CDATA is a type of DOM Element representing a piece of text embedded in
a CDATA section, for example,
<![CDATA[Some text]]> . |
static int |
COMMENT
COMMENT is a type of DOM Element representing an XML comment.
|
static int |
ELEMENT
ELEMENT is a type of DOM Element representing a named tag, possibly
containing attributes, child elements, and text.
|
static int |
FREETEXT
FREETEXT is a type of DOM Element representing a piece of text (but not
a CDATA section).
|
static int |
UNKNOWN
UNKNOWN is used for DOM Element types unsupported by the
wrapper.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttribute(java.lang.String attrName)
Returns the value of the attribute with the given attrName.
|
java.lang.String[] |
getAttributeNames()
Returns a list of attribute names.
|
DOMWrapper[] |
getChildren()
Returns all children of this element, including TEXT elements, as
an array of DOMWrappers.
|
DOMWrapper[] |
getElementChildren()
Returns all element children of this element as an array of
DOMWrappers.
|
Location |
getLocation()
Returns the location of this element.
|
java.lang.String |
getTagName()
Returns the tag name of this element, or null for TEXT elements.
|
java.lang.String |
getText()
Returns a flattened representation of the text inside thie element.
|
int |
getType()
Returns the type of this element/node.
|
java.lang.String |
toXML()
Returns this node serialized as XML.
|
static final int UNKNOWN
static final int FREETEXT
Some text
. FREETEXT
elements always have a tag name of NULL and have no children. It
maps to a TextDef
.static final int ELEMENT
ElementDef
(or a generated class derived from it), or a GenericDef
.static final int COMMENT
CommentDef
.static final int CDATA
<![CDATA[Some text]]>
.
CDATA elements always have a tag name of NULL and have no children. It
maps to a CdataDef
.int getType()
java.lang.String getTagName()
java.lang.String getAttribute(java.lang.String attrName)
java.lang.String[] getAttributeNames()
java.lang.String getText()
java.lang.String toXML()
DOMWrapper[] getChildren()
DOMWrapper[] getElementChildren()
Location getLocation()