How to fetch xml attribute value in liquid template - XML to JSON Liquid

Suraj Revankar 11 Reputation points


I am trying to fetch the xml attribute value using liquid template. Examples are as below.

XML example:

    <ns0:root xmlns:ns0="" xmlns:ns1="">
  <ns1:name QualifierID="std.lang.all" >TV</ns1:name>

Liquid Template used:

"name": "{{['QualifierID']}}",
"price": "{{content.product.price}}",

Output expecting :

"name": "std.lang.all",
"price": "499.9"

I tried couple of ways but not able to fetch the xml attribute value. it gives me empty value for name.

Best regards,

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
1,960 questions
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
358 questions
No comments
1 vote

1 answer

Sort by: Most helpful
  1. Tarun Garg 1 Reputation point

    I tried few options but nothing seems to work. One other approach is convert this XML to JSON and then use liquid map