Mercurial > dive4elements > river
changeset 1987:382e38164200
Fixed wrong usage of DOM operations in Settings Attributes.
flys-artifacts/trunk@3421 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 15 Dec 2011 09:43:54 +0000 |
parents | 3632150dbe0b |
children | 158b3aabda2c |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/BooleanAttribute.java flys-artifacts/src/main/java/de/intevation/flys/exports/StringAttribute.java flys-artifacts/src/main/java/de/intevation/flys/exports/VisibleAttribute.java |
diffstat | 4 files changed, 19 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Dec 14 14:17:31 2011 +0000 +++ b/flys-artifacts/ChangeLog Thu Dec 15 09:43:54 2011 +0000 @@ -1,3 +1,10 @@ +2011-12-15 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/exports/BooleanAttribute.java, + src/main/java/de/intevation/flys/exports/VisibleAttribute.java, + src/main/java/de/intevation/flys/exports/StringAttribute.java: Fixed wrong + usage of DOM operations. + 2011-12-14 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/exports/BooleanAttribute.java,
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/BooleanAttribute.java Wed Dec 14 14:17:31 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/BooleanAttribute.java Thu Dec 15 09:43:54 2011 +0000 @@ -2,6 +2,7 @@ import org.w3c.dom.Attr; import org.w3c.dom.Document; +import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -27,14 +28,11 @@ @Override public Node toXML(Node parent) { Document owner = parent.getOwnerDocument(); - Node node = super.toXML(parent); - Attr attr = owner.createAttribute("type"); - attr.setValue("boolean"); + Element ele = (Element) super.toXML(parent); + ele.setAttribute("type", "boolean"); - node.appendChild(attr); - - return node; + return ele; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/StringAttribute.java Wed Dec 14 14:17:31 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/StringAttribute.java Thu Dec 15 09:43:54 2011 +0000 @@ -2,6 +2,7 @@ import org.w3c.dom.Attr; import org.w3c.dom.Document; +import org.w3c.dom.Element; import org.w3c.dom.Node; @@ -27,14 +28,11 @@ @Override public Node toXML(Node parent) { Document owner = parent.getOwnerDocument(); - Node node = super.toXML(parent); - Attr attr = owner.createAttribute("type"); - attr.setValue("string"); + Element ele = (Element) super.toXML(parent); + ele.setAttribute("type", "string"); - node.appendChild(attr); - - return node; + return ele; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/VisibleAttribute.java Wed Dec 14 14:17:31 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/VisibleAttribute.java Thu Dec 15 09:43:54 2011 +0000 @@ -2,6 +2,7 @@ import org.w3c.dom.Attr; import org.w3c.dom.Document; +import org.w3c.dom.Element; import org.w3c.dom.Node; import de.intevation.artifactdatabase.state.DefaultAttribute; @@ -32,14 +33,11 @@ @Override public Node toXML(Node parent) { Document owner = parent.getOwnerDocument(); - Node node = super.toXML(parent); - Attr attr = owner.createAttribute("display"); - attr.setValue(String.valueOf(visible)); + Element ele = (Element) super.toXML(parent); + ele.setAttribute("display", String.valueOf(visible)); - node.appendChild(attr); - - return node; + return ele; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :