Skip to content

Commit

Permalink
Add more info on namespaces in SED-ML export
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Jul 31, 2024
1 parent bf3a099 commit ae0ef92
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/main/java/org/lemsml/export/sedml/SEDMLWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Arrays;

import org.lemsml.export.base.AXMLWriter;
import org.lemsml.jlems.core.logging.E;
Expand Down Expand Up @@ -67,9 +68,18 @@ public String getMainScript() throws ContentError

StringBuilder main = new StringBuilder();
main.append("<?xml version='1.0' encoding='UTF-8'?>\n");
String[] attrs = new String[] { "xmlns=http://sed-ml.org/sed-ml/level"+SEDML_LEVEL+"/version"+SEDML_VERSION, "level="+SEDML_LEVEL, "version="+SEDML_VERSION+"", "xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance",
String[] attrs = new String[] { "xmlns=http://sed-ml.org/sed-ml/level"+SEDML_LEVEL+"/version"+SEDML_VERSION,
"level="+SEDML_LEVEL,
"version="+SEDML_VERSION+"",
"xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance",
"xsi:schemaLocation=http://sed-ml.org/sed-ml/level"+SEDML_LEVEL+"/version"+SEDML_VERSION+" " + PREF_SEDML_SCHEMA };

if(modelFormat == Format.SBML)
{
attrs = Arrays.copyOf(attrs, attrs.length + 1);
attrs[attrs.length-1] = "xmlns:sbml=http://www.sbml.org/sbml/level2/version2";
}

startElement(main, "sedML", attrs);
startElement(main, "notes");
startElement(main, "p", "xmlns=http://www.w3.org/1999/xhtml");
Expand Down

0 comments on commit ae0ef92

Please sign in to comment.