1 package dolda.jsvc.next;
4 import org.w3c.dom.bootstrap.*;
7 private static final DOMImplementation domimp;
10 DOMImplementationRegistry reg;
12 reg = DOMImplementationRegistry.newInstance();
13 } catch(Exception e) {
16 DOMImplementation di = reg.getDOMImplementation("");
18 throw(new RuntimeException("Could not get a DOM implemenation"));
22 public static Document document(String ns, String root, String doctype, String pubid, String sysid) {
24 return(domimp.createDocument(ns, root, null));
26 return(domimp.createDocument(ns, root, domimp.createDocumentType(doctype, pubid, sysid)));
29 public static Document document(String ns, String root) {
30 return(document(ns, root, null, null, null));
33 public static Element insertel(Node p, String nm) {
35 if(p instanceof Document)
38 doc = p.getOwnerDocument();
39 Element el = doc.createElementNS(p.getNamespaceURI(), nm);
44 public static Text inserttext(Node p, String text) {
46 if(p instanceof Document)
49 doc = p.getOwnerDocument();
50 Text t = doc.createTextNode(text);