E5XML/XMLStreamReaderBase.py

changeset 578
a0ecb2c68208
parent 577
ef42a81128ca
child 589
a9a4620f6767
diff -r ef42a81128ca -r a0ecb2c68208 E5XML/XMLStreamReaderBase.py
--- a/E5XML/XMLStreamReaderBase.py	Thu Sep 09 19:52:19 2010 +0200
+++ b/E5XML/XMLStreamReaderBase.py	Fri Sep 10 08:10:15 2010 +0200
@@ -51,6 +51,24 @@
                 self.trUtf8(msg))
         
     
+    def readXML(self):
+        """
+        Public method to read and parse the XML document.
+        """
+        pass
+    
+    def attribute(self, name, default = ""):
+        """
+        Public method to read the given attribute of the current tag.
+        
+        @param name name of the attribute (string)
+        @param default default value (string)
+        """
+        att = self.attributes().value(name)
+        if att == "":
+            att = default
+        return att
+    
     def _skipUnknownElement(self):
         """
         Protected method to skip over all unknown elements.
@@ -117,7 +135,7 @@
                         val = self.__readFrozenset()
                         return val
                     elif self.name() == "pickle":
-                        encoding = self.attributes().value("encoding")
+                        encoding = self.attribute("encoding")
                         if encoding != "base64":
                             self.raiseError(QCoreApplication.translate(
                                 "XMLStreamReaderBase", 

eric ide

mercurial