On Saturday 10 August 2002 09:24 pm, Bjoern Hoehrmann wrote:
> * Sean M. Burke wrote:
> >At 20:20 2002-08-09 -0500, Tom wrote:
> >>[...]Three of them are already available on CPAN, so I'm currently
> >>focusing on
> >>implementing the HTML::DOM module.
> >>
> >>Any comments?
> >
> >Yes: I'm happy someone's actually doing this!  For ages, this JavaScript
> >thing has been one of those projects where people keep saying "Boy, it'd
> > be nice if SOMEONE (and not me!) went and did that".
>
> Guilty...

...um...me too, until recently...

>
> Tom, are you going to implement HTML DOM Level 1 or Level 2? The latter
> is currently a working draft and has only minor changes, but those
> changes are necessary in order to support XHTML and I would like to use
> a HTML::DOM module for both, HTML and XHTML files.
>

I was planning on using Level 1 only and making HTML::DOM inherit from 
XML::DOM, but that won't work mainly because future plans for allowing access 
from the JavaScript.pm module require a blessed hashref implementation, and 
XML::DOM uses blessed listref implementation, so any subclasses would need to 
use at as well.  The impedance mismatch trying to subclass XML::DOM and 
provide the hashref interface for JavaScript at the same time are too 
complicated for me, so I'll invoke laziness (or false laziness) and implement 
the fundamental DOM level 2 spec as part of a level 2 HTML::DOM.  I don't 
know all the much about XHTML except that it is HTML that is also 
correctly-formed XML.  Does it require the extended interfaces in the core 
DOM level 2 (such as processing instructions, etc)?  Any information on the 
uses of XHTML beyond replacing HTML would be helpful.

> >I'd love to change my HTML::DOMbo module to build HTML::DOM trees instead
> >of XML::DOM trees, since I've heard that the latter class isn't well
> > supported.

Cool.  I was planning on using HTML::TreeBuilder to parse the HTML in 
Web::Browser, then convert it to an XML::DOM with HTML::DOMbo, then "upcast" 
the XML::DOM to an HTML::DOM but it won't work like that (see above), so this 
will actually save me a lot of time.  :-)

My final goal is the Web::Browser module so I can script website interaction, 
so I'm treading on things I won't claim to fully understand (like the DOM) to 
get there.  I've got the basic idea for the DOM structure in place, but it's 
far from fully implemented.  I'm writing the API and the tests first (Mr. 
Schwern would be proud), and I keep tossing around different ways of doing 
things and reading as much similar code as possible.  I guess I'm using the 
"design by inspiration" method right now, which means my CVS repository is 
very cluttered...

>
> Please be sure to provide a PerlSAX2 Reader and a PerlSAX2 Writer in
> order to enable XML modules to use your tree.

Either that or provide a way to convert to/from XML::DOM trees so the existing 
readers/writers for standard XML::DOM work.  Any opinions on how this is 
good/bad/ugly/etc?

Thanks for all the input!

-Tom

Reply via email to