This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
InsertAndUpdateNode is a great way for finding and editing the child of a specific node in XML, but there are no good options when dealing with attributes or values of nodes. It could be useful if InsertAndUpdateNode was expanded on to allow these cases as well.
Suggestion
Add special node names to target aspects of a node other than its children:
"#text" or "text()" - Sets the text value directly stored in the parent node
"@[attribute name]" - Sets the value of an attribute with a name that matches "[attribute name]"
"#text" is a common way that XML parsers denote a text node as opposed to an element node.
"text()" and "@[attribute name]" are part of the XML specification for targeting text and attribute nodes respectively.
Attribute Example
Given the following service:
An InsertAndUpdateNode can be configured like so to add a "charCount" attribute containing the character count of each node:
Another idea that came to me is using "#name" or "name()" as a node name to allow renaming a given node without affecting its contents or attributes.
So "#text" or "text()" for adding or changing the text of a node,
"#name" or "name()" for changing the name of a node,
"@[name]" for adding or updating the value of an attribute of a node,
and "[name]" the current behavior of adding or updating a child of a node.