Mercurial > dive4elements > river
changeset 410:df02137b3b28
Datacage service: Cleanup served XML document.
flys-artifacts/trunk@1870 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 09 May 2011 19:54:24 +0000 |
parents | c7a55ff1e22a |
children | 6ab62e5b05b5 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/meta/Builder.java |
diffstat | 2 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Mon May 09 13:47:15 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon May 09 19:54:24 2011 +0000 @@ -1,3 +1,9 @@ +2011-05-09 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/services/meta/Builder.java: + Stripped ugly extra whitespace from output introduced by + templating. + 2011-05-09 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/resources/metadata/template.xml: Added forgotten
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/meta/Builder.java Mon May 09 13:47:15 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/services/meta/Builder.java Mon May 09 19:54:24 2011 +0000 @@ -209,6 +209,13 @@ return; } + if (current.getNodeType() == Node.TEXT_NODE) { + String txt = current.getNodeValue(); + if (txt != null && txt.trim().length() == 0) { + return; + } + } + Node copy = output.importNode(current, false); NodeList children = current.getChildNodes();