changeset 202:c03d3a872cd2

Fixed a bug in the ElementCreator of the XMLUtils. artifacts/trunk@1447 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 10 Mar 2011 08:25:30 +0000
parents 973f244ed568
children b5e1949bc255
files ChangeLog artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java
diffstat 2 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Mar 09 15:48:06 2011 +0000
+++ b/ChangeLog	Thu Mar 10 08:25:30 2011 +0000
@@ -1,3 +1,10 @@
+2011-03-10  Ingo Weinzierl <ingo@intevation.de>
+
+	* artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java:
+	  Bugfix: The ElementCreator's method addAttr() will no longer add the
+	  namespace to an attribute although the 'addPrefix' parameter was set to
+	  false.
+
 2011-03-09  Ingo Weinzierl <ingo@intevation.de>
 
 	* artifact-database/src/main/java/de/intevation/artifactdatabase/transition/TransitionEngine.java:
--- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java	Wed Mar 09 15:48:06 2011 +0000
+++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java	Thu Mar 10 08:25:30 2011 +0000
@@ -138,13 +138,17 @@
             String  value,
             boolean addPrefix
         ) {
-            Attr attr = document.createAttributeNS(ns, name);
-            attr.setValue(value);
-
-            if (addPrefix)
+            if (addPrefix) {
+                Attr attr = document.createAttributeNS(ns, name);
+                attr.setValue(value);
                 attr.setPrefix(prefix);
 
-            element.setAttributeNode(attr);
+                element.setAttributeNode(attr);
+            }
+            else {
+                element.setAttribute(name, value);
+            }
+
         }
     } // class ElementCreator
 

http://dive4elements.wald.intevation.org