xmlclass/xmlclass.py
changeset 594 41e62b3174dc
parent 593 34c3569042db
child 601 32c0f4a626db
equal deleted inserted replaced
593:34c3569042db 594:41e62b3174dc
  1400             structure_pattern = self.getStructure()
  1400             structure_pattern = self.getStructure()
  1401             if structure_pattern != "":
  1401             if structure_pattern != "":
  1402                 structure_model = re.compile("(%s)$" % structure_pattern)
  1402                 structure_model = re.compile("(%s)$" % structure_pattern)
  1403                 result = structure_model.match(children_structure)
  1403                 result = structure_model.match(children_structure)
  1404                 if not result:
  1404                 if not result:
  1405                     print structure_model.pattern, children_structure
       
  1406                     raise ValueError("Invalid structure for \"%s\" children!." % tree.nodeName)
  1405                     raise ValueError("Invalid structure for \"%s\" children!." % tree.nodeName)
  1407         required_attributes = dict([(attr["name"], True) for attr in classinfos["attributes"] if attr["use"] == "required"])
  1406         required_attributes = dict([(attr["name"], True) for attr in classinfos["attributes"] if attr["use"] == "required"])
  1408         if classinfos.has_key("base"):
  1407         if classinfos.has_key("base"):
  1409             extras.extend([attr["name"] for attr in classinfos["attributes"] if attr["use"] != "prohibited"])
  1408             extras.extend([attr["name"] for attr in classinfos["attributes"] if attr["use"] != "prohibited"])
  1410             classinfos["base"].loadXMLTree(self, tree, extras, True)
  1409             classinfos["base"].loadXMLTree(self, tree, extras, True)