Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sk/test-rate-rule-converter-rigo…
Browse files Browse the repository at this point in the history
…rously' into sk/test-rate-rule-converter-rigorously
  • Loading branch information
skeating committed Oct 6, 2024
2 parents 1c8fafe + 9370f2b commit f20f07b
Show file tree
Hide file tree
Showing 17 changed files with 920 additions and 809 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
Loading

0 comments on commit f20f07b

Please sign in to comment.