diff --git a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlHandler.java b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlHandler.java index 37fa25fa9..98d7d082e 100644 --- a/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlHandler.java +++ b/metafacture-biblio/src/main/java/org/metafacture/biblio/marc21/MarcXmlHandler.java @@ -38,8 +38,6 @@ @FluxCommand("handle-marcxml") public final class MarcXmlHandler extends DefaultXmlPipe { - public static final String DEFAULT_ATTRIBUTE_MARKER = ""; - private static final String SUBFIELD = "subfield"; private static final String DATAFIELD = "datafield"; private static final String CONTROLFIELD = "controlfield"; diff --git a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlPipe.java b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlPipe.java index 773bcdad4..a429fd094 100644 --- a/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlPipe.java +++ b/metafacture-framework/src/main/java/org/metafacture/framework/helpers/DefaultXmlPipe.java @@ -38,6 +38,11 @@ */ public class DefaultXmlPipe extends DefaultSender implements XmlPipe { + public static final String DEFAULT_ATTRIBUTE_MARKER = ""; + public static final String DEFAULT_RECORD_TAG = "record"; + public static final String DEFAULT_ROOT_TAG = "records"; + public static final String DEFAULT_VALUE_TAG = "value"; + public DefaultXmlPipe() { } diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java b/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java index ef7110070..a2813f6fa 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/GenericXmlHandler.java @@ -40,12 +40,6 @@ @FluxCommand("handle-generic-xml") public final class GenericXmlHandler extends DefaultXmlPipe { - public static final String DEFAULT_ATTRIBUTE_MARKER = ""; - - public static final String DEFAULT_RECORD_TAG = "record"; - - public static final String DEFAULT_VALUE_TAG = "value"; - public static final boolean EMIT_NAMESPACE = false; private static final Pattern TABS = Pattern.compile("\t+"); diff --git a/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java b/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java index f2844c325..cff74368e 100644 --- a/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java +++ b/metafacture-xml/src/main/java/org/metafacture/xml/SimpleXmlEncoder.java @@ -26,6 +26,7 @@ import org.metafacture.framework.annotations.In; import org.metafacture.framework.annotations.Out; import org.metafacture.framework.helpers.DefaultStreamPipe; +import org.metafacture.framework.helpers.DefaultXmlPipe; import java.io.IOException; import java.net.URL; @@ -53,10 +54,6 @@ public final class SimpleXmlEncoder extends DefaultStreamPipe namespaces = new HashMap(); private boolean writeRootTag = true; private boolean writeXmlHeader = true; @@ -211,7 +208,7 @@ public void endEntity() { @Override public void literal(final String name, final String value) { - if (name.isEmpty() || name.equals(valueTag)) { + if (name.equals(valueTag)) { element.setText(value); } else if (name.startsWith(attributeMarker)) {