Skip to content

readSedMLFromFile doesn't properly handle XML text nodes in newXML #91

@jonrkarr

Description

@jonrkarr

This is an edge case, but since SED-ML is divorced from the details of particular model formats, adding a text node could be a valid operation in a model format.

Example:

<?xml version="1.0" encoding="UTF-8"?>
<sedML xmlns="http://sed-ml.org/sed-ml/level1/version3" level="1" version="3">
  <listOfModels>
    <model id="model" language="urn:sedml:language:sbml" source="model.sbml">
      <listOfChanges>
        <addXML target="/sbml:sbml/sbml:model[id=&apos;b&apos;]/sbml:listOfParameters">
          <newXML>1.9</newXML>
        </addXML>
      </listOfChanges>
    </model>
  </listOfModels>
</sedML>

Here's how libSED-ML behaves on this example:

  • XMLNode_convertXMLNodeToString and XMLNode_convertStringToXMLNode correctly round trip 1.9
  • writeSedMLToString can export text nodes
  • readSedMLFromFile does not correctly import this. newXML is null and no error is raised.

I expected newXML to be text node with value 1.9.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions