From e573e180a0d0f55f4999a0cdcc7e35539f57f849 Mon Sep 17 00:00:00 2001 From: PASCALE NOYRET Date: Mon, 30 May 2022 14:30:38 +0200 Subject: [PATCH] chgt pour liste de Tuple vide -- a tester --- Efi2Xsd/AccasXsd.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Efi2Xsd/AccasXsd.py b/Efi2Xsd/AccasXsd.py index cb073c85..55cff097 100755 --- a/Efi2Xsd/AccasXsd.py +++ b/Efi2Xsd/AccasXsd.py @@ -1202,6 +1202,8 @@ class X_SIMP (X_definition): if self.defaut : print ('il faut tester le defaut') if self.max == '**' or self.max == float('inf') : max='unbounded' else : max = self.max + # dans ce cas, le max est porte par la sequence + if self.min==0 : max = 1 self.texteElt = tupleNonHomogeneElt.format(self.nom,self.code,self.nomDuTypePyxb,minOccurs,max) leType=self.nomDuTypeDeBase[0] for leTypeComp in self.nomDuTypeDeBase[1:] : @@ -1227,14 +1229,19 @@ class X_SIMP (X_definition): # self.texteSimple += fermeSimpleType # return + #else : self.texteSimple = '' self.texteSimple = '' - complexeTypeTuple = tupleDebutComplexeType.format(self.nomDuTypePyxb) + if self.max == '**' or self.max == float('inf') : max='unbounded' + else : max = self.max + if self.min==0 : complexeTypeTuple = tupleDebutComplexeTypeMinZero.format(self.nomDuTypePyxb,max) + else : complexeTypeTuple = tupleDebutComplexeType.format(self.nomDuTypePyxb) num = 1 for leType in self.nomDuTypeDeBase : self.texteSimple += tupleNonHomogeneSimpleType.format(self.nomDuTypePyxb,str(num),leType) complexeTypeTuple += tupleMilieuComplexeType.format(str(num),self.nomDuTypePyxb,str(num)) num = num + 1 - complexeTypeTuple += tupleFinComplexeType + if self.min == 0 : complexeTypeTuple += tupleFinComplexeTypeMinZero + else : complexeTypeTuple += tupleFinComplexeType self.texteSimple += complexeTypeTuple -- 2.39.2