XML.Node()
Description
Creates an instance of Node.
Syntax
new XML.Node(name)new XML.Node(name, { ...attributes })new XML.Node(name, { ...attributes }, [ ...children ])
Parameters
new XML.Node(name, attributes?, children?)
nameattributes?children?
A tag name.
An object containing key-value pairs of the attributes.
An array of child XML.Node objects.
Return Value
A XML.Node object with the specified tag name, attributes and child nodes.
Example
//// <book category="CHILDREN">// <title lang="en">Harry Potter</title>// <author>J K. Rowling</author>// <year>2005</year>// <price>29.99</price>// </book>//new XML.Node('book',{category: 'CHILDREN',},[new XML.Node('title', { lang: 'en' }, ['Harry Potter']),new XML.Node('author', null, ['J K. Rowling']),new XML.Node('year', null, ['2005']),new XML.Node('price', null, ['29.99']),])