XML Import Fails with "Fatal error: line 10 column 106 Invalid character reference."
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
This is the same Photoscore issue as reported in https://musescore.org/en/node/341235: Photoscore generates incorrectly encoded characters. In this case you have to remove a block of eight characters, starting with the ampersand at column 99 up to and including the semicolon in column 106. Fixed file attached.
In reply to This is the same Photoscore… by Leon Vinken
Leon,
Thank you for fixing my file!
I don't yet know how to edit XML's directly. What tool did you use and how did you know what to do, so maybe I can fix it myself next time?
In reply to Leon, Thank you for fixing… by tomfeledy
Any editor will to, XML is plain text
In reply to Any editor will to, XML is… by Jojo-Schmitz
Is there a way to validate if a musicxml file is correct, other than just checking the schema?
I keep hearing that my Musescore musicxml files imported in Sibelius give all kinds of weird problems.
(i don't have Sibelius)
In reply to Is there a way to validate… by graffesmusic
It's interesting that PhotoScore seems somehow closely allied to Sibelius, using the same menus for tools to edit its files.
In reply to Any editor will to, XML is… by Jojo-Schmitz
Perhaps, but what is meant by "column" as in "line 10 column 106?"
In reply to Perhaps, but what is meant… by tomfeledy
column N == Nth character in that line
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.
In reply to I am having a similar… by garytemp
Same issue as in the previous Somewhere - Edgerton e.xml file: the rights statement (at line 10) contains incorrectly encoded characters. Solution: use any text editor to remove every piece of text on that line starting with an ampersand and ending with a semicolon.
Please report the issue to Neuratron.
In reply to I am having a similar… 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.
In reply to I am having a similar… 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 When I open your PDF in… 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 Except in Photoscore (full,… 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 So you're saying that… 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 That is exactly what I meant… 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 Perhaps it would be of use… 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.
In reply to Well, I had also tried the… by garytemp
Hopefully you didn't just jinx it.
Yes, the MuseScore PDF reader is very limited. But the full version that it comes from is quite extensive.