Failed to load external entity #445
Replies: 7 comments 1 reply
-
@happypennygames This page has instructions for using XML catalogs with lxml in Python. It sounds like this should work for your situation and is better than modifying the MusicXML schema files: https://lxml.de/resolvers.html Please let us know if this works for you. |
Beta Was this translation helpful? Give feedback.
-
Thanks for posting! I did look at it as soon as you replied- unfortunately, couldn't make out how to use it. I will try for a deeper look this weekend and let you know my specific questions. |
Beta Was this translation helpful? Give feedback.
-
The long and short of it- totally failed going that direction. But that's ok, I just kept pushing forward, and I appreciated the pointer. If you want to try out the application (free, no ads), you can upload simple uncompressed musicxml files (e.g. up to 8th notes) and try real time feedback with a keyboard- thanks again! https://play.google.com/store/apps/details?id=com.happypennygames.aimusic.sightreader |
Beta Was this translation helpful? Give feedback.
-
Hi, from lxml import etree
schema_file_name: str = 'utils/data_files/musicxml.xsd'
schema = etree.XMLSchema(file=schema_file_name) and I already get the following error:
which makes me question whether the schema can be used like that (by lxml) at all. For parsing the schema, there is no option for any catalog-resolver or the like. Can you shed some light on this? |
Beta Was this translation helpful? Give feedback.
-
@apacha Did you look at the linked article at https://lxml.de/resolvers.html? It explains the issue and provides links such as http://xmlsoft.org/catalog.html with information on how to set up catalogs for use with lxml. |
Beta Was this translation helpful? Give feedback.
-
I just ran into the same issue when importing the MusicXML 4.0 XSD using the Eclipse Modeling Framework (EMF). If you're interested in some background information, you can read my blog post. The error messages indicate that the schema locations of the following XSD imports (lines 26 and 27 of
When browsing the URLs directly in a browser the XSDs are reachable, but there is a HTTP -> HTTPS redirection (e.g. from My solution was to replace the URLs with the following ones:
With those schema locations the MusicXML XSD could be loaded without any problems. Consequently one solution could be to use |
Beta Was this translation helpful? Give feedback.
-
I've written a blog post about validating MusicXML using node.js - might be relevant here. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am attempting to perform local validation of a musicxml file exported using musescore (uncompressed xml). I'm using xmllint.js (https://github.com/kripken/xml.js/blob/master/xmllint.js) on a simulated client side using a python server. The validation pipeline works great with other xsd/xml pairs, but I get this error when I substitute musicxml.xsd for the schema (has nothing to do with the xml file itself).
I copied the full zip of all the files into the same place as the musicxml.xsd fiile.
The instructions in musicxml.xsd reference the catalog.xml file, but I do not reference it (I'm not sure how), so i don't know if that's the problem. I'm also ok with manually pasting all the other xsd files into the musicxml.xsd file if there was way to do that.
Modifying the musicxml.xsd file such that the schema location is just the file name, and running:
actually does validate at the command line in a linux terminal, which implies the fault is in some interaction of the import statement with xmllint.js at this point. Feel free to close the issue if no suggestions given this update.
Beta Was this translation helpful? Give feedback.
All reactions