From: Dennis Schafroth Date: Wed, 15 Feb 2012 14:34:55 +0000 (+0100) Subject: Use field variable with qualified field name. FIX namespace! X-Git-Tag: v2.5~23^2 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=HEAD;p=marc4j.git Use field variable with qualified field name. FIX namespace! --- diff --git a/src/org/marc4j/TurboMarcXmlWriter.java b/src/org/marc4j/TurboMarcXmlWriter.java index d5ec784..7a7deda 100644 --- a/src/org/marc4j/TurboMarcXmlWriter.java +++ b/src/org/marc4j/TurboMarcXmlWriter.java @@ -199,22 +199,22 @@ public class TurboMarcXmlWriter implements MarcWriter { protected static final String prefix = "tmarc:"; protected static final String CONTROL_FIELD = "c"; - protected static final String Q_CONTROL_FIELD = prefix + "c"; + protected static final String Q_CONTROL_FIELD = prefix + CONTROL_FIELD; protected static final String DATA_FIELD = "d"; - protected static final String Q_DATA_FIELD = prefix + "d"; + protected static final String Q_DATA_FIELD = prefix + DATA_FIELD; protected static final String SUBFIELD = "s"; - protected static final String Q_SUBFIELD = prefix + "s"; + protected static final String Q_SUBFIELD = prefix + SUBFIELD; - protected static final String COLLECTION = "c"; - protected static final String Q_COLLECTION = prefix + "c"; + protected static final String COLLECTION = "collection"; + protected static final String Q_COLLECTION = prefix + COLLECTION; protected static final String RECORD = "r"; - protected static final String Q_RECORD = prefix + "r"; + protected static final String Q_RECORD = prefix + RECORD; protected static final String LEADER = "l"; - protected static final String Q_LEADER = prefix + "l"; + protected static final String Q_LEADER = prefix + LEADER; private boolean indent = false; @@ -414,7 +414,7 @@ public class TurboMarcXmlWriter implements MarcWriter { AttributesImpl atts = new AttributesImpl(); handler.startDocument(); // The next line duplicates the namespace declaration for Marc XML - handler.startPrefixMapping("tmarc", Constants.MARCXML_NS_URI); + handler.startPrefixMapping("tmarc", Constants.TURBO_MARCXML_NS_URI); // add namespace declaration using attribute - need better solution atts.addAttribute(Constants.TURBO_MARCXML_NS_URI, "xmlns", "xmlns:tmarc", "CDATA", Constants.TURBO_MARCXML_NS_URI);