Share via

APIM Policy - Getting an xpath value

Kothai Ramanathan 951 Reputation points Microsoft Employee
2021-05-10T11:35:19.357+00:00

I have a XML request coming to an API. From the xml request, I need to get the value of particular attribute using xpath, and set that as the new body.

Is there an xpath support in APIM policies ? Or what would be the best way to do this?

Azure API Management
Azure API Management

An Azure service that provides a hybrid, multi-cloud management platform for APIs.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Pramod Valavala 20,661 Reputation points Microsoft Employee Moderator
    2021-05-10T16:14:19.587+00:00

    @Kothai Ramanathan A simple xpath is not available AFAIK but I believe you can use a combination of xml-to-json and set-body policies to achieve the same.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.