Skip to content

XML - Read Attribute Value from Node

This custom action lets you read the value of an attribute associated to an XML node.

Property NameData TypeDescription
AttributeNamestringA string specifying the name of the attribute to return.
IDXMLTXMLIDA unique string identifier associated to the opened XML resource you want to read data from.
PathToNodeXPathXPath expression to the node that contains the attribute.
VariableVarNameThe name of the variable whose value will be set to what has been read. If the node attribute can’t be found or read, the variable is left untouched.

If the XPath expression does not match any node in the XML document (for example, if the parent element is self-closing like <Config /> instead of <Config key="value">), the read operation is silently skipped and the target variable is left untouched.

Use of XPath is explained at http://msdn.microsoft.com/en-us/library/ms256086.aspx