Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java	(revision 26054)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/Action.java	(revision 26055)
@@ -1,20 +1,19 @@
 package org.greenstone.gsdl3.action;
 
-import org.greenstone.gsdl3.core.ModuleInterface;
-import org.greenstone.gsdl3.util.*;
-// XML classes
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Element;
-import org.w3c.dom.Document;
-
-// other java stuff
-import java.io.File;
-import java.util.Vector;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 
-import org.apache.log4j.*;
+import org.apache.log4j.Logger;
+import org.greenstone.gsdl3.core.ModuleInterface;
+import org.greenstone.gsdl3.util.GSConstants;
+import org.greenstone.gsdl3.util.GSParams;
+import org.greenstone.gsdl3.util.GSXML;
+import org.greenstone.gsdl3.util.UserContext;
+import org.greenstone.gsdl3.util.XMLConverter;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /** base class for Actions */
@@ -100,6 +99,5 @@
 	protected void extractMetadataNames(Element format, HashSet<String> meta_names)
 	{
-		//NodeList nodes = format.getElementsByTagNameNS("metadata", "http://www.greenstone.org/configformat");
-		NodeList metadata_nodes = format.getElementsByTagName("gsf:metadata");
+		NodeList metadata_nodes = format.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "metadata");
 		for (int i = 0; i < metadata_nodes.getLength(); i++)
 		{
@@ -111,7 +109,8 @@
 			String sep = elem.getAttribute("separator");
 
-			if(pos.equals("offset")) { // offset when requested to use mdoffset
-			    metadata.append("offset");
-			    metadata.append(GSConstants.META_RELATION_SEP);			    
+			if (pos.equals("offset"))
+			{ // offset when requested to use mdoffset
+				metadata.append("offset");
+				metadata.append(GSConstants.META_RELATION_SEP);
 			}
 			else if (!pos.equals(""))
@@ -147,5 +146,5 @@
 		boolean getEquivLinkMeta = false;
 
-		NodeList link_nodes = format.getElementsByTagName("gsf:link");
+		NodeList link_nodes = format.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "link");
 		for (int i = 0; i < link_nodes.getLength(); i++)
 		{
@@ -157,10 +156,12 @@
 				meta_names.add("srclinkFile");
 			}
-			else if (type.equals("web")) {
-    				meta_names.add("weblink");
+			else if (type.equals("web"))
+			{
+				meta_names.add("weblink");
 				meta_names.add("webicon");
 				meta_names.add("/weblink");
 			}
-			else if (type.equals("equivdoc")) {
+			else if (type.equals("equivdoc"))
+			{
 				getEquivLinkMeta = true;
 			}
@@ -169,5 +170,5 @@
 		// get all the metadata necessary for when the user has used "gsf:equivlink"
 		// so that we can build up the equivlink from the metadata components it needs
-		link_nodes = format.getElementsByTagName("gsf:equivlinkgs3");
+		link_nodes = format.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "equivlinkgs3");
 		if (getEquivLinkMeta || link_nodes.getLength() > 0)
 		{
@@ -191,5 +192,5 @@
 		}
 
-		if (format.getElementsByTagName("gsf:image").getLength() > 0)
+		if (format.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "image").getLength() > 0)
 		{
 			meta_names.add("Thumb");
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java	(revision 26054)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java	(revision 26055)
@@ -454,5 +454,5 @@
 	protected void extractMetadataNames(Element new_format, HashSet<String> doc_meta_names, HashSet<String> class_meta_names)
 	{
-		NodeList templates = new_format.getElementsByTagNameNS("http://www.greenstone.org/greenstone3/schema/ConfigFormat", "template");
+		NodeList templates = new_format.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "template");
 		for (int i = 0; i < templates.getLength(); i++)
 		{
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java	(revision 26054)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/Receptionist.java	(revision 26055)
@@ -1,20 +1,20 @@
 package org.greenstone.gsdl3.core;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.apache.log4j.Logger;
+import org.greenstone.gsdl3.action.Action;
+import org.greenstone.gsdl3.util.GSConstants;
+import org.greenstone.gsdl3.util.GSFile;
+import org.greenstone.gsdl3.util.GSParams;
+import org.greenstone.gsdl3.util.GSXML;
+import org.greenstone.gsdl3.util.XMLConverter;
 import org.greenstone.util.GlobalProperties;
-import org.greenstone.gsdl3.util.*;
-import org.greenstone.gsdl3.action.*;
-// XML classes
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-// other java classes
-import java.io.File;
-import java.util.HashMap;
-import java.util.Enumeration;
-import java.util.ArrayList;
-
-import org.apache.log4j.*;
 
 /**
@@ -245,6 +245,6 @@
 		page.setAttribute(GSXML.LANG_ATT, request.getAttribute(GSXML.LANG_ATT));
 		// just in case these namespaces end up in the page and we want to display the XML
-		page.setAttribute("xmlns:gsf", "http://www.greenstone.org/greenstone3/schema/ConfigFormat");
-		page.setAttribute("xmlns:xsl", "http://www.w3.org/1999/XSL/Transform");
+		page.setAttribute("xmlns:gsf", GSXML.GSF_NAMESPACE);
+		page.setAttribute("xmlns:xsl", GSXML.XSL_NAMESPACE);
 
 		//logger.info(a+" mesa=" + this.converter.getPrettyString(message));
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 26054)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/TransformingReceptionist.java	(revision 26055)
@@ -198,8 +198,8 @@
 		{
 			Document currentDoc = this.converter.getDOM(currentFile);
-			NodeList metadataElems = currentDoc.getElementsByTagNameNS("http://www.greenstone.org/greenstone3/schema/ConfigFormat", "metadata"); //gsf:metadata
-			NodeList imageElems = currentDoc.getElementsByTagNameNS("http://www.greenstone.org/greenstone3/schema/ConfigFormat", "image"); //gsf:image
-			NodeList includeElems = currentDoc.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "include");
-			NodeList importElems = currentDoc.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "import");
+			NodeList metadataElems = currentDoc.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "metadata"); //gsf:metadata
+			NodeList imageElems = currentDoc.getElementsByTagNameNS(GSXML.GSF_NAMESPACE, "image"); //gsf:image
+			NodeList includeElems = currentDoc.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "include");
+			NodeList importElems = currentDoc.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "import");
 
 			ArrayList<String> names = new ArrayList<String>();
@@ -891,5 +891,5 @@
 			try
 			{
-				Document inlineTemplateDoc = this.converter.getDOM("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:java=\"http://xml.apache.org/xslt/java\" xmlns:util=\"xalan://org.greenstone.gsdl3.util.XSLTUtil\" xmlns:gsf=\"http://www.greenstone.org/greenstone3/schema/ConfigFormat\">" + inlineTemplate + "</xsl:stylesheet>", "UTF-8");
+				Document inlineTemplateDoc = this.converter.getDOM("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"" + GSXML.XSL_NAMESPACE + "\" xmlns:java=\"" + GSXML.JAVA_NAMESPACE + "\" xmlns:util=\"" + GSXML.UTIL_NAMESPACE + "\" xmlns:gsf=\"" + GSXML.GSF_NAMESPACE + "\">" + inlineTemplate + "</xsl:stylesheet>", "UTF-8");
 
 				if (_debug)
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java	(revision 26054)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/CrossCollectionSearch.java	(revision 26055)
@@ -86,5 +86,5 @@
 		{
 			// add in a default format statement
-			String format_string = "<format xmlns:gsf='http://www.greenstone.org/greenstone3/schema/ConfigFormat' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'><gsf:template match='documentNode'><td><a><xsl:attribute name='href'>?a=d&amp;c=<xsl:value-of select='@collection'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test=\"@nodeType='leaf'\">&amp;sib=1</xsl:if>&amp;dt=<xsl:value-of select='@docType'/>&amp;p.a=q&amp;p.s=" + TEXT_QUERY_SERVICE + "&amp;p.c=";
+			String format_string = "<format xmlns:gsf='" + GSXML.GSF_NAMESPACE + "' xmlns:xsl='" + GSXML.XSL_NAMESPACE + "'><gsf:template match='documentNode'><td><a><xsl:attribute name='href'>?a=d&amp;c=<xsl:value-of select='@collection'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test=\"@nodeType='leaf'\">&amp;sib=1</xsl:if>&amp;dt=<xsl:value-of select='@docType'/>&amp;p.a=q&amp;p.s=" + TEXT_QUERY_SERVICE + "&amp;p.c=";
 			if (this.cluster_name != null)
 			{
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java	(revision 26054)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSFile.java	(revision 26055)
@@ -19,20 +19,15 @@
 package org.greenstone.gsdl3.util;
 
-import java.io.File;
-//import org.apache.soap.encoding.soapenc.Base64;
-import org.apache.axis.encoding.Base64;
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
+import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
-import java.io.InputStream;
 import java.io.IOException;
-import java.lang.ClassLoader; // to find files on the class path
-import java.net.URL;
 import java.nio.channels.FileChannel;
 import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.log4j.*;
+
+import org.apache.axis.encoding.Base64;
+import org.apache.log4j.Logger;
 import org.greenstone.util.GlobalProperties;
 
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 26054)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java	(revision 26055)
@@ -291,4 +291,10 @@
 	public static final String VLIST = "VList";
 
+	//for namespaces
+	public static final String XSL_NAMESPACE = "http://www.w3.org/1999/XSL/Transform";
+	public static final String GSF_NAMESPACE = "http://www.greenstone.org/greenstone3/schema/ConfigFormat";
+	public static final String JAVA_NAMESPACE = "http://xml.apache.org/xslt/java";
+	public static final String UTIL_NAMESPACE = "xalan://org.greenstone.gsdl3.util.XSLTUtil";
+
 	/**
 	 * takes a list of elements, and returns an array of strings of the values
Index: /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXSLT.java
===================================================================
--- /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXSLT.java	(revision 26054)
+++ /main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/GSXSLT.java	(revision 26055)
@@ -61,5 +61,5 @@
 		Element main = main_xsl.getDocumentElement();
 		Node insertion_point = null;
-		Element last_import = GSXML.getLastElementByTagNameNS(main, "http://www.w3.org/1999/XSL/Transform", "import");
+		Element last_import = GSXML.getLastElementByTagNameNS(main, GSXML.XSL_NAMESPACE, "import");
 		if (last_import != null)
 		{
@@ -72,5 +72,5 @@
 
 		// imports
-		NodeList children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "import");
+		NodeList children = extra_xsl.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "import");
 		for (int i = 0; i < children.getLength(); i++)
 		{
@@ -78,5 +78,5 @@
 			// If the new xsl:import element is identical (in terms of href attr value) 
 			// to any in the merged document, don't copy it over
-			if (GSXML.getNamedElementNS(main, "http://www.w3.org/1999/XSL/Transform", "import", "href", node.getAttribute("href")) == null)
+			if (GSXML.getNamedElementNS(main, GSXML.XSL_NAMESPACE, "import", "href", node.getAttribute("href")) == null)
 			{
 				// Import statements should be the first children of an xsl:stylesheet element
@@ -90,5 +90,5 @@
 
 		// do we have a new insertion point??
-		Element last_include = GSXML.getLastElementByTagNameNS(main, "http://www.w3.org/1999/XSL/Transform", "include");
+		Element last_include = GSXML.getLastElementByTagNameNS(main, GSXML.XSL_NAMESPACE, "include");
 		if (last_include != null)
 		{
@@ -97,5 +97,5 @@
 
 		// includes
-		children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "include");
+		children = extra_xsl.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "include");
 		for (int i = 0; i < children.getLength(); i++)
 		{
@@ -105,5 +105,5 @@
 			// Although Node.appendChild() will first remove identical nodes before appending, we check
 			// only the href attribute to see if they're "identical" to any pre-existing <xsl:include>
-			if (GSXML.getNamedElementNS(main, "http://www.w3.org/1999/XSL/Transform", "include", "href", node.getAttribute("href")) == null)
+			if (GSXML.getNamedElementNS(main, GSXML.XSL_NAMESPACE, "include", "href", node.getAttribute("href")) == null)
 			{
 				//main.appendChild(main_xsl.importNode(node, true));
@@ -112,8 +112,8 @@
 		} // for each include
 
-		if (main.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "output").getLength() == 0)
+		if (main.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "output").getLength() == 0)
 		{
 			// outputs
-			children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "output");
+			children = extra_xsl.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "output");
 			for (int i = 0; i < children.getLength(); i++)
 			{
@@ -128,5 +128,5 @@
 		// variables - only top level ones!!
 		// append to end of document
-		children = GSXML.getChildrenByTagNameNS(extra_xsl, "http://www.w3.org/1999/XSL/Transform", "variable");
+		children = GSXML.getChildrenByTagNameNS(extra_xsl, GSXML.XSL_NAMESPACE, "variable");
 		for (int i = 0; i < children.getLength(); i++)
 		{
@@ -134,5 +134,5 @@
 			// If the new xsl:import element is identical (in terms of href attr value) 
 			// to any in the merged document, don't copy it over
-			if (GSXML.getNamedElementNS(main, "http://www.w3.org/1999/XSL/Transform", "variable", "name", node.getAttribute("name")) == null)
+			if (GSXML.getNamedElementNS(main, GSXML.XSL_NAMESPACE, "variable", "name", node.getAttribute("name")) == null)
 			{
 				main.appendChild(main_xsl.importNode(node, true));
@@ -142,5 +142,5 @@
 		// params - only top level ones!!
 		// append to end of document
-		children = GSXML.getChildrenByTagNameNS(extra_xsl, "http://www.w3.org/1999/XSL/Transform", "param");
+		children = GSXML.getChildrenByTagNameNS(extra_xsl, GSXML.XSL_NAMESPACE, "param");
 		for (int i = 0; i < children.getLength(); i++)
 		{
@@ -148,5 +148,5 @@
 			// If the new xsl:import element is identical (in terms of href attr value) 
 			// to any in the merged document, don't copy it over
-			if (GSXML.getNamedElementNS(main, "http://www.w3.org/1999/XSL/Transform", "param", "name", node.getAttribute("name")) == null)
+			if (GSXML.getNamedElementNS(main, GSXML.XSL_NAMESPACE, "param", "name", node.getAttribute("name")) == null)
 			{
 				main.appendChild(main_xsl.importNode(node, true));
@@ -156,5 +156,5 @@
 		// templates
 		// append to end of document
-		children = extra_xsl.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "template");
+		children = extra_xsl.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "template");
 		for (int i = 0; i < children.getLength(); i++)
 		{
@@ -168,5 +168,5 @@
 			{
 				// if we have a name attribute, remove any other similarly named template
-				GSXML.removeElementsWithAttributesNS(main, "http://www.w3.org/1999/XSL/Transform", "template", new String[] { "name", "match", "mode" }, new String[] { template_name, template_match, template_mode });
+				GSXML.removeElementsWithAttributesNS(main, GSXML.XSL_NAMESPACE, "template", new String[] { "name", "match", "mode" }, new String[] { template_name, template_match, template_mode });
 
 				// now add our good template in
@@ -179,5 +179,5 @@
 				// there can't be any duplicate named templates, so just look for matches
 				// we already have the one with highest import precedence (from the top most level) so don't add any more in
-				if (GSXML.getElementsWithAttributesNS(main, "http://www.w3.org/1999/XSL/Transform", "template", new String[] { "name", "match", "mode" }, new String[] { template_name, template_match, template_mode }).getLength() == 0)
+				if (GSXML.getElementsWithAttributesNS(main, GSXML.XSL_NAMESPACE, "template", new String[] { "name", "match", "mode" }, new String[] { template_name, template_match, template_mode }).getLength() == 0)
 				{
 					main.appendChild(main_xsl.importNode(node, true));
@@ -204,5 +204,5 @@
 				Element xslParent = (Element) current.getParentNode();
 
-				while (xslParent.getNamespaceURI() != "http://www.w3.org/1999/XSL/Transform" && !xslParent.getNodeName().startsWith("xsl:"))
+				while (xslParent.getNamespaceURI() != GSXML.XSL_NAMESPACE && !xslParent.getNodeName().startsWith("xsl:"))
 				{
 					xslParent = (Element) xslParent.getParentNode();
@@ -220,10 +220,10 @@
 	}
 
-  public static void inlineImportAndIncludeFiles(Document doc, String pathExtra, String site, String collection, String interface_name, ArrayList<String> base_interfaces)
-	{
-	  inlineImportAndIncludeFilesDebug(doc, pathExtra, false, null, site, collection, interface_name, base_interfaces);
-	}
-
-  public static void inlineImportAndIncludeFilesDebug(Document doc, String pathExtra, boolean debug, String docFileName, String site, String collection, String interface_name, ArrayList<String> base_interfaces)
+	public static void inlineImportAndIncludeFiles(Document doc, String pathExtra, String site, String collection, String interface_name, ArrayList<String> base_interfaces)
+	{
+		inlineImportAndIncludeFilesDebug(doc, pathExtra, false, null, site, collection, interface_name, base_interfaces);
+	}
+
+	public static void inlineImportAndIncludeFilesDebug(Document doc, String pathExtra, boolean debug, String docFileName, String site, String collection, String interface_name, ArrayList<String> base_interfaces)
 	{
 		XMLConverter converter = new XMLConverter();
@@ -231,6 +231,6 @@
 		String path = (pathExtra == null) ? "" : pathExtra;
 
-		NodeList importList = doc.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "import");
-		NodeList includeList = doc.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "include");
+		NodeList importList = doc.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "import");
+		NodeList includeList = doc.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "include");
 
 		for (int i = 0; i < importList.getLength() + includeList.getLength(); i++)
@@ -243,6 +243,6 @@
 			try
 			{
-			  //Document inlineDoc = converter.getDOM(new File(filePath), "UTF-8");
-			  Document inlineDoc = mergedXSLTDocumentCascade(path+href, site, collection, interface_name, base_interfaces, debug);
+				//Document inlineDoc = converter.getDOM(new File(filePath), "UTF-8");
+				Document inlineDoc = mergedXSLTDocumentCascade(path + href, site, collection, interface_name, base_interfaces, debug);
 				String newPath = path;
 				int lastSepIndex = href.lastIndexOf("/");
@@ -253,7 +253,7 @@
 
 				//Do this recursively
-				inlineImportAndIncludeFilesDebug(inlineDoc, newPath, debug, "merged "+href/*filePath*/, site, collection, interface_name, base_interfaces);
-
-				GSXSLT.mergeStylesheetsDebug(doc, inlineDoc.getDocumentElement(), false, debug, docFileName, /*filePath*/"merged "+href);
+				inlineImportAndIncludeFilesDebug(inlineDoc, newPath, debug, "merged " + href/* filePath */, site, collection, interface_name, base_interfaces);
+
+				GSXSLT.mergeStylesheetsDebug(doc, inlineDoc.getDocumentElement(), false, debug, docFileName, /* filePath */"merged " + href);
 			}
 			catch (Exception ex)
@@ -276,8 +276,9 @@
 	}
 
-		public static Document mergedXSLTDocumentCascade(String xslt_filename, String site, String collection, String this_interface, ArrayList<String> base_interfaces, boolean debug) {
-		  XMLConverter converter = new XMLConverter();
-		  // find the list of stylesheets with this name
-		  ArrayList<File> stylesheets = GSFile.getStylesheetFiles(GlobalProperties.getGSDL3Home(), site, collection, this_interface, base_interfaces, xslt_filename);
+	public static Document mergedXSLTDocumentCascade(String xslt_filename, String site, String collection, String this_interface, ArrayList<String> base_interfaces, boolean debug)
+	{
+		XMLConverter converter = new XMLConverter();
+		// find the list of stylesheets with this name
+		ArrayList<File> stylesheets = GSFile.getStylesheetFiles(GlobalProperties.getGSDL3Home(), site, collection, this_interface, base_interfaces, xslt_filename);
 		if (stylesheets.size() == 0)
 		{
@@ -314,9 +315,7 @@
 	}
 
-
-
 	public static void modifyConfigFormatForDebug(Document doc, String fileName)
 	{
-		NodeList templateNodes = doc.getElementsByTagNameNS("http://www.w3.org/1999/XSL/Transform", "template");
+		NodeList templateNodes = doc.getElementsByTagNameNS(GSXML.XSL_NAMESPACE, "template");
 		if (templateNodes.getLength() == 0)
 		{
@@ -331,5 +330,5 @@
 
 		XMLConverter converter = new XMLConverter();
-		Element debugElement = (Element) converter.getDOM("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xslt:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:xslt=\"output.xsl\" xmlns:gsf=\"http://www.greenstone.org/greenstone3/schema/ConfigFormat\">" + debugElementString + "</xslt:stylesheet>").getDocumentElement().getFirstChild();
+		Element debugElement = (Element) converter.getDOM("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<xslt:stylesheet version=\"1.0\" xmlns:xsl=\"" + GSXML.XSL_NAMESPACE + "\" xmlns:xslt=\"output.xsl\" xmlns:gsf=\"" + GSXML.GSF_NAMESPACE + "\">" + debugElementString + "</xslt:stylesheet>").getDocumentElement().getFirstChild();
 
 		for (int i = 0; i < templateNodes.getLength(); i++)
@@ -419,6 +418,6 @@
 	public static void mergeFormatElements(Element mainFormat, Element secondaryFormat, boolean overwrite)
 	{
-		NodeList xslChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, "http://www.w3.org/1999/XSL/Transform", "variable");
-		NodeList gsfChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, "http://www.greenstone.org/greenstone3/schema/ConfigFormat", "variable");
+		NodeList xslChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, GSXML.XSL_NAMESPACE, "variable");
+		NodeList gsfChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, GSXML.GSF_NAMESPACE, "variable");
 		for (int i = 0; i < xslChildren.getLength() + gsfChildren.getLength(); i++)
 		{
@@ -430,6 +429,6 @@
 		}
 
-		xslChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, "http://www.w3.org/1999/XSL/Transform", "param");
-		gsfChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, "http://www.greenstone.org/greenstone3/schema/ConfigFormat", "param");
+		xslChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, GSXML.XSL_NAMESPACE, "param");
+		gsfChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, GSXML.GSF_NAMESPACE, "param");
 		for (int i = 0; i < xslChildren.getLength() + gsfChildren.getLength(); i++)
 		{
@@ -441,6 +440,6 @@
 		}
 
-		xslChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, "http://www.w3.org/1999/XSL/Transform", "template");
-		gsfChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, "http://www.greenstone.org/greenstone3/schema/ConfigFormat", "template");
+		xslChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, GSXML.XSL_NAMESPACE, "template");
+		gsfChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, GSXML.GSF_NAMESPACE, "template");
 		for (int i = 0; i < xslChildren.getLength() + gsfChildren.getLength(); i++)
 		{
@@ -457,6 +456,6 @@
 			{
 				// if we have a name attribute, remove any other similarly named template
-				GSXML.removeElementsWithAttributesNS(mainFormat, "http://www.w3.org/1999/XSL/Transform", "template", attributeNames, attributeValues);
-				GSXML.removeElementsWithAttributesNS(mainFormat, "http://www.greenstone.org/greenstone3/schema/ConfigFormat", "template", attributeNames, attributeValues);
+				GSXML.removeElementsWithAttributesNS(mainFormat, GSXML.XSL_NAMESPACE, "template", attributeNames, attributeValues);
+				GSXML.removeElementsWithAttributesNS(mainFormat, GSXML.GSF_NAMESPACE, "template", attributeNames, attributeValues);
 
 				// now add our good template in
@@ -476,9 +475,9 @@
 		}
 
-		gsfChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, "http://www.greenstone.org/greenstone3/schema/ConfigFormat", "option");
+		gsfChildren = GSXML.getChildrenByTagNameNS(secondaryFormat, GSXML.GSF_NAMESPACE, "option");
 		for (int i = 0; i < gsfChildren.getLength(); i++)
 		{
 			Element node = (Element) gsfChildren.item(i);
-			if (GSXML.getNamedElementNS(mainFormat, "http://www.greenstone.org/greenstone3/schema/ConfigFormat", "option", "name", node.getAttribute("name")) == null)
+			if (GSXML.getNamedElementNS(mainFormat, GSXML.GSF_NAMESPACE, "option", "name", node.getAttribute("name")) == null)
 			{
 				mainFormat.appendChild(node);
