xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Kelly" <ke...@ad1440.net>
Subject Re: Question about document type nodes and JAXP
Date Wed, 18 Oct 2000 17:07:40 GMT
> OK, how do I get the first instance of DOMImplementation so I can create
> DocumentType before I create the Document?  I can only find a way to get a
> DOMImplementation if I already have a Document.

Document toss = new org.apache.xerces.dom.DocumentImpl();
DOMImplementation impl = toss.getImplementation();
DocumentType type = impl.createDocumentType("root",
  "-//MyOrg//DTD Root 1.0//EN", http://my.org/root.dtd);
Document doc = impl.createDocument("rootns", "root", type);
// then add nodes to "doc"


View raw message