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

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

var xml = $Xml.SelectSingle('//Customer/Id', function() {
  this.SetDefaultValue('1');
});

Example

Update form submit date if its empty

$Xml.SetDefaultvalue('Date', DateTimeOffset.now );
  • No labels