From ae0ef92e10e17307230deca7cbd9a0b17e865c1e Mon Sep 17 00:00:00 2001
From: pgleeson
Date: Wed, 31 Jul 2024 11:28:34 +0100
Subject: [PATCH] Add more info on namespaces in SED-ML export
---
.../java/org/lemsml/export/sedml/SEDMLWriter.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/lemsml/export/sedml/SEDMLWriter.java b/src/main/java/org/lemsml/export/sedml/SEDMLWriter.java
index 4e0c1c8d..0a6a347a 100644
--- a/src/main/java/org/lemsml/export/sedml/SEDMLWriter.java
+++ b/src/main/java/org/lemsml/export/sedml/SEDMLWriter.java
@@ -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;
@@ -67,9 +68,18 @@ public String getMainScript() throws ContentError
StringBuilder main = new StringBuilder();
main.append("\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");