diff --git a/src/sbml/SBMLErrorTable.h b/src/sbml/SBMLErrorTable.h index 4f07775286..53d2a1d6e4 100644 --- a/src/sbml/SBMLErrorTable.h +++ b/src/sbml/SBMLErrorTable.h @@ -11047,8 +11047,7 @@ static const sbmlErrorTableEntry errorTable[] = "LibSBML expected to read the annotation into a ModelHistory " "object. Unfortunately, some attributes were not present or correct " "and the resulting ModelHistory object will not correctly " - "produce the annotation. This functionality will be improved in " - "later versions of libSBML. ", + "produce the annotation. ", {"", "", "L2V2 Section 6.3", @@ -11076,8 +11075,7 @@ static const sbmlErrorTableEntry errorTable[] = "LibSBML expected to read the annotation into a ModelHistory " "object. Unfortunately, some attributes were not present or correct " "and the resulting ModelHistory object is NULL. Thus it will fail to " - "produce the annotation. This functionality will be improved in " - "later versions of libSBML. ", + "produce the annotation. ", {"", "", "L2V2 Section 6.3", diff --git a/src/sbml/SBase.cpp b/src/sbml/SBase.cpp index 4e1ada2ac5..3ba470d240 100644 --- a/src/sbml/SBase.cpp +++ b/src/sbml/SBase.cpp @@ -4576,6 +4576,7 @@ SBase::read (XMLInputStream& stream) else if ( next.isStart() ) { const std::string nextName = next.getName(); + const std::string nextURI = next.getURI(); #if 0 cout << "[DEBUG] SBase::read " << nextName << " uri " << stream.peek().getURI() << endl; @@ -4620,7 +4621,7 @@ SBase::read (XMLInputStream& stream) || readAnnotation(stream) || readNotes(stream) )) { - logUnknownElement(nextName, getLevel(), getVersion()); + logUnknownElement(nextName, getLevel(), getVersion(), nextURI); stream.skipPastEnd( stream.next() ); } } @@ -5343,11 +5344,17 @@ SBase::logUnknownAttribute( const string& attribute, void SBase::logUnknownElement( const string& element, const unsigned int level, - const unsigned int version ) + const unsigned int version, + const string& URI) { bool logged = false; ostringstream msg; + // if we have an unknown element that is not in an SBML name space + // this is perfectly allowed XML + if (getPackageName() == "core" && SBMLNamespaces::getSBMLNamespaceURI(level, version) != URI) + return; + if (level > 2 && getTypeCode() == SBML_LIST_OF) { int tc = static_cast(this)->getItemTypeCode(); diff --git a/src/sbml/SBase.h b/src/sbml/SBase.h index 5ed23d9dcb..df17ac3e5c 100644 --- a/src/sbml/SBase.h +++ b/src/sbml/SBase.h @@ -3532,7 +3532,8 @@ newModel.addSpecies(s1); */ void logUnknownElement( const std::string& element, const unsigned int level, - const unsigned int version ); + const unsigned int version, + const std::string& URI = NULL); /** diff --git a/src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-04-10102.xml b/src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-06.xml similarity index 100% rename from src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-04-10102.xml rename to src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-06.xml diff --git a/src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-06-10102.xml b/src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-07.xml similarity index 100% rename from src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-06-10102.xml rename to src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-07.xml diff --git a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-27-20517.xml b/src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-08.xml similarity index 80% rename from src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-27-20517.xml rename to src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-08.xml index 69370fd243..f60c1bb550 100644 --- a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-27-20517.xml +++ b/src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-08.xml @@ -1,6 +1,6 @@ +xmlns:appear="http://www.sbml.org/sbml/level3/version1/appear" appear:required="true"> diff --git a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-29-20517.xml b/src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-09.xml similarity index 86% rename from src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-29-20517.xml rename to src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-09.xml index ff0a4a7137..cce61f113a 100644 --- a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-29-20517.xml +++ b/src/sbml/validator/test/test-data/libsbml-constraints/99107-fail-01-09.xml @@ -1,6 +1,6 @@ diff --git a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-28-20517.xml b/src/sbml/validator/test/test-data/libsbml-constraints/99108-fail-01-06.xml similarity index 86% rename from src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-28-20517.xml rename to src/sbml/validator/test/test-data/libsbml-constraints/99108-fail-01-06.xml index bdc090f245..c53076cd87 100644 --- a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-28-20517.xml +++ b/src/sbml/validator/test/test-data/libsbml-constraints/99108-fail-01-06.xml @@ -1,6 +1,6 @@ diff --git a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-30-20517.xml b/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-07.xml similarity index 87% rename from src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-30-20517.xml rename to src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-07.xml index 1877ba8743..43726846a6 100644 --- a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-30-20517.xml +++ b/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-07.xml @@ -1,6 +1,6 @@ +xmlns:appear="http://www.sbother"> diff --git a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-32-20517.xml b/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-08.xml similarity index 88% rename from src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-32-20517.xml rename to src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-08.xml index 2da0266d66..d8544069c2 100644 --- a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-32-20517.xml +++ b/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-08.xml @@ -1,6 +1,6 @@ diff --git a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-31-20517.xml b/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-09.xml similarity index 88% rename from src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-31-20517.xml rename to src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-09.xml index 7815afde46..5c83a7d1de 100644 --- a/src/sbml/validator/test/test-data/sbml-xml-constraints/10102-fail-01-31-20517.xml +++ b/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20517-fail-01-09.xml @@ -1,6 +1,6 @@