web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Parsing XML CData

(0) ShareShare
ReportReport
Posted on by 28

I have a flow where I make an HTTP request for xml data. I'm using xpath to parse it but it's not handling CDATA properly. It's showing me <![CDATA[California]]> as the output instead of just California. 

 

This is my input: xpath(xml(item()),'string(/Dinger/StateName)')

 

Everything is right in my outputs for all elements except this. Is there something I can do differently in my xpath expressions for the elements with CDATA? If not, how do I handle transformation in Flow to remove the text and characters that I don't want?  

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at
    Re: Parsing XML CData

    Hi @joshlwulf 

     

    Could you provide an example/sample output from the http request?

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: Parsing XML CData

    Hi @joshlwulf,

     

    There is no direct function could process the CDATA part in the XML file.

    The only way in my mind is using the replace() function to remove these characters:

    replace(replace(outputs('Compose'),'<[CDATA[',''),']]>','')

    Annotation 2020-05-14 105543.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard