Sally,

On top of using XmlSlurper, you're going to want to use MarkupBuilder or
StreamingMarkupBuilder depending on the size of the XML document.
Alternatively, you can just do some copy pasta from Java examples of DOM
parsing to build the DOM, insert a node and then use the Java DOM API to
serialize back to a string.

On Thu, Nov 9, 2017 at 7:58 AM, Mark Payne <[email protected]> wrote:

> Sally,
>
> You can certainly use Replace Text to accomplish this if you are familiar
> with Regular Expressions. Alternatively Groovy could be used with the
> XmlSlurper class. You could also use TransformXml with an XSLT stylesheet,
> or use EvaluateXQuery if you are familiar with XQuery. Certainly there are
> plenty of options :)
>
> Sent from my iPhone
>
> On Nov 9, 2017, at 7:26 AM, sally <[email protected]> wrote:
>
> I want to add xml tag ${filename} to xml response which i got from service
> how should i do it i mean i have made replace, end even delet operations in
> replaceText processor but how can i add something?
>
> 1.Should i use Replace Text processor i should do it with groovy code?(p.s
> i
> should add this tag inside details tag) here is my xml content:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <service>
>
>  <Person>
>  <details>
>  <start>2017-10-22</start>
>  <id>*******</id>
>  <makeVersion>1</makeVersion>
>  <patch>patch</patch>
>  <parameter>1</parameter>
>  </details>
>  </Person>
> </service>
>
>
>
> --
> Sent from: http://apache-nifi-users-list.2361937.n4.nabble.com/
>
>

Reply via email to