Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Overview

Appends a new child in the specified xpath and executes the specified callback on created new node before inserting to DOM and returns the appended new node.

Xml myXml.AppendChild(xpath: string)

Appends a new child in the specified xpath and executes the specified callback on created new node before inserting to DOM and returns the appended new node.

Xml myXml.AppendChild(xpath: string, callback: (node: Xml) => any)

Arguments

string xpath
XPath of node to be append
(node: Xml) => any callback
Callback function to be execute.

Remarks

This method creates node and childs nodes according to the xml schema definition. If xml schema definition is not found in xml schema error is thrown.

Qualified node path can be specified in xpath argument when it is required. Example; Customer/Orders/Order

Callback function is executed before node is appended on DOM tree and in callback function, it does not trigger the monitoring events like Xml.Bind or Xml.Live.

Function returns created node after node is appended on DOM tree.

Callback function is called before adding the document.

Example

Append node

var customer = $Xml.AppendChild('Customers/Customer');
customer.SetValue('Id','1');
````
@example
Append node with callback
js $Xml.AppendChild('Customers/Customer', function() { this.SetValue('Id','1'); }); ```
  • No labels