diff --git a/gramps/src/ReadXML.py b/gramps/src/ReadXML.py
index 1704a853b..d41b01e50 100644
--- a/gramps/src/ReadXML.py
+++ b/gramps/src/ReadXML.py
@@ -141,10 +141,12 @@ def loadData(database, filename, callback):
try:
parser.parse(xml_file)
- except SAXParseException:
- GnomeErrorDialog(_("%s is a corrupt file") % filename)
- import traceback
- traceback.print_exc()
+ except SAXParseException,msg:
+ line = string.split(str(msg),':')
+ filemsg = _("%s is a corrupt file.") % filename
+ errtype = string.strip(line[3])
+ errmsg = _('A "%s" error on line %s was detected.') % (errtype,line[1])
+ GnomeErrorDialog("%s\n%s" % (filemsg,errmsg))
return 0
except IOError,msg:
GnomeErrorDialog(_("Error reading %s") % filename + "\n" + str(msg))
diff --git a/gramps/src/WriteXML.py b/gramps/src/WriteXML.py
index e90a7658d..294d50d94 100644
--- a/gramps/src/WriteXML.py
+++ b/gramps/src/WriteXML.py
@@ -453,9 +453,9 @@ def exportData(database, filename, callback):
country = fix(loc.get_country())
county = fix(loc.get_county())
if city or state or country or county:
- g.write(' \n' % country)
+ g.write(' \n' % country)
for loc in place.get_alternate_locations():
city = fix(loc.get_city())
state = fix(loc.get_state())
@@ -463,8 +463,8 @@ def exportData(database, filename, callback):
county = fix(loc.get_county())
if city or state or country or county:
g.write(' \n' \
- % (city,county,state,country))
+ g.write(' city="%s" county="%s"' % (city,county))
+ g.write(' state="%s" country="%s"/>\n' % (state,country))
for photo in place.getPhotoList():
path = photo.getPath()
l = len(fileroot)