Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
imous
Frequent Visitor

Xml processing fails, but succeeds after copy paste

I have an .xml file, obtained by using the export function of some software our customer uses, which he wanted to analyse with PowerBI. However, trying to load it with GetData results in the following error:

 

Details: "Xml processing failed. Either the input is invalid or it isn't supported. (Internal error: Name cannot begin with the '.' character, hexadecimal value 0x00. Line 1, position 2.)"

 

The .xml file doesn't have a period at this position, and no names seemed to start with a '.'. After some trial and error, I found that if I open the xml in notepad or sublime, copy it's entire contents with Ctrl-C, then paste it in a new xml file, save it, and upload that one, PowerBI loads it with no problem. This new .xml file also is significantly smaller than the original (110 vs 55 MB).

 

I can open the files and copy paste its content, but on the customer's computer this is difficult due to the file's size. Plus, the files are to be loaded into a blob storage so that PowerBI can combine their data. If there's one un-copy-pasted file in the blob storage, the refresh of the whole published dataset will silently fail from there on out, until the offending file is found and removed. This makes the copy-paste trick unreliable as a permanent fix.

 

Does anyone know what could be causing this problem, and what would be an easy way to fix it? If needed, here are two small sample files, one working, one not working.

 

http://s000.tinyupload.com/?file_id=62018167755112980112 The not-working file

http://s000.tinyupload.com/?file_id=00008105647481151500 The working file.

4 REPLIES 4
v-qiuyu-msft
Community Support
Community Support

Hi @imous,

 

I got response below from PG internally:

 

This file is encoded with UTF-16 but does not include a Unicode BOM. To load it into Power BI, the customer will need to specify the encoding explicitly with

= Xml.Document(File.Contents("C:\...\WrongDemo.xml"), TextEncoding.Unicode)

 

Based on my test, you can create a blank query, and use this Power Query to get data from WrongDemo.XML file.

 

q4.PNG

 

Best Regards,
Qiuyun Yu

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

Thank you. I can get your solution to work on my end too. I haven't been able to get it to work with Xml.Tables instead of Xml.Document yet (I get an error that value=1200 can't be converted), but that is probably solvable.

 

However, unless I'm mistaken, I don't think this solution will work for the desired link of this PowerBI project to an Azure Blob Storage which contains the xmls. In those cases, I don't define explicitly which xml files it needs to load, and in fact it's designed so I don't need to know or define this. This way the customer can just store new xmls and be sure their data gets added to the project. But for this fix, I do need to define explicitly the xml files and their locations. If I'm assuming incorrectly here, let me know.

 

For my part, I'll see what we can do about the original encoding of the xmls. I doubt the program that exports those files can be customized in this regard, but I can try.

Hy imous, did you found a solution for this problem?

v-qiuyu-msft
Community Support
Community Support

Hi @imous,

 

I have reported this issue internally: CRI 43758511. Will update here once I get any information.

 

Best Regards,
Qiuyun Yu

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors