OneDeadKey / kalamine

Keyboard Layout Maker
MIT License
113 stars 29 forks source link

MacOS: wrong path to dtd file #167

Open gagbo opened 8 months ago

gagbo commented 8 months ago

path to dtd file should be

+<!DOCTYPE keyboard SYSTEM "file:///System/Library/DTDs/KeyboardLayout.dtd">
-<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">

Double check it though, because I used a file generated by an older version of kalamine

wismill commented 8 months ago

Could it depend on the macOS version?

gagbo commented 8 months ago

Could it depend on the macOS version?

Maybe, but I’d find it surprising to have localhost at the root without a / prefix even.

Just in case though, I’m on macOS Sonoma (14.0)

wismill commented 8 months ago

See the reference doc:

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
fabi1cazenave commented 8 months ago

Having any way to validate this file would be a great step forward. It can be loaded with lxml but not with the standard Python XML library, nor with any web browser I know, because of the numeric entities e.g. &#x0010; (pass-through) and many other similar ones that do not correspond to printable characters. If you know a way to work around this, I’m all ears !

wismill commented 8 months ago

So it’s not standard XML?

fabi1cazenave commented 8 months ago

It is. But it contains numeric character references that do not correspond to printable characters, and most XML parsers block on that.

While the syntax of SGML does not prohibit references to invalid or unassigned code points, such as &#xFFFF;, SGML-derived markup languages such as HTML and XML can, and often do, restrict numeric character references to only those code points that are assigned to characters.

https://en.wikipedia.org/wiki/Numeric_character_reference#Restrictions

gagbo commented 8 months ago

See the reference doc:

Didn’t know that. Not sure whether the issue is that someone didn’t test their docs or if something actually changed