Skip to content

Commit

Permalink
Merge branch 'sk/small-fixes' into sk/test-rate-rule-converter-rigoro…
Browse files Browse the repository at this point in the history
…usly
  • Loading branch information
skeating committed Aug 29, 2024
2 parents 2ef3a2a + 77ed536 commit 455b139
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 13 deletions.
6 changes: 2 additions & 4 deletions src/sbml/SBMLErrorTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions src/sbml/SBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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() );
}
}
Expand Down Expand Up @@ -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<ListOf*>(this)->getItemTypeCode();
Expand Down
3 changes: 2 additions & 1 deletion src/sbml/SBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);


/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"
xmlns:appear="http://www.sbml.org/sbml/version1">
xmlns:appear="http://www.sbml.org/sbml/level3/version1/appear" appear:required="true">
<model>
<listOfCompartments>
<compartment id="c" constant="true" appear:shape="circle"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"
xmlns:appear="http://www.sbml.org/sbml/version1"
xmlns:appear="http://www.sbml.org/sbml/level3/version1/appear"
appear:required="true">
<model>
<listOfCompartments>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"
xmlns:appear="http://www.sbml.org/sbml/version1"
xmlns:appear="http://www.sbml.org/sbml/level3/version1/appear"
appear:required="false">
<model>
<listOfCompartments>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"
xmlns:appear="http://www.sbml.org/sbml/version1">
xmlns:appear="http://www.sbother">
<model>
<listOfCompartments>
<compartment id="c" constant="true" appear:shape="circle"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"
xmlns:appear="http://www.sbml.org/sbml/version1"
xmlns:appear="http://www.something.else"
appear:required="true">
<model>
<listOfCompartments>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"
xmlns:appear="http://www.sbml.org/sbml/version1"
xmlns:appear="http://www.something.else"
appear:required="false">
<model>
<listOfCompartments>
Expand Down

0 comments on commit 455b139

Please sign in to comment.