comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/datacage/templating/Builder.java @ 5494:773899d00234

Fix new attribute evaluation Patch written by Sascha Teichmann
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 28 Mar 2013 12:04:53 +0100
parents 3b5e1535a459
children 627584bc0586
comparison
equal deleted inserted replaced
5493:2be02d6ad9dc 5494:773899d00234
30 import org.w3c.dom.Attr; 30 import org.w3c.dom.Attr;
31 import org.w3c.dom.Document; 31 import org.w3c.dom.Document;
32 import org.w3c.dom.Element; 32 import org.w3c.dom.Element;
33 import org.w3c.dom.Node; 33 import org.w3c.dom.Node;
34 import org.w3c.dom.NodeList; 34 import org.w3c.dom.NodeList;
35 import org.w3c.dom.NamedNodeMap;
35 36
36 37
37 /** Handles and evaluate meta-data template against dbs. */ 38 /** Handles and evaluate meta-data template against dbs. */
38 public class Builder 39 public class Builder
39 { 40 {
719 return; 720 return;
720 } 721 }
721 722
722 Node copy = owner.importNode(current, false); 723 Node copy = owner.importNode(current, false);
723 724
724 if (copy.getNodeType() == Node.ATTRIBUTE_NODE) { 725 NodeList children = current.getChildNodes();
725 evaluateAttributeValue((Attr)copy); 726 for (int i = 0, N = children.getLength(); i < N; ++i) {
726 } 727 build(copy, children.item(i));
727 else { 728 }
728 NodeList children = current.getChildNodes(); 729 if (copy.getNodeType() == Node.ELEMENT_NODE) {
729 for (int i = 0, N = children.getLength(); i < N; ++i) { 730 NamedNodeMap nnm = ((Element)copy).getAttributes();
730 build(copy, children.item(i)); 731 for (int i = 0, N = nnm.getLength(); i < N; ++i) {
732 Node n = nnm.item(i);
733 if (n.getNodeType() == Node.ATTRIBUTE_NODE) {
734 evaluateAttributeValue((Attr)n);
735 }
731 } 736 }
732 } 737 }
733 parent.appendChild(copy); 738 parent.appendChild(copy);
734 } 739 }
735 } // class BuildHelper 740 } // class BuildHelper

http://dive4elements.wald.intevation.org