7125/7102: fix with DTD change as OKed by NickH

impex.sh test currently broken until the new DTD/schema go online

svn: r23347
This commit is contained in:
Vassilii Khachaturov 2013-10-20 12:57:22 +00:00
parent 012bd1501e
commit 499dae6a2d
4 changed files with 12 additions and 10 deletions

View File

@ -25,15 +25,15 @@
-->
<!--
This is the Document Type Definition file for v1.5.0
This is the Document Type Definition file for v1.5.1
of the GRAMPS XML genealogy data format.
Please use the following formal public identifier to identify it:
"-//GRAMPS//DTD GRAMPS XML V1.5.0//EN"
"-//GRAMPS//DTD GRAMPS XML V1.5.1//EN"
For example:
<!DOCTYPE database PUBLIC "-//GRAMPS//DTD GRAMPS XML V1.5.0//EN"
"http://gramps-project.org/xml/1.5.0/grampsxml.dtd"
<!DOCTYPE database PUBLIC "-//GRAMPS//DTD GRAMPS XML V1.5.1//EN"
"http://gramps-project.org/xml/1.5.1/grampsxml.dtd"
[...]>
-->
@ -62,7 +62,7 @@ DATABASE
<!ELEMENT database (header, name-formats?, tags?, events?, people?, families?,
citations?, sources?, places?, objects?, repositories?,
notes?, bookmarks?, namemaps?)>
<!ATTLIST database xmlns CDATA #FIXED "http://gramps-project.org/xml/1.5.0/">
<!ATTLIST database xmlns CDATA #FIXED "http://gramps-project.org/xml/1.5.1/">
<!-- ************************************************************
@ -367,7 +367,7 @@ CITATIONS
<!ELEMENT citations (citation)*>
<!ELEMENT citation ((daterange|datespan|dateval|datestr)?, page?, confidence?,
<!ELEMENT citation ((daterange|datespan|dateval|datestr)?, page?, confidence,
noteref*, objref*, data_item*, sourceref)>
<!ATTLIST citation
id CDATA #IMPLIED

View File

@ -32,7 +32,7 @@
<grammar
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
ns="http://gramps-project.org/xml/1.5.0/"
ns="http://gramps-project.org/xml/1.5.1/"
xmlns="http://relaxng.org/ns/structure/1.0">
<start><element name="database">
@ -434,7 +434,7 @@
<ref name="primary-object"/>
<optional><ref name="date-content"/></optional>
<optional><element name="page"><text/></element></optional>
<optional><element name="confidence"><text/></element></optional>
<element name="confidence"><text/></element>
<zeroOrMore><element name="noteref">
<ref name="noteref-content"/>
</element></zeroOrMore>

View File

@ -1933,7 +1933,9 @@ class GrampsParser(UpdateCallback):
self.citation)
self.citation.private = bool(attrs.get("priv"))
self.citation.change = int(attrs.get('change', self.change))
self.citation.confidence = self.conf # default
self.citation.confidence = (
self.conf if self.__xml_version >= '1.5.1'
else 0 ) # See bug# 7125
self.info.add('new-object', CITATION_KEY, self.citation)
return self.citation

View File

@ -35,5 +35,5 @@
# Public Constants
#
#------------------------------------------------------------------------
GRAMPS_XML_VERSION = "1.5.0"
GRAMPS_XML_VERSION = "1.5.1"