From 298aed8aa192d98a73b2f7ef9a188ef3b7f6c8b4 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Wed, 15 Feb 2012 15:34:55 +0100 Subject: [PATCH] Use field variable with qualified field name. FIX namespace! --- src/org/marc4j/TurboMarcXmlWriter.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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); -- 1.7.10.4