[Dive4elements-commits] [PATCH] Fix new attribute evaluation
Wald Commits
scm-commit at wald.intevation.org
Thu Mar 28 12:05:00 CET 2013
# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1364468693 -3600
# Node ID 773899d002340506353b758db7ab2fa9e446a983
# Parent 2be02d6ad9dca20098fb89829135ca8f246a307e
Fix new attribute evaluation
Patch written by Sascha Teichmann
diff -r 2be02d6ad9dc -r 773899d00234 flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java Thu Mar 28 10:57:15 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java Thu Mar 28 12:04:53 2013 +0100
@@ -32,6 +32,7 @@
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import org.w3c.dom.NamedNodeMap;
/** Handles and evaluate meta-data template against dbs. */
@@ -721,13 +722,17 @@
Node copy = owner.importNode(current, false);
- if (copy.getNodeType() == Node.ATTRIBUTE_NODE) {
- evaluateAttributeValue((Attr)copy);
+ NodeList children = current.getChildNodes();
+ for (int i = 0, N = children.getLength(); i < N; ++i) {
+ build(copy, children.item(i));
}
- else {
- NodeList children = current.getChildNodes();
- for (int i = 0, N = children.getLength(); i < N; ++i) {
- build(copy, children.item(i));
+ if (copy.getNodeType() == Node.ELEMENT_NODE) {
+ NamedNodeMap nnm = ((Element)copy).getAttributes();
+ for (int i = 0, N = nnm.getLength(); i < N; ++i) {
+ Node n = nnm.item(i);
+ if (n.getNodeType() == Node.ATTRIBUTE_NODE) {
+ evaluateAttributeValue((Attr)n);
+ }
}
}
parent.appendChild(copy);
More information about the Dive4elements-commits
mailing list