xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwin Goei <Edwin.G...@eng.sun.com>
Subject Re: Question about document type nodes and JAXP
Date Wed, 18 Oct 2000 18:26:20 GMT
Arnaud Le Hors wrote:
> 
> I wish JAXP addressed this problem but it doesn't either. :-(

Actually, it sort of does.  You can do something like this:

DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
org.w3c.dom.Document toss = db.newDocument();  // throw away this
Document object
DOMImplementation impl = toss.getImplementation();

Having to throw away the Document object that first gets created is a
wart IMHO.  I've lobbied to fix this in the new JAXP spec by adding
method to get the DOMImplementation directly, but it does not look like
it got added.  Also, the code above needs to be wrapped in a try/catch
block to catch some exceptions.

-Edwin

Mime
View raw message