Overview
Updates all node values on specified xpath or current node if has empty value.
void myXml.SetDefaultValue(value: any)
Updates all node values on specified xpath or current node 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
Update current node value
Code Block |
---|
|
$Xml.SelectAll('//Customer', function() {
this.SetDefaultValue('Name','Unknown Name');
}); |
Example
Updates with an xpath
Code Block |
---|
|
$Xml.SetDefaultValue('//Customer/Id','1'); |
Example
Updates current node value
Code Block |
---|
|
var xml = $Xml.SelectSingle('//Customer/Id', function() {
this.SetDefaultValue('1');
}); |
Example
Code Block |
---|
|
Update form submit date if its empty |
Example
Code Block |
---|
|
$Xml.SetDefaultvalue('Date', DateTimeOffset.now ); |
Example
Update form submit date if its empty
Code Block |
---|
|
$Xml.SetDefaultvalue('Date', DateTimeOffset.now ); |