sbmlteam / libsbml

LibSBML is a native library for reading, writing and manipulating files and data streams containing the Systems Biology Markup Language (SBML). It offers language bindings for C, C++, C#, Java, JavaScript, MATLAB, Perl, PHP, Python, R and Ruby.
https://sbml.org/software/libsbml
Other
41 stars 29 forks source link

File 99107-fail-01-06-10102 not actually wrong #367

Open luciansmith opened 8 months ago

luciansmith commented 8 months ago

We test for error 99107 in the file 99107-fail-01-06-10102.xml, but the problem it detects is, I believe, not actually an error. The file defines a new namespace 'appear' and adds a listOfShapes in that namespace, but I believe this is perfectly legal XML, and doesn't impact the SBML specification at all.

<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core"  level="3" version="2"
xmlns:appear1="http://www.sbml.org/sbml/level3/version1/appear/version1"
      appear1:required="true" xmlns:appear="http://anything">
  <model>
    <listOfCompartments>
      <compartment id="c" constant="true" units="litre"/>
    </listOfCompartments>
    <appear:listOfShapes>
      <appear:shape appear:id="circle"/>
    </appear:listOfShapes>
  </model>
</sbml>

Tagging @daemontus for bringing this to our attention.

skeating commented 2 months ago

Error 99107 is correct because the namespace "appear1" mimics l3v1 package namespace and indeed has the required so printing the warning that this package cannot be interpreted is correct.

Error 10102 should not be reported as you accurately say it is not attempting to be in the sbml namespace