Changeset 16780

Show
Ignore:
Timestamp:
14.08.2008 11:22:11 (11 years ago)
Author:
ak19
Message:

Made new nodeToElement method in XMLConverter static so that some classes that need to use just this method, don't have to instantiate an XMLConverter containing DOMParser and all merely to use this method.

Files:
1 modified

Legend:

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

    r16690 r16780  
    8383    } 
    8484 
    85  
    86     public Element nodeToElement(Node node) 
     85    /** Given a Node representing an Element or Document, will return the  
     86     * Element/docroot Element. Returns null if the Node was not an element. */ 
     87    public static Element nodeToElement(Node node) 
    8788    { 
    8889    short nodeType = node.getNodeType(); 
     
    9697    } 
    9798    else { 
    98         System.err.println("Expecting Document or Element node type but got " + node.getNodeName()); 
    99         System.err.println("Returning null"); 
     99        String message = "Expecting Document or Element node type but got "  
     100        + node.getNodeName() + "\nReturning null"; 
     101        System.err.println(message); 
     102        logger.warn(message); 
    100103        return null; 
    101104    }