Page 1 of 1

Swapping Stock with RW_Tools - Update

Unread postPosted: Sun Jan 20, 2019 6:08 pm
by mikesimpson
Problems with swapping stock -
Thanks to assistance from a user on uktrainsim, by comparing the Scenario.bin files for the Scenarios where 'SWAP' worked with those which did not, I discovered the following:-

Those which worked began:-
<?xml version="1.0" encoding="utf-8"?>
<cRecordSet xmlns:d="http://www.kuju.com/TnT/2003/Delta" d:version="1.0" d:id="-1922917928">
<Record>
<cConsist d:id="1391892688">

Whereas those which failed began:-
<?xml version="1.0" encoding="utf-8"?>
<cRecordSet xmlns:d="http://www.kuju.com/TnT/2003/Delta" d:version="1.0">
<Record>
<cConsist>

RW_Tools was searching for "<cConsist " with the space before the final quotes which of course did not exist hence the Error #5

I have now changed the code for all these options and hopefully all will be well from now on, I will upload the new version asap. The problem only seems to have occurred where the first consist in the Scenario.bin file was a 'Loose consist' and these consists do not have an id number.

Mike

Re: Swapping Stock with RW_Tools - Update

Unread postPosted: Mon Jan 21, 2019 1:52 am
by Chacal
Mike, just curious, are you processing XML files as text files or are you using an XML parser?

Re: Swapping Stock with RW_Tools - Update

Unread postPosted: Mon Jan 21, 2019 5:03 pm
by mikesimpson
Chacal wrote:Mike, just curious, are you processing XML files as text files or are you using an XML parser?


Yes, I am processing as text files (and running them through a routine to check for accented letters, quotes etc.

I tried with an .xml parser but DTG don't use the same format for .xml as Microsoft do with their parsers.

Mike