XML Problems
Moderator: Moderators
- g0fthick
- Very Active Forum Member
- Posts: 2438
- Joined: Sun Sep 04, 2005 12:42 pm
- Location: Chatham
- Contact:
XML Problems
Hi guys, just wondering if this problem has been resolved and fixed yet?
Since I caught this fun little bundle of joy I've had two fresh installs, and my current build is glitchy and buggy and seriously needs reinstalling once again, but has the problem been eradicated? There's no point in me going through the hassle of reinstalling and downloading all of the previous content and running that through the package manager only to find the problem's crept back in again.
Cheers.
Tom
Since I caught this fun little bundle of joy I've had two fresh installs, and my current build is glitchy and buggy and seriously needs reinstalling once again, but has the problem been eradicated? There's no point in me going through the hassle of reinstalling and downloading all of the previous content and running that through the package manager only to find the problem's crept back in again.
Cheers.
Tom

The knack of flying is learning how to throw yourself at the ground and miss.
- AndiS
- Very Active Forum Member
- Posts: 6207
- Joined: Fri Sep 23, 2005 4:43 pm
- Location: Jester's cell in ivory tower
- Contact:
Re: XML Problems
Hehe, first step towards an answer: Which XML files do you mean? There are tons thereof.
I guess you mean routes.xml and scenarios.xml.
Short answer: no.
Long answer: Drag it into a browser window, see what error message the browser coughs up, try to make sense of it and open the XML file in the editor (notepad) and find the culprit and get rid of it.
If you are stuck with it, post the error message and hope the hints you receive help you. In desperate cases, contact me. But clearly, I would have a lot to do if I would fix all the XML files that are corrupted.
The solution, of course, would be that people stop sending around bad chunks of XML with their routes, scenarios, etc.
Anyway, I would prefer to try and salvage the routes.xml file instead of a reinstall, because if the route comes with a bad install, you will just experience the same problem again on a fresh install.
And keep lots of copies of these files (or the complete RailSimulator folder) for backup purposes.
I guess you mean routes.xml and scenarios.xml.
Short answer: no.
Long answer: Drag it into a browser window, see what error message the browser coughs up, try to make sense of it and open the XML file in the editor (notepad) and find the culprit and get rid of it.
If you are stuck with it, post the error message and hope the hints you receive help you. In desperate cases, contact me. But clearly, I would have a lot to do if I would fix all the XML files that are corrupted.
The solution, of course, would be that people stop sending around bad chunks of XML with their routes, scenarios, etc.
Anyway, I would prefer to try and salvage the routes.xml file instead of a reinstall, because if the route comes with a bad install, you will just experience the same problem again on a fresh install.
And keep lots of copies of these files (or the complete RailSimulator folder) for backup purposes.
-
CaptScarlet
- Very Active Forum Member
- Posts: 3673
- Joined: Fri Nov 17, 2006 11:29 am
- Location: The Netherlands
Re: XML Problems
Thats what I do, before I install a route or scenario I make a backup of the contents folder ( which I rename by adding the date of the backup ) and I keep at least two versions. The other thing I do now is open the routes.xml file in the browser before installing to double check it doesn't report any errors ( I also do it after as well ) so that I know if something I install creates a error.AndiS wrote:
And keep lots of copies of these files (or the complete RailSimulator folder) for backup purposes.
If a error is reported I can either try to fix it ( depending on the error ) and or un-install the offending item ( so that RS knows its un-installed ) and if that doen't fix it I can copy back the latest backup of the contents folder.
I find that opening the xml file in notepad isn't that helpful so I now use "Notepad2" as it formats the xml thus making it easier to read.
John
- AndiS
- Very Active Forum Member
- Posts: 6207
- Joined: Fri Sep 23, 2005 4:43 pm
- Location: Jester's cell in ivory tower
- Contact:
Re: XML Problems
Once you get the feeling that reading XML file is something which you can master, go and get any editor from the rich selection out there. Every editor is better than Notepad, and most feature XML markup.CaptScarlet wrote:I find that opening the xml file in notepad isn't that helpful so I now use "Notepad2" as it formats the xml thus making it easier to read.
If you happen to have some "programming" editor, e.g., "Context" for editing .eng files, it should be fine, too, although I have not tried. Basically, try saving once, if the file is not destroyed, you can use this editor. Just stay clear off XML Notepad, as this puts something in the file which serz.exe (and certainly RailSimulator.exe, too) does not like. I have not found out about it, yet. For the same reason, I cannot recommend editing XML files using Excel, although it can be handy for viewing, at least for some of the files.
- g0fthick
- Very Active Forum Member
- Posts: 2438
- Joined: Sun Sep 04, 2005 12:42 pm
- Location: Chatham
- Contact:
Re: XML Problems
Problem is that I'm not a programmer, nor do I know where to spot bad code.
Besides, I shouldn't have to in the first place.
Besides, I shouldn't have to in the first place.

The knack of flying is learning how to throw yourself at the ground and miss.
- AndiS
- Very Active Forum Member
- Posts: 6207
- Joined: Fri Sep 23, 2005 4:43 pm
- Location: Jester's cell in ivory tower
- Contact:
Re: XML Problems
You are right about the second bit.
The first bit is not too bad actually. The error message reads something like "found Y instead of X". Now you search for string X. You should find pairs of
<X ....> and a few lines down </X>
If they don't come in pairs, you smell fish. Most of the time, the closing tag (i.e., the second one, </X>) is missing. Or it changed place with </Y>.
The first bit is not too bad actually. The error message reads something like "found Y instead of X". Now you search for string X. You should find pairs of
<X ....> and a few lines down </X>
If they don't come in pairs, you smell fish. Most of the time, the closing tag (i.e., the second one, </X>) is missing. Or it changed place with </Y>.
-
t1metraveller
- Getting the hang of things now
- Posts: 35
- Joined: Wed Feb 27, 2008 8:49 pm
Re: XML Problems
Drag the .xml file into your Internet Explorer or Firefox window. It will detect mismatched tags and a bunch of other errors, and tell you about the error.
Firefox will even give you the line number of the error.
Bill
Firefox will even give you the line number of the error.
Bill
- AndiS
- Very Active Forum Member
- Posts: 6207
- Joined: Fri Sep 23, 2005 4:43 pm
- Location: Jester's cell in ivory tower
- Contact:
Re: XML Problems
Of course, that was step one in my proposal.
And clearly Firefox is better here, because of the line number.
The bad thing with the line number is that it tells you were it found the problem, not where you created it. In practice, this can be half a file nearer to the top. That's where the string search comes into play, for the layman.
The hint I forgot for the layman is that you will observe that the indentation of the lines makes smooth curves. When you find some abrupt steps, look twice at that place. However, the space at the start of the line is purely optional. This means that if you find disharmonically looking places, the file need not be broken just because of that. However, the likelihood that there is something fishy there is not bad. Often the corruption happens because someone dropped something somewhere without knowing and then this will look out of place visually. However, I must repeat that this is just a hint, not a rule.
And clearly Firefox is better here, because of the line number.
The bad thing with the line number is that it tells you were it found the problem, not where you created it. In practice, this can be half a file nearer to the top. That's where the string search comes into play, for the layman.
The hint I forgot for the layman is that you will observe that the indentation of the lines makes smooth curves. When you find some abrupt steps, look twice at that place. However, the space at the start of the line is purely optional. This means that if you find disharmonically looking places, the file need not be broken just because of that. However, the likelihood that there is something fishy there is not bad. Often the corruption happens because someone dropped something somewhere without knowing and then this will look out of place visually. However, I must repeat that this is just a hint, not a rule.
- nwallace
- Creator of fantasy routes that exist in his mind
- Posts: 3418
- Joined: Wed Dec 05, 2001 12:00 am
- Location: Secret Route Builders Castle Retirement Home (Fictional Wing)
- Contact:
Re: XML Problems
Is this entirley down to corruption caused by RSDLs installer?g0fthick wrote:Problem is that I'm not a programmer, nor do I know where to spot bad code.
Besides, I shouldn't have to in the first place.
After early dabbling (because there was nothing else) I have pretty much avoided installing anything that doesn't use either the RSDL system or Mike Simpson's system as they all required fiddling with Configuration Critical XML files in which 1 simple mistake can break anything.
You are right, you should not have to try and fix a corrupted XML file.
But if you've been fiddling with them (even following someone else's instructions) it's really you that is to blame for it being broken.
---------------------------------------
http://www.NiallWallace.co.uk
Pining for Windows for Workgroups 3.11
http://www.NiallWallace.co.uk
Pining for Windows for Workgroups 3.11
-
CaptScarlet
- Very Active Forum Member
- Posts: 3673
- Joined: Fri Nov 17, 2006 11:29 am
- Location: The Netherlands
Re: XML Problems
Not really, Its caused by the installation of a route or scenario that has a error in its routes.xml file which resided on the authors RS install. ie If you created a route and packaged it up for distribution, and you had installed another route that had introduced a error then your package would also have that error. The problem is that if you don't check you wont know about the error until you install the next route or scenario because suddenly some of your routes or scenarios are missing.nwallace wrote:
Is this entirley down to corruption caused by RSDLs installer?
John
- emrhd01
- Very Active Forum Member
- Posts: 4821
- Joined: Thu Aug 03, 2006 1:48 pm
- Location: Nottingham- East Bridgford
Re: XML Problems
While we are talking .xml problems can anyone assist with mine?
I'm having problems with the 'East Albert Light Railway' Route, it showed as 'installed successfully' when using the Package Manager to install, but the Route does not show in the Game, Mike's RS Tools_TMB or Kickstart.
Had a look at the Routes .xml and it is showing in there if you use Context, but not if you use Notepad to read the.xml.
Had a look through the .xml for anything that might look out of place, but it is a little over my head so don't know what to do now. I was hoping someone might post with the similar problem and come up with an answer, but so far it seems everybody else seems to have loaded it without a problem.
I had the four Default Routes plus 'Corris' and 'Cinder Lane' installed when I attempted loading 'EALR'. I have now tried loading 'Bristol Sheffield V4' and that has installed no problem at all, runs OK in RS and also shows in RS Tools_TMB & Kickstart.
Where have I gone wrong?
I'm having problems with the 'East Albert Light Railway' Route, it showed as 'installed successfully' when using the Package Manager to install, but the Route does not show in the Game, Mike's RS Tools_TMB or Kickstart.
Had a look at the Routes .xml and it is showing in there if you use Context, but not if you use Notepad to read the.xml.
Had a look through the .xml for anything that might look out of place, but it is a little over my head so don't know what to do now. I was hoping someone might post with the similar problem and come up with an answer, but so far it seems everybody else seems to have loaded it without a problem.
I had the four Default Routes plus 'Corris' and 'Cinder Lane' installed when I attempted loading 'EALR'. I have now tried loading 'Bristol Sheffield V4' and that has installed no problem at all, runs OK in RS and also shows in RS Tools_TMB & Kickstart.
Where have I gone wrong?
Rob.
Proud to be a member of the VW/SSS BETA Testing Team.
Proud to be a member of the VW/SSS BETA Testing Team.
- karma99
- Very Active Forum Member
- Posts: 2329
- Joined: Wed Oct 17, 2007 8:21 pm
- Location: Portsmouth, UK
Re: XML Problems
Having written a quick XML parser at work the other day I had a theory on this that people weren't using escape sequences.
Refence: http://www.xmlnews.org/docs/xml-basics.html Section 5. References
On a side note, if you do manually "hack" the XML, be aware of the above or you will get failure to load!
Currently my thoughts are a little application that you run before an rpk install. It backs up the Routes.xml and any scenario xml's, you run the install as normal, it then loads each XML and makes sure nothing has been broken (the code equivelent of putting it in a browser). If it's ok then fine, if not it removes the bad route/scenario, restores the relevant XML back up and tells you go kick the rpk writer in the cyclinder cocks!
If Mike S. has something like this planned for his TMB or RSDL are going to do anything, I'll wait on them - ideally something "official" from RSDL would be best, I don't like having to do this stuff as it's "non-official" hacking that gets us into these situations in the first place
Refence: http://www.xmlnews.org/docs/xml-basics.html Section 5. References
RS tools obviously handle this but if someone manually edited a name in the XML, say they changed "Settle and Carlisle" to "Settle & Carlisle" using notepad or something that wouldn't point out the error, then it fails. However I had time to test it tonight and it fails TOTALLY, ie RS won't load, not this disappearing trick we're seeing, so back to the thinking.Character Predeclared Entity
& = &
< = <
> = >
" = "
' = '
For example, the corporate name “AT&T” should appear in the XML markup as “AT&T”: the XML parser will take care of changing “&” back to “&” automatically when the document is processed.
On a side note, if you do manually "hack" the XML, be aware of the above or you will get failure to load!
Currently my thoughts are a little application that you run before an rpk install. It backs up the Routes.xml and any scenario xml's, you run the install as normal, it then loads each XML and makes sure nothing has been broken (the code equivelent of putting it in a browser). If it's ok then fine, if not it removes the bad route/scenario, restores the relevant XML back up and tells you go kick the rpk writer in the cyclinder cocks!
If Mike S. has something like this planned for his TMB or RSDL are going to do anything, I'll wait on them - ideally something "official" from RSDL would be best, I don't like having to do this stuff as it's "non-official" hacking that gets us into these situations in the first place
- mikesimpson
- Very Active Forum Member
- Posts: 6361
- Joined: Mon Dec 03, 2001 12:00 am
- Location: Southern Hemisphere Penal Colonies
- Contact:
Re: XML Problems
One thing I have noticed and I commented on in another post is that some of the bad Routes.xml files I have seen recently had lines ending in Line Feed only, not Carriage Return/Line Feed.
Please do NOT use the .xml editor in RS_Tools to save .xml files, I have discovered that although the latest version usually works, it fails with some 'escaped' characters such as umlauts and various other European accented letters. I use Microsofts xml parsing .dll but RS does not and uses different parsing for some items, especially empty strings. To be safe with RS_Tools, just use the normal RS_Tools editor, it works fine.
Please do NOT use the .xml editor in RS_Tools to save .xml files, I have discovered that although the latest version usually works, it fails with some 'escaped' characters such as umlauts and various other European accented letters. I use Microsofts xml parsing .dll but RS does not and uses different parsing for some items, especially empty strings. To be safe with RS_Tools, just use the normal RS_Tools editor, it works fine.
Mike in OZ - Author of TS-Tools & Route-Riter.
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
http://www.agenetools.com
I'm not arguing (just explaining why I'm right).
- AndiS
- Very Active Forum Member
- Posts: 6207
- Joined: Fri Sep 23, 2005 4:43 pm
- Location: Jester's cell in ivory tower
- Contact:
Re: XML Problems
Put all the blame on me, because I talked Mike into including an XML editor into his tools first place.
My guess is that Kuju, like other companies, thought it was a clever idea to implement their private version of the standard. It's a plague of the industry.
Some weeks ago, Derek promised to point Adam on the issue of supplying a DTD for at least some of the XML files. Then, we were talking about advanced stuff like all these IDs and how unique the need to be. Now, we are talking of basic stuff like making a downloaded route run on your install. I don't care whether Mk2 brings an all-new and really clever installer (and packager), or whether RSDL support third parties with a little documentation on their software, but with neither in place, we will see lots of unnecessary frustration.
My guess is that Kuju, like other companies, thought it was a clever idea to implement their private version of the standard. It's a plague of the industry.
Some weeks ago, Derek promised to point Adam on the issue of supplying a DTD for at least some of the XML files. Then, we were talking about advanced stuff like all these IDs and how unique the need to be. Now, we are talking of basic stuff like making a downloaded route run on your install. I don't care whether Mk2 brings an all-new and really clever installer (and packager), or whether RSDL support third parties with a little documentation on their software, but with neither in place, we will see lots of unnecessary frustration.
- nwallace
- Creator of fantasy routes that exist in his mind
- Posts: 3418
- Joined: Wed Dec 05, 2001 12:00 am
- Location: Secret Route Builders Castle Retirement Home (Fictional Wing)
- Contact:
Re: XML Problems
Doh, I had forgotten about that issue.CaptScarlet wrote:Not really, Its caused by the installation of a route or scenario that has a error in its routes.xml file which resided on the authors RS install. ie If you created a route and packaged it up for distribution, and you had installed another route that had introduced a error then your package would also have that error. The problem is that if you don't check you wont know about the error until you install the next route or scenario because suddenly some of your routes or scenarios are missing.nwallace wrote:
Is this entirley down to corruption caused by RSDLs installer?
A colleague was telling me about an "XML" configuration file he came a cross while working as a contractor.
He had written the XML as far as he could tell to spec, the tags were right etc etc.
Unfortuantely the Configuration file reader had been written so you had to have the tags in exactly the right order!!!!!! (in Java which has a built in XML reader!) (This is know as reinventing the wheel and screwing it up)
---------------------------------------
http://www.NiallWallace.co.uk
Pining for Windows for Workgroups 3.11
http://www.NiallWallace.co.uk
Pining for Windows for Workgroups 3.11
