cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SandraSoniec
Helper II
Helper II

xpath - How to loop through each descendant to get values?

Hello

I want to extract some data (text) from an XML file for later import to dataverse. I am able to retrieve the node I need and all descendants using xpath (includes children and grand children).  Is there a way to loop through the XPathResults for each descendant to get the values for each descendant?

Thanks in advance for suggestions or further readings. 

1 REPLY 1
SandraSoniec
Helper II
Helper II

The following syntax brought me one step ahead

Retrieves all descendants that are text nodes and list them in variable XPathResult together with their tags

 

//PARAG[@IDENTIFIER='001.006']//*[text()]

 

Retrieves the text values of all descendent nodes and list them in variable XPath Result

 

//PARAG[@IDENTIFIER='001.006']//text()

 

Remaining task is to get rid on new lines if there are tags with formatting instructions in the middle of a text.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Top Solution Authors
Top Kudoed Authors
Users online (2,438)