Node c = cursor(cursor);
if(c == null)
throw(new RuntimeException("No such cursor: `" + cursor + "'"));
- c.getParentNode().insertBefore(doc.importNode(n, true), c);
+ if(n.getOwnerDocument() != doc)
+ n = doc.importNode(n, true);
+ c.getParentNode().insertBefore(n, c);
}
public Element makecursor(String name) {
}
public Text text(String text) {
+ if(text == null)
+ return(null);
return(doc.createTextNode(text));
}