diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index c3b97ce62..41ee1df26 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -33,6 +33,8 @@ * src/DisplayTabs.py: remove property button stuff 2006-04-18 Alex Roitman + * data/grampsxml.dtd: Update. + * data/grampsxml.rng: Update. * src/GrampsDb/_ReadXML.py: Parse old and new XML. * src/GrampsDb/_WriteXML.py (dump_child_ref, dump_person_ref): Add methods. diff --git a/gramps2/data/grampsxml.dtd b/gramps2/data/grampsxml.dtd index 45bc78046..67d0d0948 100644 --- a/gramps2/data/grampsxml.dtd +++ b/gramps2/data/grampsxml.dtd @@ -93,7 +93,7 @@ PEOPLE + childof*, parentin*, personref*, note?, sourceref*)> - + + + @@ -159,7 +163,7 @@ FAMILY + objref*,childref*,attribute*,note?,sourceref*)> - - + + diff --git a/gramps2/data/grampsxml.rng b/gramps2/data/grampsxml.rng index 75ebc771f..4817769ca 100644 --- a/gramps2/data/grampsxml.rng +++ b/gramps2/data/grampsxml.rng @@ -153,16 +153,17 @@ - - - - - - + + + + + + + @@ -287,8 +288,17 @@ - + + + + + + + + + + diff --git a/gramps2/src/GrampsDb/_ReadXML.py b/gramps2/src/GrampsDb/_ReadXML.py index 7c118725b..37ab0c6ca 100644 --- a/gramps2/src/GrampsDb/_ReadXML.py +++ b/gramps2/src/GrampsDb/_ReadXML.py @@ -956,14 +956,13 @@ class GrampsParser: mrel = RelLib.ChildRefType().set_from_xml_str(attrs.get('mrel')) frel = RelLib.ChildRefType().set_from_xml_str(attrs.get('frel')) - # Only need to worry about this if there are non-default rels - # Otherwise, if both are default, the family's child tag will do - if not ( mrel.is_default() and frel.is_default() ): - childref = RelLib.ChildRef() - childref.ref = self.person.handle + childref = RelLib.ChildRef() + childref.ref = self.person.handle + if not mrel.is_default(): childref.set_mother_relation(mrel) + if not frel.is_default(): childref.set_father_relation(frel) - self.childref_map[(handle,self.person.handle)] = childref + self.childref_map[(handle,self.person.handle)] = childref self.person.add_parent_family_handle(handle) def start_parentin(self,attrs): @@ -979,8 +978,6 @@ class GrampsParser: if not self.in_witness: self.name = RelLib.Name() self.name.type.set_from_xml_str(attrs.get('type')) -## (_ConstXML.tuple_from_xml( -## _ConstXML.name_types,attrs.get('type','Birth Name'))) self.name.sort_as = int(attrs.get("sort",RelLib.Name.DEF)) self.name.display_as = int(attrs.get("display",RelLib.Name.DEF)) self.name.conf = int(attrs.get("conf",2)) diff --git a/gramps2/src/GrampsDb/_WriteXML.py b/gramps2/src/GrampsDb/_WriteXML.py index b9b0b597c..f92a48bae 100644 --- a/gramps2/src/GrampsDb/_WriteXML.py +++ b/gramps2/src/GrampsDb/_WriteXML.py @@ -535,10 +535,10 @@ class XmlWriter: sreflist = childref.get_source_references() if (len(sreflist) == 0) and childref.get_note() =="": self.write_ref('childref',childref.ref,index,close=True, - extra_text=priv_text+frel_text+mrel_text) + extra_text=priv_text+mrel_text+frel_text) else: self.write_ref('childref',childref.ref,index,close=False, - extra_text=priv_text+frel_text+mrel_text) + extra_text=priv_text+mrel_text+frel_text) for sref in sreflist: self.dump_source_ref(sref,index+1) self.write_note("note",childref.get_note_object(),index+1) @@ -759,8 +759,7 @@ class XmlWriter: def dump_name(self,name,alternative=False,index=1): sp = " "*index - name_type = _ConstXML.str_for_xml(_ConstXML.name_types, - name.get_type()) + name_type = name.get_type().xml_str() self.g.write('%s