else :
self.texteComplexe = ""
- self.texteElt=eltCompoDsSequence.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs)
- #print (self.texteComplexe)
+ if self.ang != "" : self.texteElt=eltCompoDsSequenceWithHelp.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs, self.ang)
+ elif self.fr != "" : self.texteElt=eltCompoDsSequenceWithHelp.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs, self.fr)
+ else : self.texteElt=eltCompoDsSequence.format(self.nom,self.nomDuCodeDumpe,self.nomDuTypePyxb,self.minOccurs,self.maxOccurs)
#print ('------------------------------------------------',self.nom)
+ #print (self.texteComplexe)
def traduitMinMax(self):
# ______________________
if not multiple :
#print ('je passe la pas multiple')
if self.defaut :
- if self.max > 1 or self.max == '**' or self.max == float('inf') :
- # a revoir pour les tuples avec defaut
+ if self.max > 1 or self.max == '**' or self.max == float('inf') :
txtDefaut=""
+ if not('TXM' in (self.type)) : separe = ' '
+ else : separe ='\n'
for val in self.defaut :
- #val2=val.replace(' ','\\u0020')
- txtDefaut+=str(val) + " "
+ txtDefaut+=str(val) + separe
txtDefaut+=txtDefaut[0:-1]
- self.texteElt = eltWithDefautDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
+ if not('TXM' in (self.type)) :
+ # a revoir pour les tuples avec defaut
+ if self.ang != '' : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.ang)
+ elif self.fr != '' : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.fr)
+ else : self.texteElt = eltDsSequenceWithDefaut.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
+ else :
+ if self.ang != '' : texteAide = self.ang
+ else : texteAide = self.fr
+ texteAide :texteAide = texteAide+'\ndefault Value in MDM : \n'+txtDefaut
+ self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,texteAide)
else :
if str(self.defaut) == 'True' : txtDefaut = 'true'
elif str(self.defaut) == 'False' : txtDefaut = 'false'
else : txtDefaut = str(self.defaut)
- if self.ang != '' : self.texteElt = eltWithDefautAndHelpDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.ang)
- elif self.fr != '' : self.texteElt = eltWithDefautAndHelpDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.fr)
- else : self.texteElt = eltWithDefautDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
+ if self.ang != '' : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.ang)
+ elif self.fr != '' : self.texteElt = eltDsSequenceWithDefautAndHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut,self.fr)
+ else : self.texteElt = eltDsSequenceWithDefaut.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,txtDefaut)
else :
- if self.ang != '' : self.texteElt = eltWithHelpDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.ang)
- elif self.fr != '' : self.texteElt = eltWithHelpDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.fr)
+ if self.ang != '' : self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.ang)
+ elif self.fr != '' : self.texteElt = eltDsSequenceWithHelp.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.fr)
else : self.texteElt = eltDsSequence.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,1,self.ang)
elif first:
# PNPN --> Que faire de l'aide ?
if self.implement == self.code :
self.texteCata += eltAbstraitCataPPal.format(self.code)
- self.texteCata += eltCataPPal.format(self.code,self.code,self.code)
+ #if self.ang != '' : self.texteCataWithHelp += eltCataPPal.format(self.code,self.code,self.code, self.ang)
+ #elif self.fr != '' : self.texteCataWithHelp += eltCataPPal.format(self.code,self.code,self.code, self.fr)
+ if 0 : pass
+ else : self.texteCata += eltCataPPal.format(self.code,self.code,self.code)
else :
self.texteCata += eltAbstraitCataFils.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere)
- self.texteCata += eltCataFils.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere,self.nomDuXsdPere)
+ #if self.ang != '' : self.texteCata += eltCataFilsWithHelp.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere,self.nomDuXsdPere)
+ #elif self.fr != '' : self.texteCata += eltCataFilsWithHelp.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere,self.nomDuXsdPere)
+ if 0 : pass
+ else : self.texteCata += eltCataFils.format(self.implement,self.nomDuXsdPere,self.nomDuXsdPere,self.nomDuXsdPere)
self.texteInclusion += includeCata.format(self.nomDuXsdPere)
self.texteCata += eltCata.format(self.implement,self.implement,self.implement,self.implement,self.nomDuXsdPere)
self.texteSimple += c.texteSimple
self.texteComplexe += c.texteComplexe
- #c.texteElt=eltCompoDsSequenceInExtension.format(c.nom,self.code,c.nomDuTypePyxb)
- c.texteElt=eltEtape.format(c.nom,self.implement,c.nomDuTypePyxb,self.implement)
+ if c.ang != '' : c.texteElt = eltEtapeWithHelp.format(c.nom,self.implement,c.nomDuTypePyxb,self.implement,c.ang)
+ elif c.fr != '' : c.texteElt = eltEtapeWithHelp.format(c.nom,self.implement,c.nomDuTypePyxb,self.implement,c.fr)
+ else : c.texteElt = eltEtape.format(c.nom,self.implement,c.nomDuTypePyxb,self.implement)
self.texteCata += c.texteElt
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'
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'
-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'
-
-maxLengthTypeSimple = '\t\t\t<xs:maxLength value = "{}"/>\n'
-minLengthTypeSimple = '\t\t\t<xs:minLength value = "{}"/>\n'
-eltDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
-eltWithHelpDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
-eltWithDefautAndHelpDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
-eltWithDefautDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}"/>\n'
+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'
+
+maxLengthTypeSimple = '\t\t\t<xs:maxLength value = "{}"/>\n'
+minLengthTypeSimple = '\t\t\t<xs:minLength value = "{}"/>\n'
+eltDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
+eltDsSequenceWithHelp = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
+eltDsSequenceWithDefautAndHelp = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
+eltDsSequenceWithDefaut = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}" default="{}"/>\n'
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'
# <xs:key name="Key_Name_For_ElementarySurface">
# <xs:selector xpath="./Vimmp:CDM/Vimmp:Geometric_Domain/Vimmp:Surface"/>
finTypeCompoSeq = '\t\t</xs:sequence>\n'
finTypeCompo = '\t</xs:complexType>\n'
eltCompoDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
-eltCompoWithHelpDsSequence = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
+eltCompoDsSequenceWithHelp = '\t\t\t<xs:element name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}"/>\n'
#name="{}" type="{}:{}" minOccurs="{}" maxOccurs="{}">\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
#eltCompoDsSequenceInExtension = '\t\t\t<xs:element name="{}" type="{}:{}"/>\n'
# ETAPE
eltEtape = '\t<xs:element name="{}" type="{}:{}" substitutionGroup="step_{}"/>\n'
+eltEtapeWithHelp = '\t<xs:element name="{}" type="{}:{}" substitutionGroup="step_{}"/>\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
# BLOC
debutTypeSubst = '\t<xs:group name="{}"> \n\t\t<xs:sequence>\n'
eltAbstraitCataPPal = '\t<xs:complexType name="T_step_{}" abstract="true"/>\n'
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'
eltCataPPal = '\t<xs:element name="step_{}" type="{}:T_step_{}"/>\n'
+eltCataPPalWithHelp = '\t<xs:element name="step_{}" type="{}:T_step_{}"/>\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
eltCataFils = '\t<xs:element name="step_{}" type="{}:T_step_{}" substitutionGroup="step_{}"/>\n'
+eltCataFilsWithHelp = '\t<xs:element name="step_{}" type="{}:T_step_{}" substitutionGroup="step_{}"/>\n\t\t\t\t<xs:annotation>\n\t\t\t\t\t<xs:documentation>{}</xs:documentation>\n\t\t\t\t</xs:annotation>\n\t\t\t</xs:element>\n'
+
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'
#\n\t<xs:element name="{}_Abstract" type="{}:T_{}_Abstract"/>\n'