Skip to content

SIRI XML schema

Eliot edited this page Oct 6, 2023 · 34 revisions

SIRI XML Document Structure

Siri XML document have a root Siri element that indicates the schema and version to which the document conforms.

A SIRI XML document is a computer file containing XML data that adheres to the SIRI schema. It must have a root Siri element that indicates the schema and version to which the document conforms. The document can then be validated against the schema to ensure correctness, meaning it is well-formed XML that conforms to the SIRI schema and satisfies key referential integrity constraints specified by the SIRI XML Schema

Here is an example

<Siri xmlns="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://www.siri.org.uk/siri ../../xsd/siri.xsd">

Structure of the xxxDelivery element

The xxxDelivery element consists of two sections:

1. Header

The header contains a mandatory ResponseTimestamp element

2. Payload

corresponds to the description of the object itself independently of any and other headers

Example

Here's an example of a ServiceDelivery element with a header and a payload

<Siri xmlns="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://www.siri.org.uk/siri ../../xsd/siri.xsd">
 <ServiceDelivery>
  <!--=======HEADER================================================== -->
  <ResponseTimestamp>2004-12-17T09:30:46-05:00</ResponseTimestamp>
  <ProducerRef>KUBRICK</ProducerRef>
  <Status>true</Status>
  <MoreData>false</MoreData>
  <!--=======PAYLOAD============================================== -->
  <GeneralMessageDelivery version="2.0">
   <ResponseTimestamp>2001-12-17T09:30:47.0Z</ResponseTimestamp>
   <RequestMessageRef>12345</RequestMessageRef>
   <Status>true</Status>
   <GeneralMessage formatRef="string">
    <RecordedAtTime>2001-12-17T09:30:47.0Z</RecordedAtTime>
    <InfoMessageIdentifier>00034567</InfoMessageIdentifier>
    <InfoMessageVersion>2</InfoMessageVersion>
    <InfoChannelRef>WARNINGS</InfoChannelRef>
    <ValidUntilTime>2001-12-17T09:30:47.0Z</ValidUntilTime>
    <Content>Beware the Ides of March</Content>
   </GeneralMessage>
   <GeneralMessageCancellation>
    <RecordedAtTime>2001-12-17T09:30:47.0Z</RecordedAtTime>
    <InfoMessageIdentifier>00034564</InfoMessageIdentifier>
    <InfoChannelRef>WARNINGS</InfoChannelRef>
   </GeneralMessageCancellation>
  </GeneralMessageDelivery>
 </ServiceDelivery>
</Siri>

SIRI Schema Overview

The SIRI XML schema is encoded as a W3C .xsd schema, and is modularized into a number of reusable sub schemas and type packages. The schema and has been validated against mainstream validators and there are working applications using common tools.

Clone this wiki locally