diff --git a/.classpath b/.classpath index 5e7eb460..90ca769a 100644 --- a/.classpath +++ b/.classpath @@ -17,6 +17,7 @@ - + + diff --git a/src/PamController/settings/output/xml/PamguardXMLWriter.java b/src/PamController/settings/output/xml/PamguardXMLWriter.java index 7058241b..b943f2d6 100644 --- a/src/PamController/settings/output/xml/PamguardXMLWriter.java +++ b/src/PamController/settings/output/xml/PamguardXMLWriter.java @@ -29,6 +29,7 @@ import javax.xml.transform.stream.StreamResult; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; import com.sun.javafx.runtime.VersionInfo; @@ -48,6 +49,7 @@ import PamguardMVC.PamDataBlock; import PamguardMVC.PamDataUnit; import PamguardMVC.PamProcess; import binaryFileStorage.BinaryStore; +import tethys.TethysControl; /** * Class for writing XML configuration output to a file. @@ -62,6 +64,7 @@ public class PamguardXMLWriter implements PamSettings { private static final Set> WRAPPER_TYPES = getWrapperTypes(); private XMLWriterSettings writerSettings = new XMLWriterSettings(); +// private String xmlNameSpace; private static PamguardXMLWriter singleInstance; @@ -83,6 +86,19 @@ public class PamguardXMLWriter implements PamSettings { } return singleInstance; } + + /** + * Recursively walk the tree and add a namespace to every + * single element. + * @param doc + * @param nameSpace + * @return + */ + public boolean addNameSpaceToElements(Document doc, Element el, String nameSpace) { +// el.setAttributeNS(nameSpace, nameSpace, nameSpace); + NamedNodeMap attributes = el.getAttributes(); + return true; + } /** * Make a document with the options specified in writerSettings. @@ -967,5 +983,9 @@ public class PamguardXMLWriter implements PamSettings { return true; } +// public void setStaticNameSpace(String xmlNameSpace) { +// this.xmlNameSpace = xmlNameSpace; +// } + } diff --git a/src/tethys/TethysControl.java b/src/tethys/TethysControl.java index 2c88e3d5..2e584354 100644 --- a/src/tethys/TethysControl.java +++ b/src/tethys/TethysControl.java @@ -30,6 +30,7 @@ public class TethysControl extends PamControlledUnit { public static final String unitType = "Tethys Interface"; public static String defaultName = "Tethys"; + public static String xmlNameSpace = "http://tethys.sdsu.edu/schema/1.0"; private TethysExportParams tethysExportParams = new TethysExportParams(); diff --git a/src/tethys/pamdata/AutoTethysProvider.java b/src/tethys/pamdata/AutoTethysProvider.java index 3f752d55..8ba36fdd 100644 --- a/src/tethys/pamdata/AutoTethysProvider.java +++ b/src/tethys/pamdata/AutoTethysProvider.java @@ -27,6 +27,7 @@ import nilus.Deployment; import nilus.DescriptionType; import nilus.Detection; import nilus.SpeciesIDType; +import tethys.TethysControl; import tethys.TethysTimeFuncs; import tethys.output.StreamExportParams; import tethys.output.TethysExportParams; @@ -105,10 +106,12 @@ public class AutoTethysProvider implements TethysDataProvider { if (settingsObjs == null) { return null; } +// pamXMLWriter.setStaticNameSpace(TethysControl.xmlNameSpace); Element settingsEl = pamXMLWriter.writeUnitSettings(doc, dummyEl, pamSettings, settingsObjs); if (settingsEl == null) { return null; } + pamXMLWriter.addNameSpaceToElements(doc, settingsEl, TethysControl.xmlNameSpace); dummyEl.appendChild(settingsEl); NodeList childs = settingsEl.getChildNodes(); for (int i = 0; i < childs.getLength(); i++) {