changeset 7350:760ea7f08455

Reorder generation of static part of describe document for fast XML DOM handling.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 16 Oct 2013 12:39:33 +0200
parents e1aa05806650
children 2d912b2a4bdf c6825778de1f
files artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;

http://dive4elements.wald.intevation.org