Using EvaluateXpath in nifi

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using EvaluateXpath in nifi

sally
I have xml response like this :
<soap:Envelope xmlns:soap="schemas.xmlsoap.org/soap/envelope/"; xmlns:xsi="w3.org/2001/XMLSchema-instance"; xmlns:xsd="w3.org/2001/XMLSchema">; <soap:Body> <Response xmlns=""> <Result> <ResponseStatus>false</ResponseStatus> <Error> <ErrorCode>-2</ErrorCode> <ErrorDescription>data ot found</ErrorDescription> </Error> </Result> </Response> </soap:Body> </soap:Envelope>
and I wan to get value of ErrorCode. I tried this:

//Error/ErrorCode/text()
but ErrorCode attribute seems to be Nan.

Can you recommend me any solution?
Reply | Threaded
Open this post in threaded view
|

Re: Using EvaluateXpath in nifi

Andy LoPresto-2
Sally,

I replied to your StackOverflow question here [1]. In short, the XPath expression you are looking for is “//ErrorCode” (no quotes). 


Andy LoPresto
PGP Fingerprint: 70EC B3E5 98A6 5A3F D3C4  BACE 3C6E F65B 2F7D EF69

On Aug 23, 2017, at 10:15 AM, sally <[hidden email]> wrote:

I have xml response like this :
<soap:Envelope xmlns:soap=&quot;schemas.xmlsoap.org/soap/envelope/&quot;;
xmlns:xsi=&quot;w3.org/2001/XMLSchema-instance&quot;;
xmlns:xsd=&quot;w3.org/2001/XMLSchema&quot;>; <soap:Body> <Response
xmlns=""> <Result> <ResponseStatus>false</ResponseStatus> <Error>
<ErrorCode>-2</ErrorCode> <ErrorDescription>data ot found</ErrorDescription>
</Error> </Result> </Response> </soap:Body> </soap:Envelope>
and I wan to get value of ErrorCode. I tried this:

//Error/ErrorCode/text()
but ErrorCode attribute seems to be Nan.

Can you recommend me any solution?



--
View this message in context: http://apache-nifi-developer-list.39713.n7.nabble.com/Using-EvaluateXpath-in-nifi-tp16718.html
Sent from the Apache NiFi Developer List mailing list archive at Nabble.com.


signature.asc (859 bytes) Download Attachment