xmlclass/xsdschema.py
changeset 1767 c74815729afd
parent 1765 ccf59c1f0b45
child 1768 691083b5682a
equal deleted inserted replaced
1766:c1e5b9f19483 1767:c74815729afd
   586 
   586 
   587     basetypeinfos = factory.FindSchemaElement(simpleContent["base"])
   587     basetypeinfos = factory.FindSchemaElement(simpleContent["base"])
   588     if basetypeinfos["type"] == SIMPLETYPE:
   588     if basetypeinfos["type"] == SIMPLETYPE:
   589         contenttypeinfos = simpleContent.copy()
   589         contenttypeinfos = simpleContent.copy()
   590         simpleContent.pop("base")
   590         simpleContent.pop("base")
   591     elif basetypeinfos["type"] == COMPLEXTYPE and \
   591     elif (basetypeinfos["type"] == COMPLEXTYPE and
   592          len(basetypeinfos["elements"]) == 1 and \
   592           len(basetypeinfos["elements"]) == 1 and
   593          basetypeinfos["elements"][0]["name"] == "content" and \
   593           basetypeinfos["elements"][0]["name"] == "content" and
   594          "elmt_type" in basetypeinfos["elements"][0] and \
   594           "elmt_type" in basetypeinfos["elements"][0] and
   595          basetypeinfos["elements"][0]["elmt_type"]["type"] == SIMPLETYPE:
   595           basetypeinfos["elements"][0]["elmt_type"]["type"] == SIMPLETYPE):
   596         contenttypeinfos = simpleContent.copy()
   596         contenttypeinfos = simpleContent.copy()
   597         contenttypeinfos["base"] = basetypeinfos["elements"][0]["elmt_type"]
   597         contenttypeinfos["base"] = basetypeinfos["elements"][0]["elmt_type"]
   598     else:
   598     else:
   599         raise ValueError("No compatible base type defined for simpleContent!")
   599         raise ValueError("No compatible base type defined for simpleContent!")
   600     contenttypeinfos = CreateSimpleType(factory, attributes, contenttypeinfos)
   600     contenttypeinfos = CreateSimpleType(factory, attributes, contenttypeinfos)