[PATCH] Reorder generation of static part of describe document for fast XML DOM handling

Wald Commits scm-commit at wald.intevation.org
Wed Oct 16 12:39:42 CEST 2013


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1381919973 -7200
# Node ID 760ea7f0845534366050010dd6f7f74cee07a161
# Parent  e1aa0580665097b666327290d13693e15d71d628
Reorder generation of static part of describe document for fast XML DOM handling.

diff -r e1aa05806650 -r 760ea7f08455 artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java	Wed Oct 16 12:00:29 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java	Wed Oct 16 12:39:33 2013 +0200
@@ -73,20 +73,21 @@
             Element ui = creator.create("ui");
             Element staticE = creator.create("static");
             Element state = creator.create("state");
-            ui.appendChild(staticE);
-            staticE.appendChild(state);
-            root.appendChild(ui);
 
             for (StateData dataItem : datas) {
                 Element itemelent = creator.create("data");
                 creator.addAttr(itemelent, "name", dataItem.getName(), true);
                 creator.addAttr(itemelent, "type", dataItem.getType(), true);
-                state.appendChild(itemelent);
                 Element valuement = creator.create("item");
                 creator.addAttr(valuement, "label", dataItem.getDescription(), true);
                 creator.addAttr(valuement, "value", dataItem.getValue().toString(), true);
                 itemelent.appendChild(valuement);
+                state.appendChild(itemelent);
             }
+
+            ui.appendChild(staticE);
+            staticE.appendChild(state);
+            root.appendChild(ui);
         }
 
         return desc;


More information about the Dive4elements-commits mailing list