-
public final class ElementNode extends Node
Represents a node with children in the XML tree
-
-
Method Summary
Modifier and Type Method Description final StringgetText()final StringgetId()final StringgetName()final StringgetNamespace()final StringgetLang()final Map<String, Map<String, String>>getAttributes()final List<Node>getChildren()final StringgetAttr(String name)Return the value of an attribute picked in the same namespace as this ElementNode, fallback to no namespace and at last to null. final StringgetAttrNs(String name, String namespace)Return the value of an attribute picked in a specific namespace or null if it does not exist final List<ElementNode>getAll()Return a list of all ElementNode children final List<ElementNode>get(String name, String namespace)Return a list of ElementNode children with the given name and namespace final ElementNodegetFirst(String name, String namespace)Return the first ElementNode child with the given name and namespace, or null if there is none final List<ElementNode>collect(String name, String namespace)Recursively collect all descendent ElementNode with the given name and namespace into a list final StringcollectText()Recursively collect and concatenate all descendent TextNode in depth-first order -
-
Method Detail
-
getNamespace
final String getNamespace()
-
getChildren
final List<Node> getChildren()
-
getAttr
final String getAttr(String name)
Return the value of an attribute picked in the same namespace as this ElementNode, fallback to no namespace and at last to null.
-
getAttrNs
final String getAttrNs(String name, String namespace)
Return the value of an attribute picked in a specific namespace or null if it does not exist
-
getAll
final List<ElementNode> getAll()
Return a list of all ElementNode children
-
get
final List<ElementNode> get(String name, String namespace)
Return a list of ElementNode children with the given name and namespace
-
getFirst
final ElementNode getFirst(String name, String namespace)
Return the first ElementNode child with the given name and namespace, or null if there is none
-
collect
final List<ElementNode> collect(String name, String namespace)
Recursively collect all descendent ElementNode with the given name and namespace into a list
-
collectText
final String collectText()
Recursively collect and concatenate all descendent TextNode in depth-first order
-
-
-
-