Ignore:
Timestamp:
2007-07-09T10:28:07+12:00 (17 years ago)
Author:
xiao
Message:

change getFirstChild() to getFirstElementChild() in case an extra line break or white space added before the first element child which might cause a cast exception.

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

Legend:

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

    r13270 r14226  
    6363        // get the applet data out and pass it back as is.
    6464        String path = GSPath.appendLink(GSXML.RESPONSE_ELEM, GSXML.APPLET_DATA_ELEM);
    65         Element applet_info = (Element)GSXML.getNodeByPath(mr_response, path).getFirstChild();
     65Element applet_info = GSXML.getFirstElementChild(GSXML.getNodeByPath(mr_response, path));
     66        //Element applet_info = (Element)GSXML.getNodeByPath(mr_response, path).getFirstChild();
    6667        return applet_info;
    6768       
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/action/NoCollQueryAction.java

    r13270 r14226  
    153153    Document owner = result_list.getOwnerDocument();
    154154    Node child = from_list.getFirstChild();
    155     while (child != null) {
     155    while (child != null && child.getNodeType() == Node.ELEMENT_NODE) {
    156156        ((Element)child).setAttribute("collection", collection);
    157157        result_list.appendChild(owner.importNode(child, true));
Note: See TracChangeset for help on using the changeset viewer.