Open donum opened 6 years ago
Thanks for the detailed bug report!
Entities in external DTDs should definitely be supported. I'll try to look into this as soon as I'm over this pesky flu.
v0.3.5 should fix the problem. When it appears in Package Control (there's usually a slight delay), could you give it a try and let me know whether it fixes the issue for you?
Note, though, that the example you posted still won't work as is: you must either specify the absolute path to catalogue.dtd
or (preferably) use an XML catalog.
Exalt always operates on the contents of a Sublime Text view, which means it doesn't (and indeed can't) know the path where the XML document is stored. Also, if the document is unsaved, it has no path at all.
That means Exalt can't resolve catalogue.dtd
because it doesn't know where it's located relative to the document it's validating.
Super, thank you eerohele!
It works like a charm. Thank you also for your hint regarding the absolute path requirement.
Using the absolute system path makes it work very nicely.
I tried it this way to prevent me from storing my local system path:
<!DOCTYPE catalogue SYSTEM "http://127.0.0.1:1338/static/xml-catalogue/dtd/catalogue.dtd">
That doesn't work though. Do you know, why? URL is accessible via the browser.
I believe the issue is that lxml (which is what Exalt uses) doesn't load schemas over the network by default.
One option would be to enable network loading, but I'm not sure what sorts of doors for vulnerabilities I'd be opening Exalt to if I did that… although I think Exalt already loads certain resources over the network in some scenarios. I'll need to check.
I'll consider enabling network requests, but if you're looking to avoid using absolute file system paths to DTDs in your XML documents, have you considered using an XML catalog? I believe that'd be a better solution to the problem. Or maybe you're trying to solve some other problem?
Hi,
thank you for that cool package. I don't feel misfortunate. :)
Issue-8 was reported and fixed which I am very happy about. This one is related though.
I noted that entity declarations within external DTDs are neglected.
(1) This works: messages.xml:
catalogue.dtd:
(2) While this does not work: messages.xml:
catalogue.dtd:
(3) And also this more advanced example doesn't work:
messages.xml:
catalogue.dtd:
iso-lat1.ent:
Error message is always "Entity ­ not defined".
Would be very nice if at least the second example would work.
Dan