This repository has been archived on 2025-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
lwb6/legacyworlds-server-main/data/event-definitions.xsd
Emmanuel BENOîT 7e3d8a558a XML event definitions
Added a dummy event definitions file, and more importantly the
associated XML schema.
2012-06-30 14:30:46 +02:00

110 lines
No EOL
3.7 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.deepclone.com/lw/b6/m2/event-definitions"
xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.deepclone.com/lw/b6/m2/event-definitions"
xmlns:tns="http://www.deepclone.com/lw/b6/m2/event-definitions"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<!-- Root element, contains a sequence of event definitions -->
<xs:element name="lw-event-definitions">
<xs:complexType>
<xs:sequence>
<xs:element name="evdef" type="evdef" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Event definitions. Needs an ID and an I18N base, may also provide information
about the event's priority. May contain a list of field definitions. -->
<xs:complexType name="evdef">
<xs:sequence>
<xs:group ref="evdef-field" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:token" />
<xs:attribute name="priority" use="optional" default="2"
type="priority-value" />
<xs:attribute name="adjustable" use="optional" type="xs:boolean"
default="true" />
<xs:attribute name="i18n-strings" use="required" type="xs:token" />
</xs:complexType>
<!-- Priority values are integers in [0;4] -->
<xs:simpleType name="priority-value">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
<xs:maxInclusive value="4" />
</xs:restriction>
</xs:simpleType>
<!-- Field definitions -->
<xs:group name="evdef-field">
<xs:choice>
<xs:element name="boolean" type="field-base" />
<xs:element name="i18n" type="field-base" />
<xs:element name="integer" type="field-integer" />
<xs:element name="real" type="field-real" />
<xs:element name="text" type="field-text" />
<xs:element name="entity" type="field-entity" />
</xs:choice>
</xs:group>
<!-- Common parts for all field definitions -->
<xs:complexType name="field-base">
<xs:attribute name="id" use="required" type="xs:token" />
<xs:attribute name="required" use="optional" type="xs:boolean"
default="true" />
</xs:complexType>
<!-- Integer field definition -->
<xs:complexType name="field-integer">
<xs:complexContent>
<xs:extension base="field-base">
<xs:attribute name="min" use="optional" type="xs:integer" />
<xs:attribute name="max" use="optional" type="xs:integer" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Real field definition -->
<xs:complexType name="field-real">
<xs:complexContent>
<xs:extension base="field-base">
<xs:attribute name="min" use="optional" type="xs:double" />
<xs:attribute name="max" use="optional" type="xs:double" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Text field definition -->
<xs:complexType name="field-text">
<xs:complexContent>
<xs:extension base="field-base">
<xs:attribute name="min-length" use="optional" type="xs:integer" />
<xs:attribute name="max-length" use="optional" type="xs:integer" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Entity field definition -->
<xs:complexType name="field-entity">
<xs:complexContent>
<xs:extension base="field-base">
<xs:attribute name="entity-type" use="required" type="entity-types" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- Supported entity types -->
<xs:simpleType name="entity-types">
<xs:restriction base="xs:string">
<xs:enumeration value="EMP" />
<xs:enumeration value="PLN" />
<xs:enumeration value="FLT" />
<xs:enumeration value="ALL" />
<xs:enumeration value="BAT" />
<xs:enumeration value="ADM" />
<xs:enumeration value="BUG" />
</xs:restriction>
</xs:simpleType>
</xs:schema>