XML transformation
Hi, Consider this xml in the body of a request:
<People>
<Person FirstName="John" LastName="Doe" />
<Person FirstName="Jane" LastName="Doe" />
</People>
In response, how can I transform it to:
<All>
<Employee FullName="John Doe"></Employee>
<Employee FullName="Jane Doe"></Employee>
</All>
Basically I want to loop in nodes "//Person" and for each item use that node to generate response node using XPath selector on the request node.
I looked at the examples here but none of them worked in this case: https://github.com/Handlebars-Net/Handlebars.Net.Helpers/blob/2c22f91293b2cbcb94c0c39906b0393fc7969b9c/test/Handlebars.Net.Helpers.Tests/Templates/XPathPathHelpersTemplateTests.cs
Thanks.
It is possible, but I don't know the answer.
For this scenario, XSLT transformation would be a better choice. However, that's not yet implemented in Handlebars.Net
https://github.com/Handlebars-Net/Handlebars.Net.Helpers/pull/99
@rmeshksar
I've released a preview for WireMock.Net : 1.5.59-ci-18848 (https://github.com/WireMock-Net/WireMock.Net/wiki/MyGet-preview-versions) which can transform xml using xslt.
@rmeshksar Did you have time to review this?
https://github.com/WireMock-Net/WireMock.Net/pull/1128
Thanks so much and sorry that I did not notice this to respond in time, I will try it.
It's not yet in master, but you can try preview 1.5.59-ci-18865