I am trying Liquid template to convert XML to Json with some transformation. I have sample XML as shown below
Sample XML:
<Employees>
<Employee>
<name>abc</name>
<summary>
<Age>15</Age>
<tag1>dd</tag1>
<tag2>dd</tag2>
<tag2>dd</tag2>
</summary>
</Employee>
</Employees>
My Liquid template
{
"Root":
[
{% for employees in content.Employees %}
{
"Name": "{{employees.name}}",
"Summary": "summary is {{employees.summary}}",
"Age": "{{employees.summary.Age}}"
},
{% endfor %}
]
}
I got the Output as below
{
"Root": [
{
"Name": "abc",
"Summary": "summary is ",
"Age": "15"
}
]
}
For Summary json node I want to display complete summary xml node and child nodes as it is(xml format), but now I am receiving empty. I tried searching to achieve this in liquid template and didn't get any option to achieve this. If not possible then what alternatives can be used in Azure logic apps.
Expected output:
{
"Root": [
{
"Name": "abc",
"Summary": "summary is <summary><Age>15</Age><tag1>dd</tag1><tag2>dd</tag2><tag2>dd</tag2></summary>",
"Age": "15"
}
]
}
question from:
https://stackoverflow.com/questions/66061335/liquid-template-to-get-xml-node-and-child-nodes-xml-as-it-is-to-json-format 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…