xmlclass/xmlclass.py
changeset 616 8a60ffcfd70b
parent 607 9c133d675b69
child 626 ac0a8f6462c3
equal deleted inserted replaced
615:8baeb9dff775 616:8a60ffcfd70b
  1406             structure_pattern = self.getStructure()
  1406             structure_pattern = self.getStructure()
  1407             if structure_pattern != "":
  1407             if structure_pattern != "":
  1408                 structure_model = re.compile("(%s)$" % structure_pattern)
  1408                 structure_model = re.compile("(%s)$" % structure_pattern)
  1409                 result = structure_model.match(children_structure)
  1409                 result = structure_model.match(children_structure)
  1410                 if not result:
  1410                 if not result:
  1411                     print children_structure, structure_model.pattern
       
  1412                     raise ValueError("Invalid structure for \"%s\" children!." % tree.nodeName)
  1411                     raise ValueError("Invalid structure for \"%s\" children!." % tree.nodeName)
  1413         required_attributes = dict([(attr["name"], True) for attr in classinfos["attributes"] if attr["use"] == "required"])
  1412         required_attributes = dict([(attr["name"], True) for attr in classinfos["attributes"] if attr["use"] == "required"])
  1414         if classinfos.has_key("base"):
  1413         if classinfos.has_key("base"):
  1415             extras.extend([attr["name"] for attr in classinfos["attributes"] if attr["use"] != "prohibited"])
  1414             extras.extend([attr["name"] for attr in classinfos["attributes"] if attr["use"] != "prohibited"])
  1416             classinfos["base"].loadXMLTree(self, tree, extras, True)
  1415             classinfos["base"].loadXMLTree(self, tree, extras, True)