* data/grampsxml.dtd: Update.
* data/grampsxml.rng: Update. svn: r6366
This commit is contained in:
parent
f6d8887f35
commit
ca5e698290
@ -33,6 +33,8 @@
|
|||||||
* src/DisplayTabs.py: remove property button stuff
|
* src/DisplayTabs.py: remove property button stuff
|
||||||
|
|
||||||
2006-04-18 Alex Roitman <shura@gramps-project.org>
|
2006-04-18 Alex Roitman <shura@gramps-project.org>
|
||||||
|
* data/grampsxml.dtd: Update.
|
||||||
|
* data/grampsxml.rng: Update.
|
||||||
* src/GrampsDb/_ReadXML.py: Parse old and new XML.
|
* src/GrampsDb/_ReadXML.py: Parse old and new XML.
|
||||||
* src/GrampsDb/_WriteXML.py (dump_child_ref, dump_person_ref): Add
|
* src/GrampsDb/_WriteXML.py (dump_child_ref, dump_person_ref): Add
|
||||||
methods.
|
methods.
|
||||||
|
@ -93,7 +93,7 @@ PEOPLE
|
|||||||
|
|
||||||
<!ELEMENT person (gender, name*, nick?, eventref*, lds_ord*,
|
<!ELEMENT person (gender, name*, nick?, eventref*, lds_ord*,
|
||||||
objref*, address*, attribute*, url*,
|
objref*, address*, attribute*, url*,
|
||||||
childof*, parentin*, note?, sourceref*)>
|
childof*, parentin*, personref*, note?, sourceref*)>
|
||||||
<!ATTLIST person
|
<!ATTLIST person
|
||||||
id CDATA #REQUIRED
|
id CDATA #REQUIRED
|
||||||
handle ID #REQUIRED
|
handle ID #REQUIRED
|
||||||
@ -130,15 +130,19 @@ GENDER has values of M, F, or U.
|
|||||||
<!ELEMENT nick (#PCDATA)>
|
<!ELEMENT nick (#PCDATA)>
|
||||||
|
|
||||||
<!ELEMENT childof EMPTY>
|
<!ELEMENT childof EMPTY>
|
||||||
<!ATTLIST childof
|
<!ATTLIST childof hlink IDREF #REQUIRED
|
||||||
hlink IDREF #REQUIRED
|
|
||||||
mrel (None|Birth|Adopted|Stepchild|Sponsored|Foster|Other|Unknown) #IMPLIED
|
|
||||||
frel (None|Birth|Adopted|Stepchild|Sponsored|Foster|Other|Unknown) #IMPLIED
|
|
||||||
>
|
>
|
||||||
|
|
||||||
<!ELEMENT parentin EMPTY>
|
<!ELEMENT parentin EMPTY>
|
||||||
<!ATTLIST parentin hlink IDREF #REQUIRED>
|
<!ATTLIST parentin hlink IDREF #REQUIRED>
|
||||||
|
|
||||||
|
<!ELEMENT personref (sourceref*,note?)>
|
||||||
|
<!ATTLIST personref
|
||||||
|
hlink IDREF #REQUIRED
|
||||||
|
priv (0|1) #IMPLIED
|
||||||
|
rel CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
<!ELEMENT address ((daterange|dateval|datestr)?,street?,city?,state?,
|
<!ELEMENT address ((daterange|dateval|datestr)?,street?,city?,state?,
|
||||||
country?,postal?,phone?,note?,sourceref?)>
|
country?,postal?,phone?,note?,sourceref?)>
|
||||||
<!ATTLIST address priv (0|1) #IMPLIED>
|
<!ATTLIST address priv (0|1) #IMPLIED>
|
||||||
@ -159,7 +163,7 @@ FAMILY
|
|||||||
<!ELEMENT families (family)*>
|
<!ELEMENT families (family)*>
|
||||||
|
|
||||||
<!ELEMENT family (rel?,father?,mother?,eventref*,lds_ord*,
|
<!ELEMENT family (rel?,father?,mother?,eventref*,lds_ord*,
|
||||||
objref*,child*,attribute*,note?,sourceref*)>
|
objref*,childref*,attribute*,note?,sourceref*)>
|
||||||
<!ATTLIST family
|
<!ATTLIST family
|
||||||
id CDATA #REQUIRED
|
id CDATA #REQUIRED
|
||||||
handle ID #REQUIRED
|
handle ID #REQUIRED
|
||||||
@ -174,8 +178,13 @@ FAMILY
|
|||||||
<!ELEMENT mother EMPTY>
|
<!ELEMENT mother EMPTY>
|
||||||
<!ATTLIST mother hlink IDREF #REQUIRED>
|
<!ATTLIST mother hlink IDREF #REQUIRED>
|
||||||
|
|
||||||
<!ELEMENT child EMPTY>
|
<!ELEMENT childref (sourceref*,note?)>
|
||||||
<!ATTLIST child hlink IDREF #REQUIRED>
|
<!ATTLIST childref
|
||||||
|
hlink IDREF #REQUIRED
|
||||||
|
priv (0|1) #IMPLIED
|
||||||
|
mrel (None|Birth|Adopted|Stepchild|Sponsored|Foster|Other|Unknown) #IMPLIED
|
||||||
|
frel (None|Birth|Adopted|Stepchild|Sponsored|Foster|Other|Unknown) #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
<!ELEMENT type (#PCDATA)>
|
<!ELEMENT type (#PCDATA)>
|
||||||
|
|
||||||
|
@ -153,16 +153,17 @@
|
|||||||
</element></zeroOrMore>
|
</element></zeroOrMore>
|
||||||
<zeroOrMore><element name="childof">
|
<zeroOrMore><element name="childof">
|
||||||
<attribute name="hlink"><data type="IDREF"/></attribute>
|
<attribute name="hlink"><data type="IDREF"/></attribute>
|
||||||
<optional><attribute name="mrel">
|
|
||||||
<ref name="child-rel"/>
|
|
||||||
</attribute></optional>
|
|
||||||
<optional><attribute name="frel">
|
|
||||||
<ref name="child-rel"/>
|
|
||||||
</attribute></optional>
|
|
||||||
</element></zeroOrMore>
|
</element></zeroOrMore>
|
||||||
<zeroOrMore><element name="parentin">
|
<zeroOrMore><element name="parentin">
|
||||||
<attribute name="hlink"><data type="IDREF"/></attribute>
|
<attribute name="hlink"><data type="IDREF"/></attribute>
|
||||||
</element></zeroOrMore>
|
</element></zeroOrMore>
|
||||||
|
<zeroOrMore><element name="personref">
|
||||||
|
<attribute name="hlink"><data type="IDREF"/></attribute>
|
||||||
|
<optional><attribute name="priv">
|
||||||
|
<ref name="priv-content"/>
|
||||||
|
</attribute></optional>
|
||||||
|
<attribute name="rel"><text/></attribute>
|
||||||
|
</element></zeroOrMore>
|
||||||
<optional><element name="note">
|
<optional><element name="note">
|
||||||
<ref name="note-content"/>
|
<ref name="note-content"/>
|
||||||
</element></optional>
|
</element></optional>
|
||||||
@ -287,8 +288,17 @@
|
|||||||
<zeroOrMore><element name="objref">
|
<zeroOrMore><element name="objref">
|
||||||
<ref name="objref-content"/>
|
<ref name="objref-content"/>
|
||||||
</element></zeroOrMore>
|
</element></zeroOrMore>
|
||||||
<zeroOrMore><element name="child">
|
<zeroOrMore><element name="childref">
|
||||||
<attribute name="hlink"><data type="IDREF"/></attribute>
|
<attribute name="hlink"><data type="IDREF"/></attribute>
|
||||||
|
<optional><attribute name="priv">
|
||||||
|
<ref name="priv-content"/>
|
||||||
|
</attribute></optional>
|
||||||
|
<optional><attribute name="mrel">
|
||||||
|
<ref name="child-rel"/>
|
||||||
|
</attribute></optional>
|
||||||
|
<optional><attribute name="frel">
|
||||||
|
<ref name="child-rel"/>
|
||||||
|
</attribute></optional>
|
||||||
</element></zeroOrMore>
|
</element></zeroOrMore>
|
||||||
<zeroOrMore><element name="attribute">
|
<zeroOrMore><element name="attribute">
|
||||||
<ref name="attribute-content"/>
|
<ref name="attribute-content"/>
|
||||||
|
@ -956,14 +956,13 @@ class GrampsParser:
|
|||||||
mrel = RelLib.ChildRefType().set_from_xml_str(attrs.get('mrel'))
|
mrel = RelLib.ChildRefType().set_from_xml_str(attrs.get('mrel'))
|
||||||
frel = RelLib.ChildRefType().set_from_xml_str(attrs.get('frel'))
|
frel = RelLib.ChildRefType().set_from_xml_str(attrs.get('frel'))
|
||||||
|
|
||||||
# Only need to worry about this if there are non-default rels
|
childref = RelLib.ChildRef()
|
||||||
# Otherwise, if both are default, the family's child tag will do
|
childref.ref = self.person.handle
|
||||||
if not ( mrel.is_default() and frel.is_default() ):
|
if not mrel.is_default():
|
||||||
childref = RelLib.ChildRef()
|
|
||||||
childref.ref = self.person.handle
|
|
||||||
childref.set_mother_relation(mrel)
|
childref.set_mother_relation(mrel)
|
||||||
|
if not frel.is_default():
|
||||||
childref.set_father_relation(frel)
|
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)
|
self.person.add_parent_family_handle(handle)
|
||||||
|
|
||||||
def start_parentin(self,attrs):
|
def start_parentin(self,attrs):
|
||||||
@ -979,8 +978,6 @@ class GrampsParser:
|
|||||||
if not self.in_witness:
|
if not self.in_witness:
|
||||||
self.name = RelLib.Name()
|
self.name = RelLib.Name()
|
||||||
self.name.type.set_from_xml_str(attrs.get('type'))
|
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.sort_as = int(attrs.get("sort",RelLib.Name.DEF))
|
||||||
self.name.display_as = int(attrs.get("display",RelLib.Name.DEF))
|
self.name.display_as = int(attrs.get("display",RelLib.Name.DEF))
|
||||||
self.name.conf = int(attrs.get("conf",2))
|
self.name.conf = int(attrs.get("conf",2))
|
||||||
|
@ -535,10 +535,10 @@ class XmlWriter:
|
|||||||
sreflist = childref.get_source_references()
|
sreflist = childref.get_source_references()
|
||||||
if (len(sreflist) == 0) and childref.get_note() =="":
|
if (len(sreflist) == 0) and childref.get_note() =="":
|
||||||
self.write_ref('childref',childref.ref,index,close=True,
|
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:
|
else:
|
||||||
self.write_ref('childref',childref.ref,index,close=False,
|
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:
|
for sref in sreflist:
|
||||||
self.dump_source_ref(sref,index+1)
|
self.dump_source_ref(sref,index+1)
|
||||||
self.write_note("note",childref.get_note_object(),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):
|
def dump_name(self,name,alternative=False,index=1):
|
||||||
sp = " "*index
|
sp = " "*index
|
||||||
name_type = _ConstXML.str_for_xml(_ConstXML.name_types,
|
name_type = name.get_type().xml_str()
|
||||||
name.get_type())
|
|
||||||
self.g.write('%s<name' % sp)
|
self.g.write('%s<name' % sp)
|
||||||
if alternative:
|
if alternative:
|
||||||
self.g.write(' alt="1"')
|
self.g.write(' alt="1"')
|
||||||
@ -923,8 +922,7 @@ class XmlWriter:
|
|||||||
def write_url_list(self,list,index=1):
|
def write_url_list(self,list,index=1):
|
||||||
sp = " "*index
|
sp = " "*index
|
||||||
for url in list:
|
for url in list:
|
||||||
url_type = _ConstXML.str_for_xml(_ConstXML.url_types,
|
url_type = url.get_type().xml_str()
|
||||||
url.get_type())
|
|
||||||
if url_type:
|
if url_type:
|
||||||
type_text = ' type="%s"' % url_type
|
type_text = ' type="%s"' % url_type
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user