SetDefaultValue¶
Sets the value of the current node if it is empty.
1 | |
Sets the values of all nodes at the specified XPath if they are empty.
1 | |
Parameters¶
any value
The value to update.
string xpath
The XPath of the node to set. If not specified, the current node is used.
Returns¶
(value): An array that contains the current node.(xpath, value): The nodes selected by the XPath, including nodes that already had a value.
Remarks¶
Nodes that already have a value are left unchanged, so the method is safe to call each time a script runs. Missing nodes are not created.
Examples¶
Fill a selected node only when it is empty¶
1 | |
Fill empty values with defaults¶
1 2 | |
See Also¶
- Xml.SetValue
- Array<Xml>