Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java	(revision 37957)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/GS2BrowseAction.java	(revision 37958)
@@ -218,91 +218,92 @@
 		{
 	  
-			//If we have a horizontal classifier and we have had the top-level node requested (e.g. CL1, CL2 etc.)
-			//then we want to get the children of the first classifier node (e.g. the children of CL2.1) 
-		  if (OID.isTop(classifier_node)) {
+		    
+		    //If we have a horizontal classifier and we have had the top-level node requested (e.g. CL1, CL2 etc.)
+		    //then we want to get the children of the first classifier node (e.g. the children of CL2.1) 
+		    if (OID.isTop(classifier_node)) {
 			
-				boolean firstChildIsClassifierNode = false;
-				NodeList classifierChildrenNodes = GSXML.getChildrenByTagName(cl_structure, GSXML.CLASS_NODE_ELEM);
-				for (int i = 0; i < classifierChildrenNodes.getLength(); i++)
-				{
-					Element currentChild = (Element) classifierChildrenNodes.item(i);
-					if (currentChild.getAttribute(GSXML.NODE_ID_ATT).endsWith(".1"))
-					{
-						firstChildIsClassifierNode = true;
+			boolean firstChildIsClassifierNode = false;
+			NodeList classifierChildrenNodes = GSXML.getChildrenByTagName(cl_structure, GSXML.CLASS_NODE_ELEM);
+			for (int i = 0; i < classifierChildrenNodes.getLength(); i++)
+			    {
+				Element currentChild = (Element) classifierChildrenNodes.item(i);
+				if (currentChild.getAttribute(GSXML.NODE_ID_ATT).endsWith(".1"))
+				    {
+					firstChildIsClassifierNode = true;
+				    }
+			    }
+
+			if (firstChildIsClassifierNode)
+			    {
+				// get the children of the first child
+				Element childStructure = getClassifierChildrenFromID(doc, classifier_node + ".1", request, collection, service_name);
+
+				// and now insert it into the structure we already have
+				NodeList nodesToSearch = cl_structure.getElementsByTagName(GSXML.CLASS_NODE_ELEM);
+				for (int i = 0; i < nodesToSearch.getLength(); i++)
+				    {
+					Element currentElem = (Element) nodesToSearch.item(i);
+					if (currentElem.getAttribute(GSXML.NODE_ID_ATT).equals(classifier_node + ".1"))
+					    {
+						Element parent = (Element) currentElem.getParentNode();
+						parent.insertBefore(cl_struct_doc.importNode(childStructure, true), currentElem); 
+						parent.removeChild(currentElem);
+						break;
+					    }
+				    }
+			    }
+		    } // if OID.isTop(classifier_node)
+		    //If we have a horizontal classifier and we have NOT had the top-level node requested then we need to 
+		    //make sure we get the full list of top-level children to display (e.g. if the user has requested
+		    //CL2.1.1 we also need to make sure we have CL2.2, CL2.3, CL2.4 etc.)
+		    else
+			{
+			    // we need to get siblings of any HList nodes so the HLists remain expanded in the display
+			    // start at the bottom (the specified element) and work up teh list of parents expanding any that have hlists
+			    NodeList elems = GSXML.getNamedElements(cl_structure, GSXML.CLASS_NODE_ELEM, GSXML.NODE_ID_ATT, classifier_node);
+			    Element current_node = null;
+			    String current_id = classifier_node;
+			    if (elems != null) {
+				// there should only be one node in the list
+				current_node = (Element)elems.item(0);
+			    }
+			    if (current_node != null) {
+				Element parent_node = (Element)current_node.getParentNode();
+				while(parent_node != null && parent_node.getNodeName().equals(GSXML.CLASS_NODE_ELEM)) {
+				    if (((Element)parent_node).getAttribute(GSXML.CHILD_TYPE_ATT).equals(GSXML.HLIST)) {
+					// get the children of the parent
+					Element new_parent_elem = getClassifierChildrenFromID(cl_struct_doc, parent_node.getAttribute(GSXML.NODE_ID_ATT), request, collection, service_name);
+
+					// put current node into this new structure
+					Element to_be_replaced = GSXML.getNamedElement(new_parent_elem, GSXML.CLASS_NODE_ELEM, GSXML.NODE_ID_ATT, current_id);
+					if (to_be_replaced != null) {
+					    new_parent_elem.insertBefore(current_node, to_be_replaced);
+					    new_parent_elem.removeChild(to_be_replaced);
+					    if (OID.isTop(parent_node.getAttribute(GSXML.NODE_ID_ATT))) {
+						// we can't go up any further.
+						cl_structure = new_parent_elem;
+						parent_node = null;
+
+					    } else {
+						Element next_parent = (Element)parent_node.getParentNode();
+						next_parent.insertBefore(new_parent_elem, parent_node );
+						next_parent.removeChild(parent_node);
+						current_node = new_parent_elem;
+						current_id = current_node.getAttribute(GSXML.NODE_ID_ATT);
+						parent_node = next_parent;
+					    }
+					} else {
+					    // something went wrong, we'll stop this
+					    parent_node = null;
 					}
+				    } else {
+					current_node = parent_node;
+					current_id = current_node.getAttribute(GSXML.NODE_ID_ATT);
+					parent_node = (Element)current_node.getParentNode();
+				    }
 				}
-
-				if (firstChildIsClassifierNode)
-				{
-				  // get the children of the first child
-					Element childStructure = getClassifierChildrenFromID(doc, classifier_node + ".1", request, collection, service_name);
-
-					// and now insert it into the structure we already have
-					NodeList nodesToSearch = cl_structure.getElementsByTagName(GSXML.CLASS_NODE_ELEM);
-					for (int i = 0; i < nodesToSearch.getLength(); i++)
-					{
-						Element currentElem = (Element) nodesToSearch.item(i);
-						if (currentElem.getAttribute(GSXML.NODE_ID_ATT).equals(classifier_node + ".1"))
-						{
-							Element parent = (Element) currentElem.getParentNode();
-							parent.insertBefore(cl_struct_doc.importNode(childStructure, true), currentElem); 
-							parent.removeChild(currentElem);
-							break;
-						}
-					}
-				}
-		  } // if OID.isTop(classifier_node)
-			//If we have a horizontal classifier and we have NOT had the top-level node requested then we need to 
-			//make sure we get the full list of top-level children to display (e.g. if the user has requested
-			//CL2.1.1 we also need to make sure we have CL2.2, CL2.3, CL2.4 etc.)
-		  else
-		    {
-		      // we need to get siblings of any HList nodes so the HLists remain expanded in the display
-		      // start at the bottom (the specified element) and work up teh list of parents expanding any that have hlists
-		      NodeList elems = GSXML.getNamedElements(cl_structure, GSXML.CLASS_NODE_ELEM, GSXML.NODE_ID_ATT, classifier_node);
-		      Element current_node = null;
-		      String current_id = classifier_node;
-		      if (elems != null) {
-			// there should only be one node in the list
-			current_node = (Element)elems.item(0);
-		      }
-		      if (current_node != null) {
-			Element parent_node = (Element)current_node.getParentNode();
-			while(parent_node != null && parent_node.getNodeName().equals(GSXML.CLASS_NODE_ELEM)) {
-			  if (((Element)parent_node).getAttribute(GSXML.CHILD_TYPE_ATT).equals(GSXML.HLIST)) {
-			    // get the children of the parent
-			    Element new_parent_elem = getClassifierChildrenFromID(cl_struct_doc, parent_node.getAttribute(GSXML.NODE_ID_ATT), request, collection, service_name);
-
-			    // put current node into this new structure
-			    Element to_be_replaced = GSXML.getNamedElement(new_parent_elem, GSXML.CLASS_NODE_ELEM, GSXML.NODE_ID_ATT, current_id);
-			    if (to_be_replaced != null) {
-			      new_parent_elem.insertBefore(current_node, to_be_replaced);
-			      new_parent_elem.removeChild(to_be_replaced);
-			      if (OID.isTop(parent_node.getAttribute(GSXML.NODE_ID_ATT))) {
-				// we can't go up any further.
-				cl_structure = new_parent_elem;
-				parent_node = null;
-
-			      } else {
-				Element next_parent = (Element)parent_node.getParentNode();
-				next_parent.insertBefore(new_parent_elem, parent_node );
-				next_parent.removeChild(parent_node);
-				current_node = new_parent_elem;
-				current_id = current_node.getAttribute(GSXML.NODE_ID_ATT);
-				parent_node = next_parent;
-			      }
-			    } else {
-			      // something went wrong, we'll stop this
-			      parent_node = null;
-			    }
-			  } else {
-			    current_node = parent_node;
-			    current_id = current_node.getAttribute(GSXML.NODE_ID_ATT);
-			    parent_node = (Element)current_node.getParentNode();
-			  }
-			}
-		      } // if current_node != null
+			    } // if current_node != null
 		      
-		    }
+			}
 		}
 
