Forum Discussion

AlexHeinze's avatar
AlexHeinze
Frequent Visitor
3 years ago

Handling of spaces when importing XML data

I'm using several sample XML files from an external system to test my report. This has been going well so far, but now two things cause problems. In one of the files I find an element with just whitespace in it:

<reason xml:space="preserve"> </reason>

The second file has whitespace somewhere else in the element:

<name>AM </name>

In both cases Power Query interprets the elements as tables instead of text. What is an elegant way that caters for both my "normal" XML content as well as these edge cases?

Appreciate your help!

 

2 Replies