E5XML/XMLStreamReaderBase.py

changeset 589
a9a4620f6767
parent 578
a0ecb2c68208
child 590
beb60b9b3d8d
--- a/E5XML/XMLStreamReaderBase.py	Sat Sep 11 19:00:10 2010 +0200
+++ b/E5XML/XMLStreamReaderBase.py	Sat Sep 11 19:00:54 2010 +0200
@@ -44,12 +44,20 @@
         if self.hasError():
             msg = QCoreApplication.translate("XMLStreamReaderBase",
                 "<p>XML parse error in file <b>{0}</b>, line {1}, column {2}<p>"
-                "<p>Error: {3}").format(self.device.fileName(), 
+                "<p>Error: {3}").format(self.device().fileName(), 
                     self.lineNumber(), self.columnNumber(), self.errorString())
             E5MessageBox.warning(None,
-                self.trUtf8("XML parse error"),
-                self.trUtf8(msg))
+                QCoreApplication.translate("XMLStreamReaderBase", "XML parse error"),
+                msg)
+    
+    def raiseUnexpectedStartTag(self, tag):
+        """
+        Public method to raise an error for an unexpected start tag.
         
+        @param tag name of the unexpected tag (string)
+        """
+        self.raiseError(QCoreApplication.translate("XMLStreamReaderBase",
+            "Unexpected start tag '{0}'.".format(tag)))
     
     def readXML(self):
         """

eric ide

mercurial