X-Git-Url: http://git.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Fdolda%2Fjsvc%2Fnext%2FXmlWriter.java;h=a5e698e1920ae47e3c8715061478a4835efbec80;hb=cb67d09c40c80d0389d7a0a796a4abf0007f61a6;hp=a1004e44e137cfafb120abc24301f9d6f5e41f80;hpb=89fea15a17771683e26e6f917c6409eda74fdbb0;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); }