X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fdolda%2Fjsvc%2Fnext%2FXmlWriter.java;h=a5e698e1920ae47e3c8715061478a4835efbec80;hb=c39ae6d24864244eab704dea7307f769f2f2e9da;hp=a1004e44e137cfafb120abc24301f9d6f5e41f80;hpb=938bdee151320b80b6f2b0dbb01c375a012e1aa4;p=jsvc.git diff --git a/src/dolda/jsvc/next/XmlWriter.java b/src/dolda/jsvc/next/XmlWriter.java index a1004e4..a5e698e 100644 --- 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 nsnames = new HashMap(); - private Document doc; + public final 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 { - out.write(s); + out.write(Misc.htmlq(s)); } 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("\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) - out.write(String.format("\n", t.getName(), t.getPublicId(), t.getSystemId())); + doctype(col, t); node(col, doc.getDocumentElement(), 0); }