Changeset 28947

Show
Ignore:
Timestamp:
24.03.2014 14:32:56 (6 years ago)
Author:
kjdon
Message:

need to import replacement node into current document before adding it in, otherwise get wrong document error

Files:
1 modified

Legend:

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

    r28382 r28947  
    256256                        { 
    257257                            Element parent = (Element) currentElem.getParentNode(); 
    258                             parent.insertBefore(replacementElem, currentElem); 
     258                            parent.insertBefore(parent.getOwnerDocument().importNode(replacementElem, true), currentElem); // wrong doc node!!! 
    259259                            parent.removeChild(currentElem); 
    260260                            break; 
     
    294294                        { 
    295295                            Element parent = (Element) currentElem.getParentNode(); 
    296                             parent.insertBefore(replacementElem, currentElem); 
     296                            parent.insertBefore(parent.getOwnerDocument().importNode(replacementElem,true), currentElem); 
    297297                            parent.removeChild(currentElem); 
    298298                            break;