activities
latest
false
- Información general
- Criptografía
- Base de datos
- Java
- Python
- WebAPI
Actividades de desarrollador
Última actualización 21 de abr. de 2026
UiPath.WebAPI.Activities.ExecuteXPath
Ejecuta la expresión XPath especificada en un documento XML determinado. Para obtener más información sobre la sintaxis XPath, ve aquí.
Propiedades
Entrada
- ExistingXML - An XDocument variable containing the XML to be processed. Completing this field makes the XMLString field unusable. This field supports only XDocument variables.
- XMLString - A string or string variable containing the XML to be processed. Completing this field makes the ExistingXML field unusable. This field supports only strings and string variables.
- XPathExpression - A string or string variable that contains an XPath expression. This field supports only strings and string variables.
Otros
- Privado : si se selecciona, los valores de variables y argumentos ya no se registran en el nivel Detallado.
Común
- Nombre para mostrar: el nombre para mostrar de la actividad.
Salida
- Result - An Object variable containing the retrieved nodes or node-sets of the given XML. This field supports only Object variables.
Ejemplo de uso de la actividad Ejecutar XPath
The Execute XPath activity is used for reading and extracting data from .xml files.
To exemplify how to use this activity, we have created an example that uses the Execute XPath activity for extracting the name of a person from a .xml file.
Así es como se puede construir el proceso de automatización:
- Abre Studio y crea un nuevo Proceso.
Nota:
Make sure to place the
.xmlfile inside the project folder. For this example we used theXMLfiles.txt. - Drag a Sequence to the Workflow Designer.
-
Crea las siguientes variables:
Nombre de la variable Tipo de variable Valor predeterminado XMLStringCadena ResultObjeto
-
- 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
- Añade una actividad Ejecutar XPath después de la actividad Leer archivo de texto.
- In the Properties panel, add the variable
XMLStringin the XMLString field. - Add the value
"string(/catalog/book/author/text()[1])"in the XPathExpression field. This expression extracts the text found in the author field from thexmlfile. - Agrega la variable
Resulten el campo Resultado.
- In the Properties panel, add the variable
- Arrastra una actividad Escribir línea después de la actividad Ejecutar XPath.
- Añada la expresión
"Result: " + Result.ToStringen el campo Texto.
- Añada la expresión
- Run the process. The robot extracts the name of the author from the
.xmlfile and displays it in the Output panel.