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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to use xpath when ...
Power Automate
Unanswered

How to use xpath when the xml contains namespaces ?

(0) ShareShare
ReportReport
Posted on by 302

I have an xml that contains namespaces and prefixes. I'd like to extract data from it using an xpath. When I try my xpath statement on the same xml from which I removed all namespaces and prefixes it works. Where can I find more information on the proper use and syntax for this scenario ?

 

This works:

xpath(outputs('Compose_Points_of_Sales_as_xml'),'string(/list/item[starts-with(POSNr,"0002")]/Location)')
 
This doesn't work:
xpath(outputs('Compose_Points_of_Sales_as_xml'),'string(/d:list/d:item[starts-with(d:POSNr,"0002")]/d:Location)')
 
Stephane
 
Categories:
I have the same question (0)
  • thepenguin Profile Picture
    50 on at

    Hi, I replied to your other post before I saw that you opened this thread. PA seems to be happier working with local names which is a bit annoying but gets the job done. I am by no means an expert in xml, but doing it like this works in both xpather and powerautomate:

     

    xpath(outputs('Compose'),'//*[local-name()="properties"]/*[local-name()="POSNr" and starts-with(text(), "0002")]/../*[local-name()="Location"]/text()')

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard