Changeset 16783

Show
Ignore:
Timestamp:
14.08.2008 12:06:30 (11 years ago)
Author:
ak19
Message:

Since XMLConverter method nodeToElement() has now been made static, need not create an instance of it (complete with DOMParser and all) merely to call this method.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/resources/java/SOAPServer.java.in

    r16756 r16783  
    2424import org.greenstone.gsdl3.util.GSFile; 
    2525import org.greenstone.gsdl3.util.GSXML; 
     26import org.greenstone.gsdl3.util.XMLConverter; 
    2627import org.w3c.dom.Element; 
    2728import org.w3c.dom.Node; 
    28 import org.w3c.dom.Document; 
    2929import java.io.File; 
    3030 
     
    7676        } 
    7777        Element new_req = GSXML.duplicateWithNewName(req.getOwnerDocument(), req, tag_name, true); 
    78         Element r = nodeToElement(mr.process(new_req)); 
     78        Node n = mr.process(new_req); 
     79        Element r = XMLConverter.nodeToElement(n); 
    7980        // add the namespace back on 
    8081        //Element new_res = r; 
     
    8687    return result; 
    8788    } 
    88  
    89     protected Element nodeToElement(Node node) 
    90     { 
    91     short nodeType = node.getNodeType(); 
    92  
    93     if (nodeType == Node.DOCUMENT_NODE) { 
    94         Document docNode = (Document)node; 
    95         return docNode.getDocumentElement() ; 
    96     } 
    97     else if (nodeType == Node.ELEMENT_NODE) { 
    98         return (Element)node; 
    99     } 
    100     else { 
    101         System.err.println("Expecting Document or Element node type but got " + node.getNodeName()); 
    102         System.err.println("Returning null"); 
    103         return null; 
    104     } 
    105     } 
    10689} 
    10790