diff --git a/ChangeLog b/ChangeLog index e7a200f81..b23196280 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ 2007-02-20 Alex Roitman + * src/GrampsDb/_GrampsDbWriteXML.py (write_xml_data): Place notes + at the end. * src/GrampsDbUtils/_ReadXML.py (start_noteref): Add method; (__init__): Use new method. diff --git a/src/GrampsDb/_GrampsDbWriteXML.py b/src/GrampsDb/_GrampsDbWriteXML.py index 7be3ca103..f0059f883 100644 --- a/src/GrampsDb/_GrampsDbWriteXML.py +++ b/src/GrampsDb/_GrampsDbWriteXML.py @@ -252,16 +252,6 @@ class GrampsDbXmlWriter(object): # by the time we get to person's names self.write_name_formats() - if note_len > 0: - self.g.write(" \n") - sorted_keys = self.db.get_gramps_ids(NOTE_KEY) - sorted_keys.sort() - for gramps_id in sorted_keys: - note = self.db.get_note_from_gramps_id(gramps_id) - self.write_note(note,2) - self.status.heartbeat() - self.g.write(" \n") - if event_len > 0: self.g.write(" \n") sorted_keys = self.db.get_gramps_ids(EVENT_KEY) @@ -339,6 +329,16 @@ class GrampsDbXmlWriter(object): self.status.heartbeat() self.g.write(" \n") + if note_len > 0: + self.g.write(" \n") + sorted_keys = self.db.get_gramps_ids(NOTE_KEY) + sorted_keys.sort() + for gramps_id in sorted_keys: + note = self.db.get_note_from_gramps_id(gramps_id) + self.write_note(note,2) + self.status.heartbeat() + self.g.write(" \n") + # Data is written, now write bookmarks. self.write_bookmarks() diff --git a/src/GrampsDbUtils/_ReadXML.py b/src/GrampsDbUtils/_ReadXML.py index 6a6e7a48f..7ad168885 100644 --- a/src/GrampsDbUtils/_ReadXML.py +++ b/src/GrampsDbUtils/_ReadXML.py @@ -1134,7 +1134,9 @@ class GrampsParser(UpdateCallback): handle = attrs['hlink'].replace('_','') self.db.check_note_from_handle(handle,self.trans) - if self.address: + if self.source_ref: + self.source_ref.add_note(handle) + elif self.address: self.address.add_note(handle) elif self.ord: self.ord.add_note(handle)