This repository has been archived on 2024-05-19. You can view files and clone it, but cannot push or open issues or pull requests.
l-systems/data.xsd

90 lines
2.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Valeur contenu par une substitution -->
<xs:simpleType name="Element">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]+" />
</xs:restriction>
</xs:simpleType>
<!-- Valeur contenu par une substitution -->
<xs:simpleType name="SubElement">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z|\[|\]]+" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Substitution">
<xs:simpleContent>
<xs:extension base="SubElement">
<xs:attribute name="member" use="required">
<!-- Membre d'une substitution -->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{1}" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- Valeur contenu par une interprétation -->
<xs:simpleType name="InterpElement">
<xs:restriction base="xs:string">
<xs:pattern value="(LINE) \d+|(MOVE) \d+|(TURN) -?\d+|(RE)?(STORE)" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="Interpretation">
<xs:simpleContent>
<xs:extension base="InterpElement">
<xs:attribute name="member" use="required">
<!-- Membre d'une interprétation -->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z|\[|\]]{1}" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Substitutions">
<xs:sequence>
<xs:element name="substitution" type="Substitution" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Interpretations">
<xs:sequence>
<xs:element name="interpretation" type="Interpretation" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="Lsystem">
<xs:sequence>
<xs:element name="name" type="xs:string" />
<!-- TODO: On peut utiliser [a-z|\d] mais c'est peut-être
trop restrictif ? -->
<xs:element name="base" type="Element" />
<xs:element name="axiom" type="Element" />
<xs:element name="substitutions" type="Substitutions" />
<xs:element name="interpretations" type="Interpretations" />
</xs:sequence>
</xs:complexType>
<xs:element name="lsystems">
<xs:complexType>
<xs:sequence>
<xs:element name="lsystem" type="Lsystem" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>