Support Questions

Find answers, ask questions, and share your expertise

NiFi Replace envelope in xml by ReplaceText or some another proc

Contributor

Hi for all!

I don't get why this regex doesn't work in ReplaceText proc NiFi:

Search Value ^<env.*"><env:Body>(.*)<\/env:Body><\/env:Envelope>$

109341-1.png

text like:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><hbdhsbfsdhbfdhdfshdfh>vsaucvash

</env:Body></env:Envelope>

I need to cut this - <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body> and this - </env:Body></env:Envelope>

^<env.*"><env:Body>(.*)<\/env:Body><\/env:Envelope>$ - works for text like at the top just separately:


like this ^<env.*"><env:Body>(.*) and cut <env:Envelopexmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body>


like this (.*)<\/env:Body><\/env:Envelope>$ and cut </env:Body></env:Envelope>


But I need to cut all together in one processor. How could I do that?


1 REPLY 1

Contributor

I have solved this task by TransformXML proc remove soap envelope by .xsl. But if ReplaceText proc also can solve this task I'd like to see any suggestions here.

Thanks!

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.