]> SALOME platform Git repositories - tools/eficas.git/blob - Efi2Xsd/balisesXSD.py
Salome HOME
fin du menage
[tools/eficas.git] / Efi2Xsd / balisesXSD.py
1 texteDebut='<?xml version="1.0" encoding="UTF-8"?>\n<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"\nxmlns="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\ntargetNamespace="http://chercheurs.edf.com/logiciels/{}"\nelementFormDefault="qualified" attributeFormDefault="unqualified" version="0">\n'
2 texteDebutNiveau2='<?xml version="1.0" encoding="UTF-8"?>\n<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"\nxmlns="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\ntargetNamespace="http://chercheurs.edf.com/logiciels/{}"\nelementFormDefault="qualified" attributeFormDefault="unqualified" version="0">\n'
3 texteDebutNiveau3='<?xml version="1.0" encoding="UTF-8"?>\n<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"\nxmlns="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\nxmlns:{}="http://chercheurs.edf.com/logiciels/{}"\ntargetNamespace="http://chercheurs.edf.com/logiciels/{}"\nelementFormDefault="qualified" attributeFormDefault="unqualified" version="0">\n'
4 texteFin='</xs:schema>'
5
6 # SIMP
7 debutSimpleType      = '\t<xs:simpleType name="{}">\n'
8 debutSimpleTypeSsNom = '\t<xs:simpleType>\n'
9 fermeSimpleType      = '\t</xs:simpleType>\n'
10 debutRestrictionBase = '\t\t<xs:restriction base="{}">\n'
11 fermeRestrictionBase = '\t\t</xs:restriction>\n'
12 enumeration          = '\t\t\t<xs:enumeration value="{}"/>\n'
13 maxInclusiveBorne    = '\t\t\t<xs:maxInclusive value = "{}"/>\n'
14 minInclusiveBorne    = '\t\t\t<xs:minInclusive value = "{}"/>\n'
15
16 debutTypeSimpleListe = '\t\t<xs:restriction>\n\t\t\t<xs:simpleType>\n\t\t\t\t<xs:list>\n\t\t\t\t\t<xs:simpleType>\n'
17 finTypeSimpleListe   = '\t\t</xs:restriction>\n\t\t\t</xs:simpleType>\n\t\t\t\t</xs:list>\n\t\t\t\t\t</xs:simpleType>\n'
18 fermeBalisesMileu   = '\t\t\t\t\t\t</xs:restriction>\n\t\t\t\t\t</xs:simpleType>\n\t\t\t\t</xs:list>\n\t\t\t </xs:simpleType>\n'
19
20 maxLengthTypeSimple = '\t\t\t<xs:maxLength value = "{}"/>\n'
21 minLengthTypeSimple = '\t\t\t<xs:minLength value = "{}"/>\n'
22 eltDsSequence       = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
23 eltWithDefautDsSequence    = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}"/>\n'
24 UsingASSDkeyRefDeclaration = '\n\t<xs:keyref name="{}_Name_ref_a{}" refer="{}:Key_Name_For_{}"> \n\t\t<xs:selector xpath="{}"/>\n\t\t<xs:field xpath="."/>\n\t</xs:keyref>\n'
25 #    <xs:key name="Key_Name_For_ElementarySurface">
26 #            <xs:selector xpath="./Vimmp:CDM/Vimmp:Geometric_Domain/Vimmp:Surface"/>
27 #            <xs:field    xpath="./Vimmp:SurfaceName"/>
28 #        </xs:key>
29
30      #<xs:keyref name="MyField_Ref_A_CreateMesh" refer="Test1:Key_Name_In_ReadMesh_CreateMesh">
31      #<xs:selector xpath="./Test1:MyField/Test1:onMesh"/>
32
33
34
35
36 # COMPO
37 debutTypeCompo      = '\t<xs:complexType name="{}" >\n'
38 debutTypeCompoEtape = '\t <xs:complexContent>\n\t  <xs:extension base="T_step_{}">\n'
39 finTypeCompoEtape   = '\t  </xs:extension>\n\t </xs:complexContent>\n'
40 debutTypeCompoSeq   = '\t\t<xs:sequence>\n'
41 finTypeCompoSeq     = '\t\t</xs:sequence>\n'
42 finTypeCompo        = '\t</xs:complexType>\n'
43 eltCompoDsSequence  = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
44 #eltCompoDsSequenceInExtension = '\t\t\t<xs:element name="{}" type="{}:{}"/>\n'
45
46 # ETAPE 
47 eltEtape = '\t<xs:element name="{}" type="{}:{}" substitutionGroup="step_{}"/>\n'
48
49 # BLOC
50 debutTypeSubst    = '\t<xs:group name="{}">   \n\t\t<xs:sequence>\n'
51 finTypeSubst      = '\t\t</xs:sequence>\n\t</xs:group>\n'
52 substDsSequence   = '\t\t\t<xs:group ref="{}:{}"  minOccurs="{}" maxOccurs="{}"/>\n'
53 #choiceDsBloc     = '\t\t\t<xs:choice minOccurs={}>\n'
54 debutChoiceDsBloc = '<xs:choice>\n'
55 debutChoiceDsBlocAvecMin = '<xs:choice minOccurs="{}">\n'
56 finChoiceDsBloc   = '</xs:choice>\n'
57 debSequenceDsBloc = '<xs:sequence>\n'
58 finSequenceDsBloc = '</xs:sequence>\n'
59 debutTypeSubstDsBlocFactorise = '\t<xs:group name="{}">\n'
60 finTypeSubstDsBlocFactorise   = '\t</xs:group>\n'
61 debutUnion        = '\t\t\t<xs:union>\n'
62 finUnion          = '\t\t\t</xs:union>\n'
63
64
65
66 # User OR ASSD
67 operAttributeName    = '\t\t<xs:attribute name="name" type="xs:string"/>\n'
68 attributeTypeForASSD = '\t\t<xs:attribute name="accasType" type="xs:string" fixed="ASSD"/>\n'
69 attributeTypeUtilisateurName = '\t\t<xs:attribute name="typeUtilisateur" type="xs:string" fixed="{}"/>\n'
70 producingASSDkeyRefDeclaration='\t<xs:key name="Key_Name_For_{}">\n\t\t<xs:selector xpath="."/>\n\t\t<xs:field xpath="{}"/>\n\t</xs:key>\n'
71 texteFieldUnitaire="./{}:{}/@name |"
72
73 # CATA
74 debutTypeCata     = '\t<xs:complexType name="T_{}">\n\t\t<xs:choice minOccurs="0" maxOccurs="unbounded">\n'
75 debutTypeCataExtension = '\t<xs:complexType name="T_{}">\n'
76 finTypeCata       = '\t\t</xs:choice>\n\t</xs:complexType>\n'
77 finSchema         = '</xs:schema>'
78 #eltCata           = '\t<xs:element name="{}" type="{}:{}"/>\n'
79 #eltCodeSpecDsCata = '\t\t\t<xs:element ref="{}_Abstract" minOccurs="0" maxOccurs="1"/>\n'
80 #fermeEltCata      = '\t</xs:element>\n'
81 includeCata       = '<xs:include schemaLocation="cata_{}.xsd" />\n\n'
82
83
84 # EXTENSION
85 debutExtension = '\t\t<xs:complexContent>\n\t\t<xs:extension base="{}:T_{}_Abstract">\n\t\t<xs:choice minOccurs="0" maxOccurs="unbounded">\n'
86 finExtension  = '\t\t</xs:choice>\n\t\t</xs:extension>\n\t\t</xs:complexContent>\n'
87
88 # TYPE ABSTRAIT
89 eltAbstraitCataPPal  = '\t<xs:complexType name="T_step_{}" abstract="true"/>\n'
90 eltAbstraitCataFils  = '\t<xs:complexType name="T_step_{}" abstract="true">\n\t\t<xs:complexContent>\n\t\t\t<xs:extension base="{}:T_step_{}"/>\n\t\t</xs:complexContent>\n\t</xs:complexType>\n'
91 eltCataPPal = '\t<xs:element name="step_{}" type="{}:T_step_{}"/>\n'
92 eltCataFils = '\t<xs:element name="step_{}" type="{}:T_step_{}" substitutionGroup="step_{}"/>\n'
93 eltCata = '\t<xs:element name="{}" type="{}:T_{}"/>\n\t\t<xs:complexType name="T_{}">\n\t\t  <xs:choice minOccurs="0" maxOccurs="unbounded">\n\t\t\t<xs:element ref="step_{}" minOccurs="0" maxOccurs="1"/>\n\t\t  </xs:choice>\n\t\t</xs:complexType>\n'
94
95 #\n\t<xs:element name="{}_Abstract" type="{}:T_{}_Abstract"/>\n'
96 #implementeAbstrait  = '\t<xs:element name="{}" type="{}:{}" substitutionGroup="{}:{}_Abstract"/>\n'
97
98 if __name__ == '__main__' :
99     print ('ne fait rien')
100