xmlclass/xmlclass.py
changeset 1179 3e7bd88fcff7
parent 1124 b1705000eba1
child 1290 13ee5f4ab612
--- a/xmlclass/xmlclass.py	Tue May 28 10:03:41 2013 +0200
+++ b/xmlclass/xmlclass.py	Tue May 28 17:52:07 2013 +0200
@@ -1598,14 +1598,14 @@
         if path is not None:
             parts = path.split(".", 1)
             if attributes.has_key(parts[0]):
-                if len(parts) != 0:
+                if len(parts) != 1:
                     raise ValueError("Wrong path!")
                 attr_type = gettypeinfos(attributes[parts[0]]["attr_type"]["basename"], 
                                          attributes[parts[0]]["attr_type"]["facets"])
                 value = getattr(self, parts[0], "")
             elif elements.has_key(parts[0]):
                 if elements[parts[0]]["elmt_type"]["type"] == SIMPLETYPE:
-                    if len(parts) != 0:
+                    if len(parts) != 1:
                         raise ValueError("Wrong path!")
                     attr_type = gettypeinfos(elements[parts[0]]["elmt_type"]["basename"], 
                                              elements[parts[0]]["elmt_type"]["facets"])
@@ -1620,6 +1620,11 @@
                         return attr.getElementInfos(parts[0])
                     else:
                         return attr.getElementInfos(parts[0], parts[1])
+            elif elements.has_key("content"):
+                if len(parts) > 0:
+                    return self.content["value"].getElementInfos(name, path)
+            elif classinfos.has_key("base"):
+                classinfos["base"].getElementInfos(name, path)
             else:
                 raise ValueError("Wrong path!")
         else: