I'm trying to generate an XML file that has a "complex structure" that is indicated in the XSD data below.
I can't find any examples on the internet for this kind of output. I can do "simple XML" with 2 different addon programs BUT need help with this one.
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd=" <!-- root element scheduledata
-->
<xsd:element name="scheduledata">
<xsd:complexType>
<xsd:sequence>
<!-- the scheduledata may contain one ore more aircraft
-->
<xsd:element name="aircraft" minOccurs="1" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<!-- each aircraft must contain one and only one updateenddate
-->
<xsd:element name="updateenddate" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:all>
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each aircraft must contain one schedule
-->
<xsd:element ref="schedule" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
<!-- each aircraft has an regnr attribute wich identifies the aircraft in the avinonde system
-->
<xsd:attribute name="regnr" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<!-- the scheduledata element must have a version attribute
-->
<xsd:attribute name="version" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<!-- description of the schedule tag
-->
<xsd:element name="schedule">
<xsd:complexType>
<xsd:sequence>
<!-- each schedule may contain one or more activities
-->
<xsd:element name="activity" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:all>
<!-- each activity must be one of the following types; "onground", "ferry"
-->
<xsd:element name="type">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="onground" />
<xsd:enumeration value="ferry" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- each activity must have a start tag, wich contains an airport (ICAO) and a dateTime
-->
<xsd:element name="start">
<xsd:complexType>
<xsd:all>
<xsd:element name="airport" type="airport" />
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each activity must also have a end tag, wich contains an airport (ICAO) and a dateTime
-->
<xsd:element name="end">
<xsd:complexType>
<xsd:all>
<xsd:element name="airport" type="airport" />
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each activity must set allowlisting with string values "yes" or "no"
-->
<xsd:element name="allowlisting">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="yes" />
<xsd:enumeration value="no" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- description of the airport tag, the ICAO code must contain at least 3 and at most 4 letters [a-zA-Z0-9]
-->
<xsd:simpleType name="airport">
<xsd:restriction base="xsd:string">
<xsd
attern value="[\w]{3,4}" />
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
====================
I can't find any examples on the internet for this kind of output. I can do "simple XML" with 2 different addon programs BUT need help with this one.
<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns:xsd=" <!-- root element scheduledata
-->
<xsd:element name="scheduledata">
<xsd:complexType>
<xsd:sequence>
<!-- the scheduledata may contain one ore more aircraft
-->
<xsd:element name="aircraft" minOccurs="1" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<!-- each aircraft must contain one and only one updateenddate
-->
<xsd:element name="updateenddate" minOccurs="1" maxOccurs="1">
<xsd:complexType>
<xsd:all>
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each aircraft must contain one schedule
-->
<xsd:element ref="schedule" minOccurs="1" maxOccurs="1" />
</xsd:sequence>
<!-- each aircraft has an regnr attribute wich identifies the aircraft in the avinonde system
-->
<xsd:attribute name="regnr" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<!-- the scheduledata element must have a version attribute
-->
<xsd:attribute name="version" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<!-- description of the schedule tag
-->
<xsd:element name="schedule">
<xsd:complexType>
<xsd:sequence>
<!-- each schedule may contain one or more activities
-->
<xsd:element name="activity" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:all>
<!-- each activity must be one of the following types; "onground", "ferry"
-->
<xsd:element name="type">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="onground" />
<xsd:enumeration value="ferry" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<!-- each activity must have a start tag, wich contains an airport (ICAO) and a dateTime
-->
<xsd:element name="start">
<xsd:complexType>
<xsd:all>
<xsd:element name="airport" type="airport" />
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each activity must also have a end tag, wich contains an airport (ICAO) and a dateTime
-->
<xsd:element name="end">
<xsd:complexType>
<xsd:all>
<xsd:element name="airport" type="airport" />
<xsd:element name="datetime" type="xsd:dateTime" />
</xsd:all>
</xsd:complexType>
</xsd:element>
<!-- each activity must set allowlisting with string values "yes" or "no"
-->
<xsd:element name="allowlisting">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="yes" />
<xsd:enumeration value="no" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<!-- description of the airport tag, the ICAO code must contain at least 3 and at most 4 letters [a-zA-Z0-9]
-->
<xsd:simpleType name="airport">
<xsd:restriction base="xsd:string">
<xsd
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
====================