Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

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!