XMLSchema > Attributes : a small step

This commit is contained in:
Jean Sirmai 2021-09-19 22:39:47 +02:00
parent e910a2958f
commit 2383f21e7b
Signed by untrusted user who does not match committer: jean
GPG Key ID: FB3115C340E057E3
2 changed files with 53 additions and 29 deletions

View File

@ -1,27 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<gem-graph-model> <gem-graph-model>
<identity> <identity>
<model_name>Modèle de test</model_name> <anything_but_not_just_the_word_name>Modèle de test</anything_but_not_just_the_word_name>
<name value="(Trois dimères)"/> <name value="(Trois dimères)"/>
<owner_id>2</owner_id> <owner_id>2</owner_id>
<date>1629830000</date> <date>1629830000</date>
<version>1.0</version> <version>1.0</version>
</identity> </identity>
<parameters id="0" date="0" author="Gaston Lagaffe"> <parameters id="0" date="0" author="Gaston Lagaffe">
<modelization> <modelization>
<max_thread value="0"/> <max_thread value="0"/>
<max_cycles value="13"/> <max_cycles value="13"/>
</modelization> </modelization>
<space> <space>
<dimension value="1"/> <dimension value="1"/>
<size value="39"/> <size value="39"/>
<site_multiplicity value="2"/> <site_multiplicity value="2"/>
<boundaries/> <boundaries/>
</space> </space>
</parameters> </parameters>
<objects id="dimer" date="1629830000" author="Jean Sirmai"> <objects id="dimer" date="1629830000" author="Jean Sirmai">
<arrow x="0" y="0" z="0" site="0" weight="0"/> <arrow x="0" y="0" z="0" site="0" weight="0"/>
</objects> </objects>
<space>aaa</space> <space>aaa</space>
<savestates>aaa</savestates> <savestates>aaa</savestates>
<transitions>aaa</transitions> <transitions>aaa</transitions>

View File

@ -1,6 +1,23 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- https://www.w3schools.com/xml/el_attribute.asp -->
<!-- use="required" should be allowed ?!-->
<xs:attribute name="id" type="xs:string"/>
<xs:attribute name="date" type="xs:integer"/> <!--TODO type ? -->
<xs:attribute name="name" type="xs:string"/> <!--TODO pas clair, ce truc... -->
<xs:attribute name="value" type="xs:integer"/> <!--TODO WARNING: It's an integer !-->
<xs:attribute name="author" type="xs:string"/>
<xs:attribute name="version" type="xs:float"/>
<xs:attribute name="owner_id" type="xs:integer"/>
<xs:attribute name="x" type="xs:integer"/>
<xs:attribute name="y" type="xs:integer"/>
<xs:attribute name="z" type="xs:integer"/>
<xs:attribute name="site" type="xs:integer"/>
<xs:attribute name="weight" type="xs:integer"/>
<xs:element name="gem-graph-model"> <xs:element name="gem-graph-model">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
@ -9,7 +26,7 @@
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element name="model_name" type="xs:string"/> <xs:element name="anything_but_not_just_the_word_name" type="xs:string"/>
<xs:element name="name"> <xs:element name="name">
<xs:complexType> <xs:complexType>
@ -35,13 +52,13 @@
<xs:element name="max_thread"> <xs:element name="max_thread">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:integer"/> <xs:attribute ref="value"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="max_cycles"> <xs:element name="max_cycles">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:integer"/> <xs:attribute ref="value"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
@ -55,19 +72,19 @@
<xs:element name="dimension"> <xs:element name="dimension">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:integer"/> <xs:attribute ref="value"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="size"> <xs:element name="size">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:integer"/> <xs:attribute ref="value"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="site_multiplicity"> <xs:element name="site_multiplicity">
<xs:complexType> <xs:complexType>
<xs:attribute name="value" type="xs:integer"/> <xs:attribute ref="value"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
@ -81,9 +98,9 @@
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
<xs:attribute name="id" type="xs:string"/> <xs:attribute ref="id"/>
<xs:attribute name="date" type="xs:integer"/> <xs:attribute ref="date"/>
<xs:attribute name="author" type="xs:string"/> <xs:attribute ref="author"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
@ -93,18 +110,18 @@
<xs:element name="arrow"> <xs:element name="arrow">
<xs:complexType> <xs:complexType>
<xs:attribute name="x" type="xs:integer"/> <xs:attribute ref="x"/>
<xs:attribute name="y" type="xs:integer"/> <xs:attribute ref="y"/>
<xs:attribute name="z" type="xs:integer"/> <xs:attribute ref="z"/>
<xs:attribute name="site" type="xs:integer"/> <xs:attribute ref="site"/>
<xs:attribute name="weight" type="xs:integer"/> <xs:attribute ref="weight"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
<xs:attribute name="id" type="xs:string"/> <xs:attribute ref="id"/>
<xs:attribute name="date" type="xs:integer"/> <xs:attribute ref="date"/>
<xs:attribute name="author" type="xs:string"/> <xs:attribute ref="author"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>