$NewChild¶
Represents the XML element for a new child item while a list item's initialization script is running.
1 | |
Remarks¶
This variable is available only in the list's new-child initialization context. It provides access to the pending item's XML structure, allowing default values to be set before the item is added to the list.
Examples¶
Set default values for a new list item¶
1 2 3 | |
Capabilities¶
Namespaces¶
$NewChild.AddNamespace: Adds a namespace to the XML node with the given prefix and URI.$NewChild.LookupNamespaceURI: Returns the namespace URI associated with the specified prefix.$NewChild.LookupPrefix: Returns the prefix associated with the specified namespace URI.$NewChild.RemoveNamespace: Removes the prefix for the specified namespace URI.
Structure Changes¶
$NewChild.AppendChild: Appends a new child to the specified XPath location and executes the provided callback function on the newly created node before inserting it into the DOM. Returns the appended new node.$NewChild.Clone: Creates a detached deep copy of the current node.$NewChild.Copy: Copies the current XML node and all its child nodes from the source XPath to the target XPath or target navigator.$NewChild.Remove: Removes the current node and returns it in an array.$NewChild.Sync: Synchronizes the nodes at the specified XPath with the input nodes, and returns an array of the synchronized nodes.
Validation and Cleanup¶
$NewChild.Assert: Performs an error check by asserting that the specified XPath evaluates to a boolean true value. If the assertion fails, an error is thrown.$NewChild.CommitDeletes: Deletes all child nodes that have theStateattribute set to the value 'Deleted'.
Client Events¶
$NewChild.Bind: Attaches a change event handler to the nodes selected by the specified XPath.$NewChild.Live: Attaches a change event handler to the specified XPath.$NewChild.Trigger: Triggers event handlers bound to the current node.
Reading and Predicates¶
$NewChild.Count: Returns the number of nodes at the specified XPath.$NewChild.Equals: Returns a boolean value indicating whether the current node has the specified value.$NewChild.Evaluate: Returns the string value of the current node.$NewChild.EvaluateBoolean: Returns the boolean value of the current node.$NewChild.EvaluateDateTime: Returns the date-time offset value of the current node.$NewChild.EvaluateNumber: Returns the numeric value of the current node.$NewChild.IsEmpty: Returns a boolean value indicating whether the current node has an empty string value.$NewChild.Sum: Returns the sum of the numeric values of child elements on the current node, or at the specified XPath.
Creation and Persistence¶
$NewChild.Create: Creates a new XmlWriter instance.$NewChild.Load: Loads XML content into the current node from the$XmlRepository.$NewChild.Parse: Parses the specified string as an XML node and returns the document element as an Xml instance.$NewChild.Save: Saves the current node's content to the$XmlRepository.
Formatting and Transformation¶
$NewChild.Format: Applies the specified template to the current node and returns the resulting string.$NewChild.FormatAll: Applies the specified template to every node selected by the XPath and joins the results with a separator.$NewChild.InnerXml: Returns the inner XML of the current node.$NewChild.OuterXml: Returns the outer XML of the current node.$NewChild.Transform: Performs an XSLT transformation on the current node and returns the result as a string.
Attributes¶
$NewChild.GetAttribute: Gets an attribute value on the current node.$NewChild.RemoveAttribute: Removes the attribute with the specified name.$NewChild.SetAttribute: Sets an attribute on the current node to the specified value.$NewChild.SetAttributeNS: Sets an attribute on the current node to the specified value in the specified namespace URI.
Selection and Navigation¶
$NewChild.GetParent: Returns the parent node of the current node.$NewChild.HasNode: Returns a boolean value indicating whether the specified XPath selects at least one node.$NewChild.LocalName: Returns the local name of the current node, without its namespace prefix.$NewChild.SelectAll: Selects all matching nodes based on the specified XPath expression.$NewChild.SelectSingle: Selects a single node based on the specified XPath expression.
Value Updates¶
$NewChild.SetDefaultValue: Sets the value of the current node if it is empty.$NewChild.SetValue: Sets the value of the current node.