2847: Trying to import an older Gramps DB fails, delayed commit like rev 12575

svn: r12609
This commit is contained in:
Benny Malengier 2009-06-02 11:53:48 +00:00
parent 4ca984bd2f
commit 0aedf53b6b

View File

@ -2401,12 +2401,15 @@ class VersionParser(object):
def __element_handler(self, tag, attrs): def __element_handler(self, tag, attrs):
" Handle XML elements " " Handle XML elements "
if tag == "database" and 'xmlns' in attrs: if tag == "database" and 'xmlns' in attrs:
xmlns = attrs.get('xmlns') xmlns = attrs.get('xmlns').split('/')
try: if len(xmlns)>= 2 and not xmlns[2] == 'gramps-project.org':
self.__xml_version = xmlns.split('/')[4] self.__xml_version = '0.0.0'
except: else:
#leave version at 1.0.0 try:
pass 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: elif tag == "database" and not 'xmlns' in attrs:
#1.0 or before xml, no dtd schema yet on #1.0 or before xml, no dtd schema yet on
# http://www.gramps-project.org/xml/ # http://www.gramps-project.org/xml/