Dolda2000 GitWeb
/
jsvc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added some minor HTML utilities.
[jsvc.git]
/
src
/
dolda
/
jsvc
/
next
/
XmlWriter.java
diff --git
a/src/dolda/jsvc/next/XmlWriter.java
b/src/dolda/jsvc/next/XmlWriter.java
index
a1004e4
..
a5e698e
100644
(file)
--- a/
src/dolda/jsvc/next/XmlWriter.java
+++ b/
src/dolda/jsvc/next/XmlWriter.java
@@
-7,7
+7,7
@@
import dolda.jsvc.util.Misc;
public class XmlWriter {
private Map<String, String> nsnames = new HashMap<String, String>();
public class XmlWriter {
private Map<String, String> nsnames = new HashMap<String, String>();
- p
rivate
Document doc;
+ p
ublic final
Document doc;
private int nsser = 1;
public XmlWriter(Document doc) {
private int nsser = 1;
public XmlWriter(Document doc) {
@@
-146,7
+146,7
@@
public class XmlWriter {
}
protected void text(ColumnWriter out, String s, int indent) throws IOException {
}
protected void text(ColumnWriter out, String s, int indent) throws IOException {
- out.write(
s
);
+ out.write(
Misc.htmlq(s)
);
}
protected void text(ColumnWriter out, Text txt, int indent) throws IOException {
}
protected void text(ColumnWriter out, Text txt, int indent) throws IOException {
@@
-176,12
+176,16
@@
public class XmlWriter {
}
}
}
}
+ protected void doctype(ColumnWriter out, DocumentType dt) throws IOException {
+ out.write(String.format("<!DOCTYPE %s PUBLIC \"%s\" \"%s\">\n", dt.getName(), dt.getPublicId(), dt.getSystemId()));
+ }
+
public void write(Writer out) throws IOException {
findallnsnames();
ColumnWriter col = new ColumnWriter(out);
DocumentType t = doc.getDoctype();
if(t != null)
public void write(Writer out) throws IOException {
findallnsnames();
ColumnWriter col = new ColumnWriter(out);
DocumentType t = doc.getDoctype();
if(t != null)
-
out.write(String.format("<!DOCTYPE %s PUBLIC \"%s\" \"%s\">\n", t.getName(), t.getPublicId(), t.getSystemId())
);
+
doctype(col, t
);
node(col, doc.getDocumentElement(), 0);
}
node(col, doc.getDocumentElement(), 0);
}