From 3575f63cbdec2ede35e9188add0c37b09f16bf26 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Wed, 9 Oct 2013 16:20:00 +0000 Subject: [PATCH] 7102: XML: Gramps does not export 'very low' value (0) for confidence into citation svn: r23289 --- gramps/plugins/export/exportxml.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gramps/plugins/export/exportxml.py b/gramps/plugins/export/exportxml.py index eeda3e15f..acb550ba1 100644 --- a/gramps/plugins/export/exportxml.py +++ b/gramps/plugins/export/exportxml.py @@ -580,7 +580,8 @@ class GrampsXmlWriter(UpdateCallback): self.write_primary_tag("citation", citation, index) self.write_date(citation.get_date_object(), index+1) self.write_line("page", citation.get_page(), index+1) - self.write_line("confidence", citation.get_confidence_level(), index+1) + self.write_line_always("confidence", + citation.get_confidence_level(), index+1) self.write_note_list(citation.get_note_list(), index+1) self.write_media_list(citation.get_media_list(), index+1) self.write_srcattribute_list(citation.get_attribute_list(), index+1) @@ -846,13 +847,18 @@ class GrampsXmlWriter(UpdateCallback): def write_line_nofix(self,tagname,value,indent=1): """Writes a line, but does not escape characters. - Use this instead of write_line is the value is already fixed, + Use this instead of write_line if the value is already fixed, this avoids & becoming &amp; """ if value: self.g.write('%s<%s>%s\n' % (' '*indent, tagname, value, tagname)) + def write_line_always(self,tagname,value,indent=1): + """Writes a line, always, even with a zero value.""" + self.g.write('%s<%s>%s\n' % + (' '*indent,tagname,self.fix(value),tagname)) + def get_iso_date(self,date): if date[2] == 0: y = "????"