XmlElement class
XML element node.
- Inheritance
- Object
- XmlNode
- XmlElement
- Mixed in types
- Available Extensions
Constructors
-
XmlElement(XmlName name, [Iterable<
XmlAttribute> attributesIterable = const [], Iterable<XmlNode> childrenIterable = 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 in document order.
final, inherited
-
children
→ XmlNodeList<
XmlNode> -
Return the direct children of this node in document order.
final, inherited
- firstChild → XmlNode
-
Return the first child of this node, or
null
if there are no children.read-only, inherited - firstElementChild → XmlElement
-
Return the first child XmlElement, or
null
if there are none.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
- innerText ↔ String
-
Return the concatenated text of this node and all its descendants.
read / write, inherited
- innerXml ↔ String
-
Return the markup representing the child nodes of this node.
read / write, inherited
- isSelfClosing ↔ bool
-
Defines whether the element should be self-closing when empty.
read / write
- lastChild → XmlNode
-
Return the last child of this node, or
null
if there are no children.read-only, inherited - lastElementChild → XmlElement
-
Return the last child XmlElement, or
null
if there are none.read-only, inherited - name → XmlName
-
Return the name of the node.
final
- nodeType → XmlNodeType
-
Return the node type of this node.
read-only, override
- outerXml ↔ String
-
Return the markup representing this node and all its child nodes.
read / write, inherited
- parent → XmlNode
-
Return the parent node of this node, or
null
if there is none.read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- text → String
-
Return the concatenated text of this node and all its descendants, for
XmlData
nodes return the textual value of the node.read-only, inherited
Methods
-
accept(
XmlVisitor visitor) → dynamic -
Dispatch the invocation depending on this type to the
visitor
.override -
attachParent(
covariant XmlNode parent) → void -
Internal helper to attach a child to this parent, do not call directly.
inherited
-
detachParent(
covariant XmlNode parent) → void -
Internal helper to detach a child from its parent, do not call directly.
inherited
-
getAttribute(
String name, {String namespace}) → String -
Return the attribute value with the given
name
, ornull
.inherited -
getAttributeNode(
String name, {String namespace}) → XmlAttribute -
Return the attribute node with the given
name
, ornull
.inherited -
getElement(
String name, {String namespace}) → XmlElement -
Return the first child element with the given
name
, ornull
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
removeAttribute(
String name, {String namespace}) → void -
Removes the attribute value with the given fully qualified
name
.inherited -
replace(
XmlNode other) → void -
Replace this node with
other
.inherited -
setAttribute(
String name, String value, {String namespace}) → void -
Set the attribute value with the given fully qualified
name
tovalue
. If an attribute with the name already exist, its value is updated. If the value isnull
, the attribute is removed.inherited -
toString(
) → String -
Returns a string representation of this object.
inherited
-
toXmlString(
{bool pretty = false, XmlEntityMapping entityMapping, int level, String indent, String newLine, Predicate< XmlNode> preserveWhitespace, Predicate<XmlAttribute> indentAttribute, Comparator<XmlAttribute> sortAttributes}) → String -
Return a default XML string of this object.
Return an XML string of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited