Initializes a new instance of the XmlElement class.
The name of the element.
Gets the name of the element.
The name of the element.
Sets the name of the element.
The name of the element.
The name of the element.
Gets the parent of this node.
The parent of this node.
Inserts an new attribute at the specified index. If no index is specified, the node is inserted at the end of this node's children.
The name of the attribute.
The value of the attribute. Strings are converted to XmlText
nodes.
The newly created attribute.
Returns an array containing all of the children of this node that are instances of XmlAttribute.
An array containing all of the children of this node that are instances of XmlAttribute.
Inserts a new CDATA section at the specified index. If no index is specified, the node is inserted at the end of this node's children.
The data of the CDATA section.
The newly created CDATA section.
Inserts a new character reference at the specified index. If no index is specified, the node is inserted at the end of this node's children.
The character to represent using the reference.
The newly created character reference.
Gets this node's children.
Throws an exception if this node cannot have any children. Consult the appropriate subclass documentation for more details.
This node's children.
Inserts a new comment at the specified index. If no index is specified, the node is inserted at the end of this node's children.
The data of the comment.
The newly created comment.
Inserts a new element at the specified index. If no index is specified, the node is inserted at the end of this node's children.
The name of the element.
The newly created element.
Inserts a new entity reference at the specified index. If no index is specified, the node is inserted at the end of this node's children.
The entity to be referenced.
The newly created entity reference.
Inserts the specified node into this node's children at the specified index. The node is not inserted if it is already present. If this node already has a parent, it is removed from that parent.
Note that only XmlAttribute, XmlCdata, XmlCharRef, XmlComment, XmlElement, XmlEntityRef, XmlProcInst, or XmlText nodes can be inserted; otherwise, an exception will be thrown.
The node to insert.
The node inserted into this node's children, or undefined if no node was inserted.
Gets the node that follows this one, or undefined if no such node exists or if this node has no parent.
The node that follows this one, or undefined if no such node exists or if this node has no parent.
Gets the node that is previous to this one, or undefined if no such node exists or if this node has no parent.
The node that is previous to this one, or undefined if no such node exists or if this node has no parent.
Inserts a new processing instruction at the specified index. If no index is specified, the node is inserted at the end of this node's children.
The target of the processing instruction.
The newly created processing instruction.
Removes this node from its parent if this node has a parent.
This node's parent, or undefined if it has no parent.
Removes the specified node from this node's children.
Throws an exception if this node cannot have any children, or if the specified node cannot be removed. Consult the appropriate subclass documentation for more details.
The node to remove.
Whether a node was removed.
Removes the node at the specified index from this node's children.
Throws an exception if this node cannot have any children, or if the node at the specified index cannot be removed. Consult the appropriate subclass documentation for more details.
The index at which the node to be removed is located.
The node that was removed, or undefined if no node was removed.
Inserts some new text at the specified index. If no index is specified, the node is inserted at the end of this node's children.
Arbitrary character data.
The newly created text node.
Returns an XML string representation of this node.
An XML string representation of this node.
Returns the root node of the current hierarchy. If this node has no parent, this node itself is returned.
The root node of the current hierarchy.
Gets the parent of this node.
The parent of this node.
Generated using TypeDoc
Represents an XML element.
A sample XML element is structured as follows, where
{name}
is the name of the element:<{name} attname="attvalue"> <subelem/> <?pitarget picontent?> text </{name}></pre>
The
{name}
value is a property of the node, while the attributes and children of the element (such as other elements, processing instructions, and text) are children of this node.XmlElement nodes can have an unlimited number of XmlAttribute, XmlCdata, XmlCharRef, XmlComment, XmlElement, XmlEntityRef, XmlProcInst, or XmlText nodes as children.