Overview
Sets the value of current node if has empty value.void myXml.SetDefaultValue(value: any)
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
var xml = $Xml.SelectSingle('//Customer/Id', function() { this.SetDefaultValue('1'); });
Example
Update form submit date if its empty
$Xml.SetDefaultvalue('Date', DateTimeOffset.now );