XML.Node
Description
Node in an XML document.
Node tree & text nodes
A tree of XML node is represented by using the children property of Node. It is an array so that the order of child nodes can be deterministic. Each element in the children property can be a Node object or a string. When it is a string, it represents a text node holding the text of that string.
For example, the following XML structure:
<order><sku><id>300688</id><title>Pipy: from Zero to Hero</title><category>Computer & Technology</category></sku><amount>1</amount></order>
can be represented as:
new XML.Node('order', null,[new XML.Node('sku', null,[new XML.Node('id', null, ['300688']),new XML.Node('title', null, ['Pipy: from Zero to Hero']),new XML.Node('category', null, ['Computer & Technology']),]),new XML.Node('amount', null, ['1']),])
Constructor
new XML.Node(name, attributes?, children?)
Creates an instance of Node.
Properties
attributesAn object containing key-value pairs of the attributes.
Array of child nodes.
Tag name.