Could not open the file, as it was not valid XML after upgrade to Sierra

161 views
Skip to first unread message

Rob

unread,
Oct 16, 2017, 9:38:16 AM10/16/17
to Ukelele Users
Hello, I have upgraded to macOS Sierra and if I choose "New from current input source" I get the following error:

> Could not open the file, as it was not valid XML
GermanMathUnicode.bundle.zip

Gé van Gasteren

unread,
Oct 16, 2017, 11:21:21 AM10/16/17
to ukelel...@googlegroups.com
I installed your attached file with the GermanMathUnicode keyboard layout in El Capitán.
Then I opened Ukelele and chose "New from current input source" and got the same error: "Could not open the file, as it was not valid XML."

I’m not sure what’s going on here, but at least Ukelele can open the file itself, so practically speaking it’s not serious :)

On 16 October 2017 at 15:38, 'Rob' via Ukelele Users <ukelel...@googlegroups.com> wrote:
Hello, I have upgraded to macOS Sierra and if I choose "New from current input source" I get the following error:

> Could not open the file, as it was not valid XML

--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-users+unsubscribe@googlegroups.com.
To post to this group, send email to ukelel...@googlegroups.com.
Visit this group at https://groups.google.com/group/ukelele-users.
For more options, visit https://groups.google.com/d/optout.

Gé van Gasteren

unread,
Oct 16, 2017, 11:25:12 AM10/16/17
to ukelel...@googlegroups.com
​Rob, I forgot to ask: Did you edit the XML with a text editor?
Or only with Ukelele?​

Rob

unread,
Oct 16, 2017, 11:55:57 AM10/16/17
to Ukelele Users
I did not edit it externally.

Gé van Gasteren

unread,
Oct 16, 2017, 3:32:50 PM10/16/17
to ukelel...@googlegroups.com
Very good. That means John will have to look into this…
It does seem like High Sierra has introduced some new stuff affecting (custom) keyboard layouts, but this doesn’t look related, seeing that the problem is the same in Sierra and El Capitan.

If you like, could you describe why you’d want to use that "New Layout from Current" command?
From what I can see, you could just as well (I think) make a copy of the keyboard layout file and start a new variant, no?

Rob

unread,
Oct 16, 2017, 3:45:07 PM10/16/17
to Ukelele Users
I simply wanted to look up some of the configurations. It would not let me open it via "Open…" raising the following error message:

> Ukelele cannot open a keyboard layout or collection that has been installed. Please open a copy and then install the new version.

I had to remove the layout entirely to open even a copy of it. That by itself might be another bug.


On Monday, October 16, 2017 at 9:32:50 PM UTC+2, Geke wrote:
Very good. That means John will have to look into this…
It does seem like High Sierra has introduced some new stuff affecting (custom) keyboard layouts, but this doesn’t look related, seeing that the problem is the same in Sierra and El Capitan.

If you like, could you describe why you’d want to use that "New Layout from Current" command?
From what I can see, you could just as well (I think) make a copy of the keyboard layout file and start a new variant, no?
On 16 October 2017 at 17:55, 'Rob' via Ukelele Users <ukelel...@googlegroups.com> wrote:
I did not edit it externally.

On Monday, October 16, 2017 at 5:25:12 PM UTC+2, Geke wrote:
​Rob, I forgot to ask: Did you edit the XML with a text editor?
Or only with Ukelele?​

--
You received this message because you are subscribed to the Google Groups "Ukelele Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-user...@googlegroups.com.

Gé van Gasteren

unread,
Oct 16, 2017, 4:13:49 PM10/16/17
to ukelel...@googlegroups.com
Aha, some picture is forming of what went wrong there.

Best practice is to create, edit and save your custom keyboard layouts in a "work folder" and install them either by opening those work files and using Ukelele’s Install commands, or by copying them to the right place.

Keyboard layouts are system software, after all, so if you edit installed files, i.e. files inside the Library/Keyboard Layouts folder, you are asking for trouble. Or even a copy, if you made that copy inside the Library/Keyboard Layouts folder.
During development, you can install different versions of the same keyboard, as long as you give them different names with Ukelele’s command Keyboard/Set Keyboard Name and Script. You could e.g. add a version number to the name. Then when you’re satisfied, remove all the now obsolete versions and install the final version with the real name you want to give it.


To unsubscribe from this group and stop receiving emails from it, send an email to ukelele-users+unsubscribe@googlegroups.com.

John Brownie

unread,
Oct 16, 2017, 6:45:31 PM10/16/17
to ukelel...@googlegroups.com
There are two issues going on here.

The error message is due to a failure in the Apple-supplied tool that
generates the XML file from the active keyboard layout (loaded as a
'uchr' resource), in that it produces invalid XML for some keyboard
layouts. I will dig around with this to see what the issue actually is.

The opening of files that are installed should only be prevented if the
file is in one of the installation folders. The code does a comparison
of the file path to check that. I don't know how it would be triggering
the warning when you open a file in a different location. I'll have to
investigate that, too.

John

--
John Brownie
SIL-PNG, Ukarumpa, Eastern Highlands, Papua New Guinea
Mussau-Emira language, New Ireland Province, Papua New Guinea

Gé van Gasteren

unread,
Oct 17, 2017, 3:57:37 AM10/17/17
to ukelel...@googlegroups.com
John, do I understand that correctly, that Ukelele doesn’t allow one to open a file in any of the Keyboard Layouts folders? If so, that’s a very good idea!

I don’t know how Rob copied the installed file, i.e. where he put the copy.
I just assumed he copied it in place, inside the Keyboard Layouts, because any other place should be OK.

John Brownie

unread,
Oct 17, 2017, 4:58:18 AM10/17/17
to ukelel...@googlegroups.com
Gé van Gasteren wrote:
John, do I understand that correctly, that Ukelele doesn’t allow one to open a file in any of the Keyboard Layouts folders? If so, that’s a very good idea!
Yes, I made that change a couple of releases back.

I don’t know how Rob copied the installed file, i.e. where he put the copy.
I just assumed he copied it in place, inside the Keyboard Layouts, because any other place should be OK.

Oh, of course, that makes sense. If it's outside the Keyboard Layouts folder, Ukelele can open it.

Gé van Gasteren

unread,
Oct 17, 2017, 5:32:56 AM10/17/17
to ukelel...@googlegroups.com
I’m still not sure what Rob was doing / why he couldn’t open a copy of the installed layout. Here’s what he wrote earlier:
I simply wanted to look up some of the configurations. It would not let me open it via "Open…" raising the following error message:
> Ukelele cannot open a keyboard layout or collection that has been installed. Please open a copy and then install the new version.

I had to remove the layout entirely to open even a copy of it. That by itself might be another bug.


Clearly, he didn’t see that "It’s not a bug, it’s a feature"...
So here’s an alternative warning text:
"Installed keyboard layouts should not be edited! Please move the (collection of) keyboard layouts to a different folder and open them from there. Or open a copy and use Ukelele to change the name before installing it."

Off-topic – While I’m at it:
After you included a text of mine wholesale into the Ukelele Help, I’ve started to feel some responsibility for it :)
So I had a good look at it and found that the structure is broken:
• “next page” goes back to page1a always, except on page1a itself.
• “previous chapter” on page1a doesn’t do anything. (“previous page” on page1b goes to page1a, so that one does work.)
If you let me know your ideas how the Help should be, I can put something together, or even edit the files themselves, if that is possible.

--
Reply all
Reply to author
Forward
0 new messages