]> SALOME platform Git repositories - tools/eficas.git/commitdiff
Salome HOME
Ajout d un test de mapping des tuples
authorEric F <eric.fayolle.77@gmail.com>
Mon, 29 Mar 2021 15:37:12 +0000 (17:37 +0200)
committerEric F <eric.fayolle.77@gmail.com>
Mon, 29 Mar 2021 15:37:12 +0000 (17:37 +0200)
Tests/MappingAccasXsd/Tuples.xml [new file with mode: 0644]
Tests/MappingAccasXsd/Tuples_Example1.xsd [new file with mode: 0644]

diff --git a/Tests/MappingAccasXsd/Tuples.xml b/Tests/MappingAccasXsd/Tuples.xml
new file mode 100644 (file)
index 0000000..49aae68
--- /dev/null
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!--Fichier échantillon XML généré par XMLSpy v2020 rel. 2 sp1 (x64) (http://www.altova.com)-->\r
+<TEST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Tuples_Example1.xsd">\r
+<E1_list_tuple3 >\r
+       <el1>3.141590118408203125</el1>\r
+       <el2>0</el2>\r
+       <el3>String</el3>\r
+       <el1>31.141590118408203125</el1>\r
+       <el2>1</el2>\r
+       <el3>String1</el3>\r
+</E1_list_tuple3>\r
+\r
+<E1_list_tuple3 >\r
+       <el1>3.141590118408203125</el1>\r
+       <el2>0</el2>\r
+       <el3>String</el3>\r
+       <el1>31.141590118408203125</el1>\r
+       <el2>1</el2>\r
+       <el3>Str ing1</el3>\r
+</E1_list_tuple3>\r
+\r
+<E2_tuple3>\r
+3.141590118408203125 0 String\r
+</E2_tuple3>\r
+\r
+\r
+<!-- Tuple invalide-->\r
+<!--<E2_tuple3>\r
+3.141590118408203125 0 Str ing\r
+</E2_tuple3>\r
+-->\r
+\r
+<!-- Ce tuple est valid en XSD (et ce n'est pas ce que l'on voudrait) -->\r
+<E2_tuple3>\r
+0 String 3.141590118408203125 \r
+</E2_tuple3>\r
+\r
+<E2_list_tuple3>\r
+       <E2_tuple3>3.141590118408203125 0 String</E2_tuple3>\r
+       <E2_tuple3>31.141590118408203125 10 1String</E2_tuple3>\r
+</E2_list_tuple3>\r
+</TEST>\r
diff --git a/Tests/MappingAccasXsd/Tuples_Example1.xsd b/Tests/MappingAccasXsd/Tuples_Example1.xsd
new file mode 100644 (file)
index 0000000..490fa8f
--- /dev/null
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">\r
+       <xs:element name="TEST">\r
+               <xs:annotation>\r
+                       <xs:documentation>Comment describing your root element</xs:documentation>\r
+               </xs:annotation>\r
+               <xs:complexType>\r
+                  <xs:choice maxOccurs="unbounded">\r
+                          <xs:element ref="E1_tuple3"/>\r
+                          <xs:element ref="E2_tuple3"/>\r
+                          <xs:element ref="E1_list_tuple3"/>\r
+                          <xs:element ref="E2_list_tuple3"/>\r
+                  </xs:choice>\r
+               </xs:complexType>\r
+       </xs:element>\r
+       \r
+       \r
+       <xs:simpleType name="T1_tuple3_el1">\r
+               <xs:restriction base="xs:float"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T1_tuple3_el2">\r
+               <xs:restriction base="xs:integer"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T1_tuple3_el3">\r
+               <xs:restriction base="xs:string"></xs:restriction>\r
+       </xs:simpleType>                \r
+       <xs:complexType name="T1_tuple3">\r
+               <xs:sequence>\r
+                       <xs:element name="el1" type="T1_tuple3_el1"/>           \r
+                       <xs:element name="el2" type="T1_tuple3_el2"/>           \r
+                       <xs:element name="el3" type="T1_tuple3_el3"/>           \r
+               </xs:sequence>      \r
+       </xs:complexType>\r
+       <xs:element name="E1_tuple3" type="T1_tuple3"/>\r
+       \r
+       <xs:simpleType name="T1_list_tuple3_el1">\r
+               <xs:restriction base="xs:float"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T1_list_tuple3_el2">\r
+               <xs:restriction base="xs:integer"/>\r
+       </xs:simpleType>\r
+       <xs:simpleType name="T1_list_tuple3_el3">\r
+               <xs:restriction base="xs:string"></xs:restriction>\r
+       </xs:simpleType>                \r
+       <xs:complexType name="T1_list_tuple3">\r
+               <xs:sequence maxOccurs="unbounded">\r
+                       <xs:element name="el1" type="T1_list_tuple3_el1"/>              \r
+                       <xs:element name="el2" type="T1_list_tuple3_el2"/>              \r
+                       <xs:element name="el3" type="T1_list_tuple3_el3"/>              \r
+               </xs:sequence>      \r
+       </xs:complexType>\r
+       <xs:element name="E1_list_tuple3" type="T1_list_tuple3"/>\r
+       \r
+       \r
+       <xs:simpleType name="T2_tuple3_content">\r
+       <xs:union>\r
+               <xs:simpleType><xs:restriction base="xs:float"/></xs:simpleType>\r
+               <xs:simpleType><xs:restriction base="xs:integer"/></xs:simpleType>\r
+               <xs:simpleType><xs:restriction base="xs:string"/></xs:simpleType>       \r
+       </xs:union>\r
+       \r
+       </xs:simpleType>\r
+       <xs:simpleType name="T2_tuple3">\r
+               <xs:restriction>\r
+                       <xs:simpleType>\r
+                               <xs:list>\r
+                                       <xs:simpleType>\r
+                                               <xs:restriction base="T2_tuple3_content"/>\r
+                                       </xs:simpleType>\r
+                               </xs:list>\r
+                       </xs:simpleType>\r
+                       <xs:maxLength value="3"/>\r
+               </xs:restriction>\r
+       </xs:simpleType>\r
+       \r
+       <xs:element name="E2_tuple3" type="T2_tuple3"/>\r
+\r
+       <xs:complexType name="T2_list_tuple3">\r
+               <xs:sequence maxOccurs="2">\r
+                       <xs:element ref="E2_tuple3"/>\r
+               </xs:sequence>\r
+       </xs:complexType>\r
+       \r
+       <xs:element name="E2_list_tuple3" type="T2_list_tuple3"/>\r
+       \r
+</xs:schema>\r