Re: DOMElementImpl

Philippe QUERREC wrote:
> 
> When we extract a DOM tree of a stream from an URL, we can't use it with
> Xerces, because we have org.w3c.tidy.DOMElementImpl element instead of Node
> element. Is there any cast available in any code fragments ?
> 
> Actually, I write the DOM on disk, and re-open it as a XML file, it works
> but use too many i/o instructions.
> 
> Thanks for your help
> Pils

Pils --

I assume you're talking about JTidy here.  DOMElementImpl does extend
DOMNodeImpl which implements org.w3c.dom.Node.  So a DOMElementImpl is a
Node.  Unfortunately, there is no other cast available here.  You'd have
to walk the JTidy DOM tree and generate calls to Xerces to build your
DOM there.

We do have SAX support forthcoming for JTidy.  Not sure when it will be
available but, when it is, you'll be able to fire SAX events from JTidy
and use Xerces as your ContentHandler and get full Xerces functionality.

Gary

Received on Tuesday, 28 November 2000 12:38:11 UTC