From 0aedf53b6bf7272aea4d37c9056cf732ccaf08b1 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 2 Jun 2009 11:53:48 +0000 Subject: [PATCH] 2847: Trying to import an older Gramps DB fails, delayed commit like rev 12575 svn: r12609 --- src/plugins/import/ImportXml.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugins/import/ImportXml.py b/src/plugins/import/ImportXml.py index f539f13ae..68cbdc89a 100644 --- a/src/plugins/import/ImportXml.py +++ b/src/plugins/import/ImportXml.py @@ -2401,12 +2401,15 @@ class VersionParser(object): def __element_handler(self, tag, attrs): " Handle XML elements " if tag == "database" and 'xmlns' in attrs: - xmlns = attrs.get('xmlns') - try: - self.__xml_version = xmlns.split('/')[4] - except: - #leave version at 1.0.0 - pass + xmlns = attrs.get('xmlns').split('/') + if len(xmlns)>= 2 and not xmlns[2] == 'gramps-project.org': + self.__xml_version = '0.0.0' + else: + try: + self.__xml_version = xmlns[4] + except: + #leave version at 1.0.0 although it could be 0.0.0 ?? + pass elif tag == "database" and not 'xmlns' in attrs: #1.0 or before xml, no dtd schema yet on # http://www.gramps-project.org/xml/