Reputation: 283
I get different XML
s from web services. I want to convert this XML
to JSON
, but structure must be changed.
For example, I have XML
structure like this;
<root>
<A attr="attr1">VAL</A>
<B attr="attr2">VAL</B>
</root>
And result of JSON
that I want.
{
"root":{
"Items":[
{
"tag_name":"A",
"attr":"attr1",
"value":"VAL"
},
{
"tag_name":"B",
"attr":"attr2",
"value":"VAL"
}
]
}
}
How can I do this in Nifi
? ConvertRecord
or UpdateRecord
? Also, how should read and write schema for this if record based processors may be used?
Upvotes: 1
Views: 1264
Reputation: 1700
You can do it with a pure NiFi flow, the steps to do this are:
Upvotes: 1