SetValue¶
Sets the value of the current node.
1 | |
Sets the value of all nodes at the specified XPath.
1 | |
Parameters¶
any value
The value to set.
string xpath
The XPath of the node to update.
Remarks¶
Strings, numbers, booleans, DateTimeOffset values and identities are converted to their XML representation. null clears the node value. Assigning a file sets the node value to the file ID and its Caption attribute to the file name.
Every node selected by the XPath is updated. Nodes are not created: when the XPath selects nothing, the call has no effect. Use Xml.AppendChild to create missing nodes.
Examples¶
Update the value of a selected node¶
1 | |
Update values with XPath¶
1 2 3 | |
Update every matching node¶
1 2 | |