XmlElement class

XML element node.

Inheritance
Implemented types

Constructors

XmlElement(XmlName name, [ Iterable<XmlAttribute> attributesIterable = const [], Iterable<XmlNode> children = const [], bool isSelfClosing = true ])
Create an element node with the provided name, attributes, and children.

Properties

attributes → XmlNodeList<XmlAttribute>
Return the attribute nodes of this node.
final
isSelfClosing ↔ bool
Defines whether the element should be self-closing when empty.
read / write
name XmlName
Return the name of the node.
final
nodeType XmlNodeType
Return the node type of this node.
read-only, override
ancestors → Iterable<XmlNode>
Return a lazy Iterable of the ancestors of this node (parent, grandparent, ...) in reverse document order.
read-only, inherited
children → XmlNodeList<XmlNode>
Return the direct children of this node.
final, inherited
depth → int
Return the depth of this node in its tree, a root node has depth 0.
read-only, inherited
descendants → Iterable<XmlNode>
Return a lazy Iterable of the descendants of this node (children, grandchildren, ...) in document order.
read-only, inherited
document XmlDocument
Return the document that contains this node, or null if the node is not library a document.
read-only, inherited
firstChild XmlNode
Return the first child of this node, or null if there are no children.
read-only, inherited
following → Iterable<XmlNode>
Return a lazy Iterable of the nodes following the closing tag of this node in document order.
read-only, inherited
hashCode → int
The hash code for this object.
read-only, inherited
hasParent → bool
Test whether the node has a parent or not.
read-only, inherited
lastChild XmlNode
Return the last child of this node, or null if there are no children.
read-only, inherited
nextSibling XmlNode
Return the next sibling of this node or null.
read-only, inherited
parent XmlNode
Return the parent node of this node, or null if there is none.
read-only, inherited
preceding → Iterable<XmlNode>
Return a lazy Iterable of the nodes preceding the opening tag of this node in document order.
read-only, inherited
previousSibling XmlNode
Return the previous sibling of this node or null.
read-only, inherited
root XmlNode
Return the root of the tree in which this node is found, whether that's a document or another element.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
text → String
Return the text contents of this node and all its descendants.
read-only, inherited

Methods

accept(XmlVisitor visitor) → dynamic
Dispatch the invocation depending on this type to the visitor.
override
getAttribute(String name, { String namespace }) → String
Return the attribute value with the given name.
getAttributeNode(String name, { String namespace }) XmlAttribute
Return the attribute node with the given name.
attachParent(XmlNode parent) → void
Internal method to attach a child to this parent, do not call directly.
inherited
copy() XmlNode
Return a copy of this node and its subtree.
inherited
detachParent(XmlNode parent) → void
Internal method to attach a child to this parent, do not call directly.
inherited
findAllElements(String name, { String namespace }) → Iterable<XmlElement>
Return a lazy Iterable of the recursive child elements in document order with the specified tag name.
inherited
findElements(String name, { String namespace }) → Iterable<XmlElement>
Return a lazy Iterable of the direct child elements in document order with the specified tag name.
inherited
normalize() → void
Puts all child nodes into a "normalized" form, that is no text nodes in the sub-tree are empty and there are no adjacent text nodes.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Return a default XML string of this object.
inherited
toXmlString({bool pretty: false, String indent: ' ' }) → String
Return an XML string of this object. [...]
inherited
writePrettyTo(StringBuffer buffer, int level, String indent) → void
Write this object in a 'pretty' format to a buffer.
inherited
writeTo(StringBuffer buffer) → void
Write this object to a buffer.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited