1 package dolda.jsvc.next;
5 public class Html extends DocBuffer {
6 public static final String ns = "http://www.w3.org/1999/xhtml";
8 private Html(String pubid, String sysid) {
9 super(ns, "html", "html", pubid, sysid);
12 public static Html xhtml11(String title) {
13 Html buf = new Html("-//W3C//DTD XHTML 1.1//EN", "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd");
14 Node html = buf.doc.getDocumentElement();
15 Node head = DomUtil.insertel(html, "head");
16 head.appendChild(buf.makecursor("head"));
17 Node tit = DomUtil.insertel(head, "title");
18 DomUtil.inserttext(tit, title);
19 Node body = DomUtil.insertel(html, "body");
20 body.appendChild(buf.makecursor("body"));
24 public Element el(String name, Node contents, String... attrs) {
25 return(el(ns, name, contents, attrs));
28 public Element csslink(String href, String name) {
29 Element el = el("link", null, "rel=stylesheet", "type=text/css");
31 el.setAttribute("title", name);
32 el.setAttribute("href", href);
36 public void addcss(String href, String name) {
37 insert("head", csslink(href, name));