Syntax / Sintaxe
sXML = applyXPath(xmlData, xpathQuery, namespaceAware, returnArray)
Arguments
xmlData (String)
Defines the XML on which to run the XPath query.
Define o XML no qual executar a consulta XPath.
xpathQuery (String)
Defines the XPath query to run.
Define a consulta XPath a ser executada.
namespaceAware (Boolean)
(Optional) Specifies whether to strip name spaces before applying the XPath query.
(Opcional) Especifica se deseja remover espaços de nome antes de aplicar a consulta XPath
Values:
True:CA Process Automation does not strip name spaces before applying the XPath query. / o CA Process Automation não remove espaços de nome antes de aplicar a consulta XPath.
False: CA Process Automation strips name spaces before applying the XPath query, making the query simple. / o CA Process Automation remove espaços de nome antes de aplicar a consulta XPath, tornando a consulta simples.
Default: True
returnArray (Boolean)
(Optional) Specifies whether to return an array of results or a single string. / (Opcional) Especifica se deve retornar ma matriz de resultados ou uma única sequência de caracteres.
Values:
True: The function returns an array of results. / a função retorna uma matriz de resultados.
False: The function returns a single string with multiple results concatenated in the string. / a função retorna uma única sequência de caracteres com vários resultados concatenados na sequência de caracteres.
Default: False
If the XPath query does not find a match, it returns a blank array. / Se a consulta XPath não encontrar uma correspondência, retornará uma matriz vazia.
Return Values and Examples
One of the following return values, based on the value of the returnArray argument. / Um dos seguintes valores de retorno, com base no valor do argumento returnArray.
- When returnArray is false: / Quando returnArray for falso:
sXML (String)
If you omit the returnArray argument or you set it to false, the query returns this value. The value that returns is an XML fragment that lists the nodes. For example:
Se você omitir esse argumento returnArray ou defini-lo como false, a consulta retornará esse valor. O valor retornado é um fragmento XML que lista os nós. Por exemplo:
Process.xpathResult = applyXPath(Process.bookXML, "/bookstore/book[2]", true, false);
- When returnArray is true: / Quando returnArray for verdadeiro:
sXMLArray (C2OValueArray)
If you set the returnArray argument to true, the query returns this value. The value that returns is a C2OValueArray in which each element is an XML fragment for a node. For example:
Se você definir o argumento returnArray como true, a consulta retornará esse valor. O valor que é retornado é uma C2OValueArray na qual cada elemento é um fragmento XML de um nó. Por exemplo:
Process.xpathArrayResult = applyXPath(Process.bookXML, "/bookstore/book", true, true);