Detailing the concepts using XSD

Last updated:  JANUARY 14th, 2020

Purpose

This guidance shows how requirements concerning the concepts found in an information definition can be satisfied using the structures found in the XML Schema Definition language.The guidance applies to:



Mapping of requirement to XML Schema definition language

Requirement

Corresponding structure in XSD

Example

General Requirements for Information Definitions

SWIM-INFO-006 Information definition namespace
XSD namespaces
xmlns:don="http://www.swim.donlon-airport.com/swim-ops/gateway" 
targetNamespace="http://www.swim.donlon-airport.com/swim-ops/gateway"

SWIM-INFO-007 Information definition concepts

 

namexs:element name
<xs:element name="SimpleMessage">
definitionxs:annotation
<xs:element name="SimpleMessage">
<xs:annotation>
<xs:documentation>
<definition>Definition of the element/concept</definition>
</xs:documentation>
</xs:annotation>
</xs:element>
data type

xs:element type or

xs:restriction base

<xs:element name="name" type="xs:string">

or

<xs:restriction base="xs:double"/>
SWIM-INFO-008 Unique identifiers for concepts
xs:element id
<xs:element name="status" id="abcd"/>

Requirements coming from SWIM-SERV-022

Additional Requirement on Exchanged Information

cardinality (optional, conditional, mandatory)

xs:element minOccurs and maxOccurs

<xs:element ref="sid:status" minOccurs="0" maxOccurs="unbounded"/>

data type constraint

 

 

value range constraint

xs:restriction

<xs:simpleType name="messageSequenceType">
<xs:restriction base="xs:int">
<xs:minExclusive value="1"/>
<xs:maxExclusive value="100"/>
</xs:restriction>
</xs:simpleType>

special value constraint

xs:restriction

<xs:simpleType name="statusType">
<xs:restriction base="xs:string">
<xs:enumeration value="open"/>
<xs:enumeration value="closed"/>
</xs:restriction>
</xs:simpleType>

character set restrictions

xml encoding

<?xml version="1.0" encoding="UTF-8"?>

structure and relevant relationships

combination of sequence, choice, base, etc.

Too many to show!