Xml.SetDefaultValue
Overview
Sets the value of current node if has empty value.
void myXml.SetDefaultValue(value: any)
Sets the all node values on specified xpath if has empty value.
void myXml.SetDefaultValue(xpath: string, value: any)
Arguments
any value
Value to update
string xpath
XPath of node to set. If not specified current node is used.
Example
$Xml.SelectSingle('Customer/Name').SetDefaultValue('Unknown Name');
Example
Update current node value
$Xml.SelectAll('//Customer', function() {
this.SetDefaultValue('Name','Unknown Name');
});
Example
Updates with an xpath
$Xml.SetDefaultValue('//Customer/Id','1');
Example
Updates current node value
Example
Update form submit date if its empty
See Also
Copyright © 2010 - 2023 Emakin. All rights reserved.