XML Parse Error when name contains "&"

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

XML Parse Error when name contains "&"

Post by Phil Pendlebury » Thu Nov 26, 2020 10:13 am

I did try searching but unfortunately "xml" is removed from the forum search because it is only 3 characters. Anyway:

Very simple to reproduce this.

Code: Select all

XMLParse>strXML,Defaults/member[@name='AutoSavers']/member[@name='GRecentDocumentPaths']/list[@name='Paths']/item,res,NumItems
The line throws up an error: EDOMParseError (rest of message attached)

After some investigation (by removing lines in the XML file), this line causes the issue:

Code: Select all

<obj class="CmUID" name="PortUID Output MOT&Ouml;R61 Keyboard" ID="218458288">
               <string name="GUID" value="5F49E99665054D01890919DC0DBEBCD7" wide="true"/>
            </obj>
After removing that line, another one caused the issue. Then I realised the similarity in the lines was "&" that comes between "MOT" and "Ouml"

Code: Select all

MOT&Ouml
I think this referring to an umlaut in a device name.

When I removed that & the script works fine.

The odd thing is that some other & signs are in the file but it is only the ones in this area that cause the issue.
I cannot make changes to the XML file by the way as this script is a helper application that reads a specific program's settings from that XML. Also I do not need to read this line or take any action on it. My parser, as you can see is searching for another line.

Anyone any ideas on this one?
Phil Pendlebury - Linktree

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: XML Parse Error when name contains "&"

Post by Dorian (MJT support) » Thu Nov 26, 2020 10:48 am

Hi Phil,

I will pass this on to dev for inspection.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: XML Parse Error when name contains "&"

Post by Phil Pendlebury » Thu Nov 26, 2020 10:52 am

Thanks. If you need the actual file and script please let me know.

The script is messy but it works well, apart from the above issue.
Phil Pendlebury - Linktree

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: XML Parse Error when name contains "&"

Post by Marcus Tettmar » Sat Nov 28, 2020 3:33 pm

This looks like some kind of encoding issue, where an umlaut or such has not been encoded as xml would expect. Where's the xml file coming from?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
Phil Pendlebury
Automation Wizard
Posts: 538
Joined: Tue Jan 16, 2007 9:00 am
Contact:

Re: XML Parse Error when name contains "&"

Post by Phil Pendlebury » Sun Nov 29, 2020 7:16 am

Marcus Tettmar wrote:
Sat Nov 28, 2020 3:33 pm
This looks like some kind of encoding issue, where an umlaut or such has not been encoded as xml would expect. Where's the xml file coming from?
Hi Marcus,

Thanks for your reply. Hoping you are doing well.

It is a file that contains default settings for a program. (Steinberg Nuendo).

The item in questions refers to an old piece of hardware called MOTÖR 61.

All seems a bit odd to me, as they just look like ordinary characters. I think I don't understand how the encoding works. I'll have to read up on it.

For now I have just removed all instances of that and it works fine.

Problem will arise if anyone else has the same.

Thanks again,

:-)
Phil Pendlebury - Linktree

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts