Changeset 16515

Show
Ignore:
Timestamp:
23.07.2008 12:19:52 (11 years ago)
Author:
davidb
Message:

encodeURL altered to take Node rather than Element.

Location:
greenstone3/trunk/src/java/org/greenstone/gsdl3
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/LibraryServlet.java

    r16374 r16515  
    499499     
    500500    Node xml_result = this.recept.processToPage (xml_message); 
    501     // encodeURLs (xml_result, response); 
     501    encodeURLs (xml_result, response); 
    502502    out.println (this.converter.getPrettyString (xml_result)); 
    503503     
     
    536536   * also escapes things if needed 
    537537   */ 
    538   protected void encodeURLs(Element data, HttpServletResponse response) { 
    539      
    540     if (data == null) { 
     538  protected void encodeURLs(Node dataNode, HttpServletResponse response) { 
     539     
     540    if (dataNode == null) { 
    541541      return; 
    542542    } 
     543 
     544    Element data =null; 
     545 
     546    short nodeType = dataNode.getNodeType(); 
     547    if (nodeType == Node.DOCUMENT_NODE) { 
     548    Document docNode = (Document)dataNode; 
     549    data = docNode.getDocumentElement() ; 
     550    } 
     551    else { 
     552    data = (Element)dataNode; 
     553    } 
     554 
    543555    // get all the <a> elements 
    544556    NodeList hrefs = data.getElementsByTagName("a"); 
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/core/Receptionist.java

    r16374 r16515  
    147147    } 
    148148    else { 
     149        System.err.println("Receptionist.process was not returned a document node"); 
    149150        return null; 
    150151    }