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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parsing XML containing...
Power Automate
Unanswered

Parsing XML containing illegal characters with xpath, issue with angel brackets

(0) ShareShare
ReportReport
Posted on by 23

I build a SharePoint form with dynamic rows (repeating sections in Nintex form) that have four fields in each row. Users could enter ', &, <, > in the first two text fields. The data of the dynamic rows are saved as XML. 

 

Below is two rows of data:

<?xml version='1.0' encoding='utf-8'?><RepeaterData><Version /><Items><Item><Milestones type='System.String'>test1's & <name></Milestones><Descriptions type='System.String'>test1's name</Descriptions><Recipients type='System.String'>user1, user2</Recipients><DueDate type='System.DateTime'>11/1/2021</DueDate></Item><Item><Milestones type='System.String'>TEST 2 </Milestones><Descriptions type='System.String'>TEST 2 </Descriptions><Recipients type='System.String'>user1, user2</Recipients><DueDate type='System.DateTime'>10/27/2021</DueDate></Item></Items>

</RepeaterData>

 

I use a Compose action to escape &: REPLACE(outputs('getRepeatingActions'),'&','ZZZ'), then another compose to run xpath: 

xpath(xml(outputs('Compose')), '//Item'), which returns Item array. 

 

' doesn't seem to have problem with xpath, & I code it as ZZZ then convert it back with replace function when I use it to send email. The tricky part is with angle brackets,< and >. The workflow fails when the text field has < or >. 

 

The error is: Unable to process template language expressions in action 'getAllItems' inputs at line '1' and column '14916': 'The template language function 'xml' parameter is not valid. The provided value cannot be converted to XML: 'The 'Name' start tag on line 1 position 168 does not match the end tag of 'Milestones'. Line 1, position 175.'. Please see https://aka.ms/logicexpressions#xml for usage details.'.

 

How to escape angle brackets to allow xpath to work? When there are angle brackets in XML, convert to JSON doesn't work either.

Categories:
I have the same question (0)

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 273 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 135 Most Valuable Professional

Last 30 days Overall leaderboard