From da4601120687538e3fbfe128bd048375624f5d89 Mon Sep 17 00:00:00 2001 From: Eric F Date: Tue, 19 May 2020 09:45:47 +0200 Subject: [PATCH] Chgt de nom des .xsd --- docCataWriter/xsd_mapping.rst | 130 +++++++++++++++++----------------- 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/docCataWriter/xsd_mapping.rst b/docCataWriter/xsd_mapping.rst index 7016b675..3db517f5 100644 --- a/docCataWriter/xsd_mapping.rst +++ b/docCataWriter/xsd_mapping.rst @@ -4,7 +4,7 @@ Le TEST_ROOT n'est pas évalué dans le literalinclude .. |TEST_ROOT| replace:: ../Tests/MappingAccasXsd/ .. |cata_1.py| replace:: :download:`cata_1.py <../Tests/MappingAccasXsd/cata_1.py>` -.. |cata_1_genere.xsd| replace:: :download:`cata_1_genere.xsd <../Tests/MappingAccasXsd/cata_1_genere.xsd>` +.. |cata_1.xsd| replace:: :download:`cata_1.xsd <../Tests/MappingAccasXsd/cata_1.xsd>` .. |cata_1_test1.xml| replace:: :download:`cata_1_test_1.xml <../Tests/MappingAccasXsd/cata_1_test_1.xml>` Generating the XSD file from the catalog file @@ -13,7 +13,7 @@ Generating the XSD file from the catalog file generateXSD command ____________________ -To obtain the |cata_1_genere.xsd| file corresponding to the |cata_1.py| file just enter :: +To obtain the |cata_1.xsd| file corresponding to the |cata_1.py| file just enter :: python ./generateXSD.py -c ./cata_1.py @@ -26,9 +26,9 @@ Here is the interesting part of |cata_1.py| content. :end-before: endJdC -The generateXSD command has created the |cata_1_genere.xsd| file. +The generateXSD command has created the |cata_1.xsd| file. -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml You may check it with xmllint command. @@ -39,7 +39,7 @@ ______________________________ Using the XSD model file to get an XML generated driver is as simple as typing :: - pyxbgen -m cata_1_genere -u cata_1_genere.xsd --write-for-customization + pyxbgen -m cata_1_genere -u cata_1.xsd --write-for-customization It will create an raw/ directory containing various classes imported from the ./cata_1_genere.py file. @@ -47,7 +47,7 @@ It will create an raw/ directory containing various classes imported from the ./ Using PyXB generated drivers _____________________________ -You can use the driver to load an xml file like |cata_1_test1.xml| conforming to the |cata_1_genere.xsd| file. +You can use the driver to load an xml file like |cata_1_test1.xml| conforming to the |cata_1.xsd| file. .. literalinclude:: ../Tests/MappingAccasXsd/cata_1_test_1.py :end-before: CONFIGURATION @@ -82,14 +82,14 @@ If we look at the test_simp_2 in |cata_1.py| content, we get an example of an *S Here is the corresponding mapped XSD type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_2" :end-at: /xs:simpleType An XSD element local declaration using this type is obviously defined since we declare it in the catalog : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_2" @@ -112,14 +112,14 @@ If we look at the test_simp_4 in |cata_1.py| content, we get an example of an *S Here is the corresponding mapped XSD type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_4" :end-at: /xs:simpleType And the XSD element local declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_4" @@ -143,7 +143,7 @@ If we look at the test_simp_2_3 in |cata_1.py| content, we get an example of an Here is the corresponding mapped XSD type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_2_3" :end-before: T_test_simp_2_4 @@ -156,7 +156,7 @@ This is because the XSD list type is used for multiple occurrences of a *SIMP* a An XSD element declaration using this type is also defined as for test_simp2 : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_2_3" @@ -180,7 +180,7 @@ If a *max* eficas attribute is set to a number instead of '**' you get a additio Here is the corresponding mapped XSD type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_2_4" :end-before: T_test_simp_2_5 @@ -202,7 +202,7 @@ The *defaut* eficas attribute take into account the *min* and *max* eficas attri If we look at the XSD element declaration, you can see the **default** xsd attribute which is set to a list of 4 numbers. -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_2_5" @@ -232,7 +232,7 @@ When we define the fololwing eficas keyword with *val_min*, *val_max* attributes The corresponding generated XSD type is : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_2_1" :end-before: T_test_simp_2_2 @@ -247,7 +247,7 @@ When we define the following eficas keyword with *into* attribute : The corresponding mapped XSD type is : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_2_2" :end-before: T_test_simp_2_3 @@ -272,14 +272,14 @@ The *SIMP* declaration is : You get the xsd type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_1_1" :end-at: /xs:simpleType And the element declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_1_1" @@ -302,7 +302,7 @@ The *SIMP* declaration is : You get the xsd type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_1_3" :end-before: T_test_simp_2 @@ -311,7 +311,7 @@ You get the xsd type : And the element declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_1_3" @@ -343,14 +343,14 @@ The *SIMP* declaration is : You get the xsd type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_7_4" :end-at: /xs:simpleType And the element declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_7_4" @@ -389,14 +389,14 @@ The *UserASSD* class declared this way is quite the same notion as using an *ASS You get the xsd type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_8_1" :end-at: /xs:simpleType And the element declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_8_1" @@ -417,14 +417,14 @@ Note the User_Data type given to the *typ* attribute. You get the xsd type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_test_simp_8_2" :end-at: /xs:simpleType And the element declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="test_simp_8_2" @@ -462,7 +462,7 @@ If we have a look to a JdC definition : We notice that the *code* parameter declares the name of the code for which the catalog is written. The xsd mapping is : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_Test1" :end-at: /xs:complexType @@ -471,7 +471,7 @@ The **xsd:choice** with a **maxOccurs=unbounded** is used because the user may c The root element declaration is : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="Test1" :end-at: name="Test1" @@ -510,7 +510,7 @@ The *OPER* command describes a way to create user type instances : You get the xsd type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_ReadMesh" :end-at: /xs:complexType @@ -521,7 +521,7 @@ You get the xsd type : The element declaration is : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="ReadMesh" @@ -539,7 +539,7 @@ If you want to declare in a catalog that a specific data of the dataset is a reu You get the xsd types : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_MyField" :end-at: /xs:complexType @@ -548,7 +548,7 @@ You get the xsd types : and -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_onMesh" :end-at: /xs:simpleType @@ -556,7 +556,7 @@ and Concerning the element declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="MyField" @@ -596,14 +596,14 @@ The *PROC* declaration is : You get the xsd type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_Test_proc_2" :end-at: /xs:complexType And the element declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="Test_proc_2" @@ -626,14 +626,14 @@ Here is a *PROC* declaration using an SIMP UserASSD : You get the *PROC* xsd type : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_Meshes" :end-at: /xs:complexType And the associated element declaration : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="Meshes" @@ -643,14 +643,14 @@ And the associated element declaration : Concerning the *FACT* xsd type, you get : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_mesh" :end-at: /xs:complexType The *SIMP* of UserASSD type becomes : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_name" :end-at: /xs:simpleType @@ -669,14 +669,14 @@ If you want to declare somewhere in a catalog that a specific data is a reuse of You get the xsd types : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_MyFieldBis" :end-at: /xs:complexType and -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_onMesh_1" :end-at: /xs:simpleType @@ -684,7 +684,7 @@ and Concerning the element declaration, you get : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="MyFieldBis" @@ -707,14 +707,14 @@ As explain in :ref:`fact-label` section, the *FACT* keyword provide a way of gro You get the two xsd complex types using the **** xsd element : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_ThresholdExceedence" :end-at: /xs:complexType and -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_Event" :end-at: /xs:complexType @@ -722,7 +722,7 @@ and The element declaration is : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="ThresholdExceedence" @@ -738,7 +738,7 @@ In order to illustrate the management of the cardinality, we can review the seco You get the xsd complex types using the **** xsd element : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_species_parameters" :end-at: /xs:complexType @@ -746,7 +746,7 @@ You get the xsd complex types using the **** xsd element : The element declaration is : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-at: name="species_parameters" @@ -768,19 +768,19 @@ If we review the following catalog from the :ref:`fact-label` section : The xsd mapping provides two **** elements : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_frequency_every" :end-at: /xs:group -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :start-at: name="T_frequ_not_every" :end-at: /xs:group The parent xsd type uses **group ref** declarations : -.. literalinclude:: ../Tests/MappingAccasXsd/cata_1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/cata_1.xsd :language: xml :dedent: 2 :start-after: name="T_Test_proc_5" @@ -824,32 +824,32 @@ The given values in the *importedBy* keyword declare middle level/domain specifi For each catalog declared in the *importedBy* keyword **one global xsd type and one global element declaration** are produced : -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.xsd :language: xml :start-at: name="T_MDCommun_Abstract" :end-at: name="T_MDCommun_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.xsd :language: xml :start-at: name="MDCommun_Abstract" :end-at: name="MDCommun_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.xsd :language: xml :start-at: name="T_CFDCommun_Abstract" :end-at: name="T_CFDCommun_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.xsd :language: xml :start-at: name="CFDCommun_Abstract" :end-at: name="CFDCommun_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.xsd :language: xml :start-at: name="T_DomainSpecific_Abstract" :end-at: name="T_DomainSpecific_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.xsd :language: xml :start-at: name="DomainSpecific_Abstract" :end-at: name="DomainSpecific_Abstract" @@ -862,7 +862,7 @@ The abstract complex type says nothing about what will be the concrete type. The root xsd is element type is : -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_modeleCommun.xsd :language: xml :start-at: name="T_modeleCommun" :end-at: /xs:complexType @@ -885,32 +885,32 @@ This catalog finality is to gather common informations from a class of code. For For each catalog declared in the *importedBy* keyword we get global xsd types and global element declaration production (as for the upper level before) : -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.xsd :language: xml :start-at: name="T_MD1_Abstract" :end-at: name="T_MD1_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.xsd :language: xml :start-at: name="MD1_Abstract" :end-at: name="MD1_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.xsd :language: xml :start-at: name="T_MD2_Abstract" :end-at: name="T_MD2_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.xsd :language: xml :start-at: name="MD2_Abstract" :end-at: name="MD2_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.xsd :language: xml :start-at: name="T_MDSpecific_Abstract" :end-at: name="T_MDSpecific_Abstract" -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.xsd :language: xml :start-at: name="MDSpecific_Abstract" :end-at: name="MDSpecific_Abstract" @@ -920,7 +920,7 @@ The abstract complex type still says nothing about what will be the concrete typ The root xsd element type is : -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MDCommun.xsd :language: xml :start-at: name="T_MDCommun" :end-at: /xs:complexType @@ -946,7 +946,7 @@ Many code specific catalogs may use the same intermediate catalog or even direct Since the *importedBy* keyword is empty, there is no abstract type production. -.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MD1_genere.xsd +.. literalinclude:: ../Tests/MappingAccasXsd/MultipleCata/cata_MD1.xsd :language: xml :start-at: name="T_MD1" :end-at: /xs:complexType -- 2.39.2