XML Import Fails with "Fatal error: line 10 column 106 Invalid character reference."

• Jan 25, 2023 - 01:24

There's something at the start of this XML file that keeps the file from loading. Can someone who reads xml tell me what to fix?
This xml is generated by PhotoScore from an imported PDF, which creates occasional errors but rarely fatal errors like this. I've tried editing the Photoscore and re-exporting the xml for an hour now and just can't figure it out.
Thanks,
-Tom

Attachment Size
Somewhere - Edgerton e.xml 624.24 KB

Comments

I am having a similar problem. (Note, I did try a PDF import in Musescore and it came out completely screwy.)

The photo shows the error message when trying to open the XML. The song is free for non-commercial use so I have attached both the PDF and the XML file that Photoscore created after I cleaned up timing and other errors.

If someone could demonstrate what might need to be edited in the XML file I could hopefully fix the 192 errors in order to get it to load in Musescore.

Attachment Size
theyarewisemen.pdf 1.27 MB
theyarewisemen.xml 432.16 KB
XML Error.png 26.9 KB

In reply to by garytemp

Open the xml file with a normal ASCII editor and delete line 10, which contains the copyright text. Then save the XML and open it with Musescore. Then insert the copyright text back into the score.

I have done this with MuS 3.6.2 and no more errors are reported. Nevertheless, you should compare the original PDF and the score for correctness.

Attachment Size
theyarewisemen_362.mscz 29.48 KB

In reply to by garytemp

When I open your PDF in PhotoScore Lite, the main problem is that the program doesn't read duplets. So they all show up as timing errors. So I don't fix anything and just export as mxl. When I open the mxl in MU4 I get a warning about a possible mxl validity issue, but I can and do open it anyway. No text is retained, as usual. All the duplets have been left out or modified to fit the meter.

In reply to by bobjp

Except in Photoscore (full, not lite)I had already fixed all the duplets and other errors. Those duplets were not a problem when I opened the fixed XML file posted above. The inability to open the original was solely due to the encoding crap in the copyright line.

In reply to by garytemp

So you're saying that PhotoScore created the xml that you posted above. Just making sure. I can't open the xml. either.
All I'm saying is that I can open one created by my version. That may or may not mean anything.
Just trying to learn something, here.

In reply to by bobjp

That is exactly what I meant. Your Photoscore LITE only can do triplets as I recall, while the full Photoscore will also handle duplets. However, it was the copyright section that the full Photoscore didn't do properly, and why (until that section was corrected in the XML) the original XML I posted cannot be opened by either you or me. Your LITE version apparently created a usable XML file, but requires fixes after the fact in Musescore for the duplets.

In reply to by garytemp

Perhaps it would be of use to find out what it is about the copyright text that PhotoScore couldn't handle. So that you can avoid problems in the future. The MuseScore reader is based on a program called Audiveris. The UI is a little tricky, but maybe it would work. It's a good thing you found out how to fix the problem for this one score. But should you have had to go through that? I mean technology being perfect and all :)

In reply to by bobjp

Well, I had also tried the PDF import function from within Musescore, which also uses Audiveris and it was way worse. Now that I know what to look for within the XML file, the fix is literally a few seconds to select and cut the offending characters, so it will not be a big issue going forward. I have opened a lot of Photoscore created XMLs without this problem so it is not something I expect to be a regular event.

Do you still have an unanswered question? Please log in first to post your question.