- Overview
- Cryptography
- Database
- Java
- Python
- WebAPI

Developer Activities
UiPath.WebAPI.Activities.GetXMLNodeAttributes
- ExistingXMLNode - The XML Node whose attributes are to be retrieved. This field supports only
XNodevariables. For more information onXNodeobjects, go here.
Advanced options
Output
- Attributes - An
IEnumerable<XAttribute>variable containing the retrieved XML node attributes. For more information onXAttributeobjects, go here.
Properties panel
Input
- ExistingXMLNode - The XML Node whose attributes are to be retrieved. This field supports only
XNodevariables. For more information onXNodeobjects, go here.
Output
- Attributes - An
IEnumerable<XAttribute>variable containing the retrieved XML node attributes. For more information onXAttributeobjects, go here.
Misc
- Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
Common
- DisplayName - The display name of the activity.
.xml files.
.xml file, converts it to an XML document, retrieves the individual nodes and writes an attribute and a value for each node.
This is how the automation process can be built:
-
Open Studio and create a new Process.
Note: Make sure to place the.xmlfile inside the project folder. For this example we used theXMLfiles.txt. -
Drag a Sequence to the Workflow Designer.
-
Create the following variables:
Variable Name
Variable Type
Default Value
XMLStringString
XMLNodes**IEnumerable<XNode>
XMLDocumentXDocument
-
-
Drag a Read Text File activity inside the sequence container.
- In the Properties panel, add the name
Read XML filein the DisplayName field. - Add the value
"XMLfiles.txt"in the FileName field. - Add the variable
XMLStringin the Content field.
- In the Properties panel, add the name
-
Drag a Deserialize XML activity under the Read Text File activity.
- In the Properties panel, add the variable
XMLStringin the XMLString field and the variableXMLDocumentin the XMLDocument field.
- In the Properties panel, add the variable
-
Place a Get XML Nodes activity after the Deserialize XML activity.
- In the Properties panel, add the variable
XMLDocumentin the ExistingXML field and the variableXMLNodesin the XMLNodes field.
- In the Properties panel, add the variable
-
Drag a For Each activity after the Get XML Nodes activity.
- Add the value
nodein the Item field and the variableXMLNodesin the Values field. - Select the
System.Xml.Linq.XNodeoption from the TypeArgument drop-down list.
- Add the value
-
Select the Body of the For Each activity and create a new variable:
Variable Name
Variable Type
Default Value
XMLAttributes**IEnumerable<XAttribute>
-
Add a Write Line activity inside the Body container.
- Add the expression
node.XPathSelectElement("author").ToStringin the Text field. This expression selects the name of the author from the.xmlpage and writes it in the Output panel.
- Add the expression
-
Place a Get XML Node Attributes activity after the Write Line activity.
- In the Properties panel, add the value
nodein the ExistingXMLNode field and theXMLAttributesvariable in the XMLAttributes field.
- In the Properties panel, add the value
-
Drag a For Each activity after the Get XML Node Attributes activity.
- To open the activity, perform a double click.
- Add the value
attributein the Item field and the variableXMLAttributesin the Values field. - In the Properties panel, select the
System.Xml.Linq.XAttributeoption from the TypeArgument drop-down list.
- Select the Body of the For Each activity.
-
Drag a Write Line activity inside the Body container.
- Add the expression
attribute.Valuein the Text field.
- Add the expression
- Run the process. The robot extracts an attribute and a value from the nodes, in this case, the name of the author and the book id, and displays them in the Output panel.
Here you can download an example.