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.


In reply to Re: Re: Re: So Simple, Yet no tutorial covers it by mirod
in thread So Simple, Yet no tutorial covers it by Jrchak

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.