Upcoming Games

(UTC times)


Full list
Add a game

Upcoming Events

No events to display

ATOC CIF Timetable Parser to XML

You are here: Home > Forum > General > Timetabling > ATOC CIF Timetable Parser to XML

Page 1 of 1

ATOC CIF Timetable Parser to XML 25/01/2015 at 18:48 #68373
readered
Avatar
16 posts
Hi there,

I'm in the process of writing a parser for the ATOC CIF timetable file they release weekly and create an importable XML timetable.
I have a couple of questions about the XML timetable though. I've tried to follow the schema on the wiki but I haven't been able to import a simple 1 train time table yet.

I'm working on Westbury for the moment (as it's my 'home' simulation living in Theale). Could someone tell me what is wrong with this example timetable:


<SimSigTimetable ID=“Westbury” Version=“4.1.2”>
<Name>Test</Name>
<StartDate>2015-01-09</StartDate>
<EndDate>2015-01-10</EndDate>
<TrainCategory ID=“HST125”>
<description>HST - 8 cars</description>
<maxSpeed>125</maxSpeed>
<accelerationBrakingProfile>2</accelerationBrakingProfile>
<power>diesel</power>
<freight>false</freight>
<length>220</length>
<speedClass>HST</speedClass>
</TrainCategory>
<Schedule scheduleID=“test1” trainID=“1A83”>
<TrainCategory>HST125</TrainCategory>
<bonusScoring>false</bonusScoring>
<StartDate>2015-01-09</StartDate>
<EndDate>2015-01-09</EndDate>
<Description>Test HST</Description>
<OperatorID>FGW</OperatorID>
<ScheduleLocation>
<LocationID>COGLOAD</LocationID>
<DepartureTime>133900</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>ATHLNEY</LocationID>
<DepartureTime>134100</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>SOMEGF</LocationID>
<DepartureTime>134630</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>CCARY</LocationID>
<DepartureTime>135300</DepartureTime>
<PassingTime>True</PassingTime>
<PlatformCode>1</PlatformCode>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>ESTSOMJ</LocationID>
<DepartureTime>135900</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>BLBGJN</LocationID>
<DepartureTime>140130</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>CLNKRDJ</LocationID>
<DepartureTime>140230</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>FRWDJN</LocationID>
<DepartureTime>140530</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>HWRDJN</LocationID>
<DepartureTime>140700</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>LAVNGTN</LocationID>
<DepartureTime>141100</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>WBORO</LocationID>
<DepartureTime>141630</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>BEDYN</LocationID>
<DepartureTime>142500</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>NEWBURY</LocationID>
<DepartureTime>143430</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
<ScheduleLocation>
<LocationID>SCOTEJN</LocationID>
<DepartureTime>144630</DepartureTime>
<PassingTime>True</PassingTime>
</ScheduleLocation>
</Schedule>
</SimSigTimetable>


Many thanks for any help.

Will

Log in to reply
ATOC CIF Timetable Parser to XML 25/01/2015 at 19:15 #68375
Finger
Avatar
220 posts
What's wrong with it?

Everything!

The information on the wiki seems obsolete - the XML schema is totally different.

Eg. TrainCategory should be under TrainCategories, Schedule should in fact be Timetable under Timetables, etc. Only the DepartureTime element seems right.

Last edited: 25/01/2015 at 19:16 by Finger
Log in to reply
ATOC CIF Timetable Parser to XML 25/01/2015 at 19:27 #68376
readered
Avatar
16 posts
Hmm.

I had no idea that the wiki data was out of date. I'll generate a schema from an unzipped version of the WTT I have and go from there.

Thanks for you input.

Log in to reply
ATOC CIF Timetable Parser to XML 25/01/2015 at 19:32 #68377
clive
Avatar
2738 posts
" said:

The information on the wiki seems obsolete - the XML schema is totally different.
When I get a moment I'll write up the current schema.

Log in to reply
The following user said thank you: readered
ATOC CIF Timetable Parser to XML 25/01/2015 at 20:46 #68382
headshot119
Avatar
4869 posts
Have a look at this, this is output from my CIF parser for ATW, try it on North East Wales to look how it imports. (Assuming you're trying to import it into the sim via "Timetable - Export/Import - from XML format"

<?xml version="1.0" encoding="utf-8"?>
<timetable xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<title />
<description />
<trainCategory categoryID="4F30A62D" name="Class 150/2 (2 Car) ATW">
<dwellStationForward>00:00</dwellStationForward>
<dwellStationReverse>00:00</dwellStationReverse>
<dwellTerminateForward>00:00</dwellTerminateForward>
<dwellTerminateReverse>00:00</dwellTerminateReverse>
<dwellJoin>00:00</dwellJoin>
<dwellDivide>00:00</dwellDivide>
<dwellCrewChange>00:00</dwellCrewChange>
<maxSpeed>75</maxSpeed>
<accelerationBrakingProfile>3</accelerationBrakingProfile>
<power>
<diesel>true</diesel>
</power>
<length>40</length>
<speedClass>
<DMU>true</DMU>
<Sprinter>true</Sprinter>
</speedClass>
<vehicleCount>2</vehicleCount>
</trainCategory>
<schedule scheduleID="Y90421" trainID="1J72">
<trainCategory categoryID="4F30A62D">
<startDate>2013-12-09</startDate>
<endDate>2014-05-16</endDate>
<days>
<monday>true</monday>
<tuesday>true</tuesday>
<wednesday>true</wednesday>
<thursday>true</thursday>
<friday>true</friday>
</days>
</trainCategory>
<scheduleLocation>
<locationID>WREXHMG</locationID>
<departureTime>20:49:00</departureTime>
<publicDepartureTime>20:49</publicDepartureTime>
<platformCode>3</platformCode>
<activity />
</scheduleLocation>
<scheduleLocation>
<locationID>RUABON</locationID>
<arrivalTime>20:56:30</arrivalTime>
<departureTime>20:57:00</departureTime>
<publicArrivalTime>20:57</publicArrivalTime>
<publicDepartureTime>20:57</publicDepartureTime>
<activity>
<passengerSetDownTakeUp>true</passengerSetDownTakeUp>
</activity>
</scheduleLocation>
<scheduleLocation>
<locationID>CHIRK</locationID>
<arrivalTime>21:02:00</arrivalTime>
<departureTime>21:03:00</departureTime>
<publicArrivalTime>21:02</publicArrivalTime>
<publicDepartureTime>21:03</publicDepartureTime>
<activity>
<passengerSetDownTakeUp>true</passengerSetDownTakeUp>
</activity>
</scheduleLocation>
<scheduleLocation>
<locationID>GOBOWEN</locationID>
<arrivalTime>21:07:30</arrivalTime>
<departureTime>21:08:30</departureTime>
<publicArrivalTime>21:08</publicArrivalTime>
<publicDepartureTime>21:08</publicDepartureTime>
<engineeringAllowance>02:00</engineeringAllowance>
<activity>
<passengerSetDownTakeUp>true</passengerSetDownTakeUp>
</activity>
</scheduleLocation>
<scheduleLocation>
<locationID>SHRWBY</locationID>
<arrivalTime>21:28:00</arrivalTime>
<publicArrivalTime>21:28</publicArrivalTime>
<platformCode>7B</platformCode>
<activity />
</scheduleLocation>
<startDate>2013-12-09</startDate>
<endDate>2014-05-16</endDate>
<days>
<monday>true</monday>
<tuesday>true</tuesday>
<wednesday>true</wednesday>
<thursday>true</thursday>
<friday>true</friday>
</days>
<description>2049 WREXHMG-SHRWBY (DMU S 075)</description>
<operatorID>AW</operatorID>
<seating>standardOnly</seating>
</schedule>
</timetable>




" said:
" said:

The information on the wiki seems obsolete - the XML schema is totally different.
When I get a moment I'll write up the current schema.
Am I right in saying the .WTT XML schema is different to the XML schema for the import?

"Passengers for New Lane, should be seated in the rear coach of the train " - Opinions are my own and not those of my employer
Last edited: 25/01/2015 at 20:52 by headshot119
Log in to reply
ATOC CIF Timetable Parser to XML 29/01/2015 at 06:59 #68531
clive
Avatar
2738 posts
" said:
" said:

The information on the wiki seems obsolete - the XML schema is totally different.
When I get a moment I'll write up the current schema.
I found a moment; the wiki page is now up to date.

Log in to reply
ATOC CIF Timetable Parser to XML 29/01/2015 at 15:28 #68549
headshot119
Avatar
4869 posts
" said:
" said:
" said:

The information on the wiki seems obsolete - the XML schema is totally different.
When I get a moment I'll write up the current schema.
I found a moment; the wiki page is now up to date.
That is the XML schema for the .WTT files though isn' it ?

What the original OP is after is the details on the XML import feature, which as far as I'm aware using a different schema?

"Passengers for New Lane, should be seated in the rear coach of the train " - Opinions are my own and not those of my employer
Log in to reply