in reply to Re: Re: So Simple, Yet no tutorial covers it
in thread So Simple, Yet no tutorial covers it

I do not know of a module which will change HTML into XML directly

Install XML::Pyx and HTML::Parser, then do :

pyxhtml myfile.html | pyxw > myfile.xhtml

Et voila!

Of course if your original HTML is full of font tags and the likes it might be quite difficult to do anything even with the XML version.

And as merlyn would mention if he was around development on HTML has stopped at the W3C and XHTML is the official successor and it _is_ XML compliant (although nothing is quite that simple and some XML tools, especially editors, might not quite like it).

And now is time for one of my pet peeves: As for using XML::DOM, quite frankly I don't know anybody who has used the DOM and who likes it. And that includes me and several other people who have written DOM tutorials! If you're looking at XML modules XML::Pyx is great for simple processing, XML::Simple would also work for something like the original format, of course my own XML::Twig works fine, and finally if you want to use DOM-like objects XML::XPath is probably much easier to use, besides being faster, more powerful and better supported. OK, I think that was the last time I bother you with my anti-DOM crusade! Actually I am not alone there, the people who wrote JDOM used to have a "Say NO to DOM" logo.

Replies are listed 'Best First'.
Re: Re: Re: Re: So Simple, Yet no tutorial covers it
by sierrathedog04 (Hermit) on Jan 22, 2001 at 21:06 UTC
    Right now I have only used the XML DOM for one project. Navigation of the DOM tree is hard for me to follow. My hope had been that as I got more used to the DOM it would become second nature to me.

    Your post leads me to believe that the problems with using the DOM directly are not going to go away as I become more familiar with it.

    I am wondering whether for me XML::XPath for me might be the way to go. XPath is a W3C standard and a variety of languages implement it. At my company we may shift our development work from Perl to Java someday and I would like to be able to continue to use the same XML tools in Java as those I know and love in Perl.