Dolda2000 GitWeb
/
jsvc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improved the DocBuffer and DOM writers to where they are kind of usable.
[jsvc.git]
/
src
/
dolda
/
jsvc
/
next
/
DocBuffer.java
diff --git
a/src/dolda/jsvc/next/DocBuffer.java
b/src/dolda/jsvc/next/DocBuffer.java
index
b2d1f0a
..
2690309
100644
(file)
--- a/
src/dolda/jsvc/next/DocBuffer.java
+++ b/
src/dolda/jsvc/next/DocBuffer.java
@@
-46,7
+46,9
@@
public class DocBuffer {
Node c = cursor(cursor);
if(c == null)
throw(new RuntimeException("No such cursor: `" + cursor + "'"));
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 Element makecursor(String name) {
@@
-69,6
+71,8
@@
public class DocBuffer {
}
public Text text(String text) {
}
public Text text(String text) {
+ if(text == null)
+ return(null);
return(doc.createTextNode(text));
}
return(doc.createTextNode(text));
}