Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8"?>
- <?xml-stylesheet href="schema2xhtml.xsl" type="text/xsl"?>
- <!-- XML Schema for OpenLCB Configuration Description Information (CDI) -->
- <xs:schema version="CDI 1.3" xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <xs:complexType name="mapType">
- <xs:annotation>
- <xs:documentation>
- A map relates one or more property elements (keys)
- to specific values.
- </xs:documentation>
- </xs:annotation>
- <xs:sequence>
- <xs:element name="name" minOccurs="0" maxOccurs="1" />
- <xs:element name="description" minOccurs="0" maxOccurs="1" />
- <xs:element name="relation" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="property" minOccurs="1" maxOccurs="1" />
- <xs:element name="value" minOccurs="1" maxOccurs="1" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- <xs:complexType name="groupType">
- <xs:sequence>
- <xs:element name="name" minOccurs="0" maxOccurs="1" />
- <xs:element name="description" minOccurs="0" maxOccurs="1" />
- <xs:element name="repname" minOccurs="0" maxOccurs="unbounded" />
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Allows any sequence of the contained element types
- </xs:documentation>
- </xs:annotation>
- <xs:element name="group" type="groupType" minOccurs="0" maxOccurs="1" />
- <xs:element name="string" type="stringType" minOccurs="0" maxOccurs="1" />
- <xs:element name="int" type="intType" minOccurs="0" maxOccurs="1" />
- <xs:element name="eventid" type="eventidType" minOccurs="0" maxOccurs="1" />
- <xs:element name="float" type="floatType" minOccurs="0" maxOccurs="1" />
- </xs:choice>
- </xs:sequence>
- <xs:attribute name="offset" type="xs:int" default="0">
- <xs:annotation>
- <xs:documentation>
- Positive or negative offset between the address of
- the end of previous element and the start of
- this group's contents.
- Offset of zero means that this element starts
- immediately after the previous one.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="replication" type="xs:int" default="1" />
- </xs:complexType>
- <xs:complexType name="eventidType">
- <xs:sequence>
- <xs:element name="name" minOccurs="0" maxOccurs="1" />
- <xs:element name="description" minOccurs="0" maxOccurs="1" />
- <xs:element name="map" type="mapType" minOccurs="0" maxOccurs="1" />
- </xs:sequence>
- <xs:attribute name="offset" type="xs:int" default="0">
- <xs:annotation>
- <xs:documentation>
- Positive or negative offset between the address of
- the end of previous element and the start of
- this elements's contents.
- Offset of zero means that this element starts
- immediately after the previous one.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- <xs:complexType name="intType">
- <xs:sequence>
- <xs:element name="name" minOccurs="0" maxOccurs="1" />
- <xs:element name="description" minOccurs="0" maxOccurs="1" />
- <xs:element name="min" minOccurs="0" maxOccurs="1" />
- <xs:element name="max" minOccurs="0" maxOccurs="1" />
- <xs:element name="default" minOccurs="0" maxOccurs="1" />
- <xs:element name="map" type="mapType" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- The 'value' of each entry is displayed, and
- the 'property' content (number) is sent
- to/from the node
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="size" default="1">
- <xs:annotation>
- <xs:documentation>
- Storage size of this variable in bytes.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="1"/>
- <xs:enumeration value="2"/>
- <xs:enumeration value="4"/>
- <xs:enumeration value="8"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="offset" type="xs:int" default="0">
- <xs:annotation>
- <xs:documentation>
- Positive or negative offset between the
- address of the end of previous element and the
- start of this elements's contents.
- Offset of zero means that this element starts
- immediately after the previous one.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- <xs:simpleType name="floatFormat">
- <xs:restriction base="xs:string">
- <!-- This is a somewhat limiting regex, as it does not allow all possible -->
- <!-- printf formats. It will allow the most common formats that have -->
- <!-- been seen and used before, however -->
- <xs:pattern value="%[0-9]*(\.([0-9]*))?f"/>
- </xs:restriction>
- </xs:simpleType>
- <xs:complexType name="floatType">
- <xs:sequence>
- <xs:element name="name" minOccurs="0" maxOccurs="1" />
- <xs:element name="description" minOccurs="0" maxOccurs="1" />
- <xs:element name="min" minOccurs="0" maxOccurs="1" />
- <xs:element name="max" minOccurs="0" maxOccurs="1" />
- <xs:element name="default" minOccurs="0" maxOccurs="1" />
- <xs:element name="map" type="mapType" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- The 'value' of each entry is displayed, and
- the 'property' content (number) is sent
- to/from the node
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- <xs:attribute name="size" use="required">
- <xs:annotation>
- <xs:documentation>
- Storage size of this variable in bytes.
- </xs:documentation>
- </xs:annotation>
- <xs:simpleType>
- <xs:restriction base="xs:token">
- <xs:enumeration value="2"/>
- <xs:enumeration value="4"/>
- <xs:enumeration value="8"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="offset" type="xs:int" default="0">
- <xs:annotation>
- <xs:documentation>
- Positive or negative offset between the
- address of the end of previous element and the
- start of this elements's contents.
- Offset of zero means that this element starts
- immediately after the previous one.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="formatting" type="floatFormat" >
- <xs:annotation>
- <xs:documentation>
- printf-style format string for displaying data to the user, like %3.1f
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- <xs:complexType name="stringType">
- <xs:sequence>
- <xs:element name="name" minOccurs="0" maxOccurs="1" />
- <xs:element name="description" minOccurs="0" maxOccurs="1" />
- <xs:element name="map" type="mapType" minOccurs="0" maxOccurs="1" />
- </xs:sequence>
- <xs:attribute name="size" type="xs:int" use="required">
- <xs:annotation>
- <xs:documentation>
- Storage size of this variable in bytes.
- This includes the trailing null byte that
- terminates the string content.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="offset" type="xs:int" default="0">
- <xs:annotation>
- <xs:documentation>
- Positive or negative offset between the
- address of the end of previous element and the
- start of this elements's contents.
- Offset of zero means that this element starts
- immediately after the previous one.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- <xs:element name="cdi">
- <xs:annotation>
- <xs:documentation>
- This is the schema for Configuration
- Description Information (cdi)
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="identification" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Common first element to identify the decoder
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="manufacturer" minOccurs="0" maxOccurs="1" />
- <xs:element name="model" minOccurs="0" maxOccurs="1" />
- <xs:element name="hardwareVersion" minOccurs="0" maxOccurs="1" />
- <xs:element name="softwareVersion" minOccurs="0" maxOccurs="1" />
- <xs:element name="map" type="mapType" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- This map can be used to add arbitrary key/value
- descriptions of the node.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- <xs:element name="acdi" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Element that identifies that memory information is available
- as defined by the Abbreviated Common Description Information
- (ACDI) standard.
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:attribute name="fixed" type="xs:int" default="4">
- <xs:annotation>
- <xs:documentation>
- The decimal version number of the format for the fixed
- information block.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="var" type="xs:int" default="2">
- <xs:annotation>
- <xs:documentation>
- The decimal version number of the format for
- the variable information block.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- <xs:element name="segment" minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Define the contents of a memory space
- </xs:documentation>
- </xs:annotation>
- <xs:complexType>
- <xs:sequence>
- <xs:element name="name" minOccurs="0" maxOccurs="1" />
- <xs:element name="description" minOccurs="0" maxOccurs="1" />
- <xs:choice minOccurs="0" maxOccurs="unbounded">
- <xs:annotation>
- <xs:documentation>
- Allows any sequence of the contained element types
- </xs:documentation>
- </xs:annotation>
- <xs:element name="group" type="groupType" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Allows grouping and replication of multiple locations.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="string" type="stringType" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Describes a human-readable UTF-8 string in the data.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="int" type="intType" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Describes an integer value in the data.
- The field can be considered either a number,
- or a set of specific coded values via a map.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <xs:element name="eventid" type="eventidType" minOccurs="0" maxOccurs="1">
- <xs:annotation>
- <xs:documentation>
- Describes an 8-byte Event ID in the data.
- </xs:documentation>
- </xs:annotation>
- </xs:element>
- <!--
- XML Schema 1.1 construct expressing extensibility promise
- <xs:assert test="every $x in * satisfies (exists($x/@size) and $x/@size castable to
- xs:integer)"/>
- <xs:assert test="every $x in * satisfies (exists($x/@offset) and $x/@offset castable to
- xs:integer)"/>
- <xs:any minOccurs="0" maxOccurs="1" processContents="lax">
- <xs:annotation>
- <xs:documentation>
- Extension point for future schema
- </xs:documentation>
- </xs:annotation>
- </xs:any>
- -->
- </xs:choice>
- </xs:sequence>
- <xs:attribute name="space" type="xs:int" use="required">
- <xs:annotation>
- <xs:documentation>
- The decimal number of the address space where the information is found.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- <xs:attribute name="origin" type="xs:int" default="0">
- <xs:annotation>
- <xs:documentation>
- Starting address of the segment's contents
- within the memory space.
- </xs:documentation>
- </xs:annotation>
- </xs:attribute>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:schema>
Advertisement
Add Comment
Please, Sign In to add comment