diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 708:757ff56b43b3

Added calculation "am Pegel" version to the "Wasserspiegellage" calculation. flys-artifacts/trunk@2161 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 18 Jun 2011 20:20:34 +0000
parents b6f57d927905
children 4800230fba8a
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Sat Jun 18 18:38:04 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Sat Jun 18 20:20:34 2011 +0000
@@ -19,7 +19,6 @@
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 import de.intevation.artifacts.ArtifactFactory;
@@ -400,15 +399,15 @@
         int count = nodes.getLength();
         logger.debug("Try to save " + count + " data items.");
 
-        for (int i = 0; i < count; i++) {
-            Node node = nodes.item(i);
+        String uri = ArtifactNamespaceContext.NAMESPACE_URI;
 
-            String name = XMLUtils.xpathString(
-                node, "@art:name", ArtifactNamespaceContext.INSTANCE);
-            String value = XMLUtils.xpathString(
-                node, "@art:value", ArtifactNamespaceContext.INSTANCE);
+        for (int i = 0; i < count; i++) {
+            Element node = (Element)nodes.item(i);
 
-            if (name != null && value != null) {
+            String name  = node.getAttributeNS(uri, "name");
+            String value = node.getAttributeNS(uri, "value");
+
+            if (name.length() > 0 && value.length() > 0) {
                 logger.debug("Save data item for '" + name + "' : " + value);
 
                 addData(name, new DefaultStateData(name, null, null, value));

http://dive4elements.wald.intevation.org