activities
latest
false
- Visão geral
- Criptografia
- Banco de Dados
- Java
- Python
- WebAPI
Importante :
A tradução automática foi aplicada parcialmente neste conteúdo.
A localização de um conteúdo recém-publicado pode levar de 1 a 2 semanas para ficar disponível.
Atividades do desenvolvedor
Última atualização 21 de mai de 2026
UiPath.WebAPI.Activities.ExecuteXPath
Executa a expressão XPath especificada em um determinado documento XML. Para obter mais informações sobre a sintaxe XPath, acesse aqui.
Propriedades
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.
Diversos
- Privado - Se selecionado, os valores de variáveis e argumentos não são mais registrados no nível Verbose.
Comum
- DisplayName - O nome de exibição da atividade.
Saída
- Result - An Object variable containing the retrieved nodes or node-sets of the given XML. This field supports only Object variables.
Exemplo de como usar a atividade Execute 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.
É assim que um processo de automação pode ser construído:
- Abra o Studio e crie um Processo.
Observação:
Make sure to place the
.xmlfile inside the project folder. For this example we used theXMLfiles.txt. - Drag a Sequence to the Workflow Designer.
-
Crie as seguintes variáveis:
Nome da variável Tipo de Variável Valor Padrão XMLStringString ResultObject
-
- 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
- Adicione uma atividade Execute XPath após a atividade Read Text File.
- 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. - Adicione a variável
Resultno campo Resultado.
- In the Properties panel, add the variable
- Arraste uma atividade Write Line após a atividade Execute XPath.
- Adicione a expressão
"Result: " + Result.ToStringno campo Texto.
- Adicione a expressão
- Run the process. The robot extracts the name of the author from the
.xmlfile and displays it in the Output panel.