1 texteDebut='<?xml version="1.0" encoding="UTF-8"?>\n<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:{}="http://chercheurs.edf.com/logiciels/{}" targetNamespace="http://chercheurs.edf.com/logiciels/{}" elementFormDefault="qualified" attributeFormDefault="qualified"\n>'
5 typeSimple = '\t<simpleType name="{}">\n\t\t<restriction base="{}"/>\n\t</simpleType>\n'
6 debutTypeSimpleWithInto = '\t<simpleType name="{}">\n\t\t<restriction base="{}">\n'
7 typeSimpleWithInto = '\t\t\t<enumeration value="{}"/>\n'
8 finTypeSimpleWithInto = '\t\t</restriction>\n\t</simpleType>\n'
9 eltDsSequence = '\t\t\t<element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
12 debutTypeCompo = '\t<complexType name="{}" >\n\t\t<sequence minOccurs="{}" maxOccurs="{}">\n'
13 finTypeCompo = '\t\t</sequence>\n\t</complexType>\n'
14 eltCompoDsSequence = '\t\t\t<element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
15 eltCompoDsSequenceSiProc = '\t\t\t<element name="{}" type="{}:{}" />\n'
18 debutTypeSubst = '\t<group name="{}"> \n\t\t<sequence>\n'
19 finTypeSubst = '\t\t</sequence>\n\t</group>\n'
20 substDsSequence = '\t\t\t<group ref="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
24 debutTypeCata = '\t<complexType name="{}">\n\t\t<choice minOccurs="0" maxOccurs="unbounded">\n'
25 finTypeCata = '\t\t</choice>\n\t</complexType> '
26 eltCata = '\t<element name="{}" type="{}:{}"/>\n'
29 if __name__ == '__main__' :
33 nomDuComplexe='T_Complexe'
38 texteSimple=typeSimple.format(nomDuType, nomDuTypeBase)
39 texteElt=eltDsSequence.format(nomElt,nomDuCode,nomDuType,minOccurs,maxOccurs)
42 texteComplexe=debutTypeComplexe.format(nomDuComplexe)
43 texteComplexe+=texteElt
44 texteComplexe+=finTypeComplexe
45 texteEltComplexe=eltDsSequence.format(nomElt,nomDuCode,nomDuType,minOccurs,maxOccurs)
47 texteCata=debutTypeCata.format(nomDuCode)
48 texteCata+=texteEltComplexe
49 texteCata+=finTypeCata
51 eltRacine=eltCata.format(nomDuCode, 'T_'+nomDuCode)
52 print (texteSimple+texteComplexe+texteCata+eltRacine)