Ask a Question related to Perl / CGI, Design and Development.
-
Ilya Zakharevich #1
HTML to XML in Perl?
Suppose I want to translate an HTML to a XML-well-formed HTML (so that
I can, e.g., apply xsltproc to the result). E.g., HTML::TreeBuilder
can apply "usual heuristics" to parse HTML; how to get XML out of it?
Thanks,
Ilya
Ilya Zakharevich Guest
-
Quick Perl, HTML, CSS, JavaScript reference
Found this site with lot's of help for different technologies. Find and click on Perl on technology list. http://www.gotapi.com Im wondering if... -
rendering html from perl
On Friday, Nov 14, 2003, at 02:29 US/Pacific, john@shortstay-london.com wrote: From: drieux Sent: 15 November 2003 17:13 I'm not sure I... -
executing perl scripts from php/html
On Thu, 28 Aug 2003 01:57:49 -0500, in message <3f4da7e9$0$6524$afc38c87@news.optusnet.com.au>, the AI program named "Leandra"... -
Perl-CGI: Return HTML and then a file problem
Hi I run a couple of Perl-CGIs under the latest Apache on my Red Hat box. I have now come across a problem. From my script, I'd first like to... -
how to send html email from perl
I just had the same question, and found that the following works. If you're using the "sendmail" package (see... -
John Bokma #2
Re: HTML to XML in Perl?
Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote:
Question: I use XML, not XHTML, at home, and use XML::Twig to convert it> Suppose I want to translate an HTML to a XML-well-formed HTML (so that
> I can, e.g., apply xsltproc to the result). E.g., HTML::TreeBuilder
> can apply "usual heuristics" to parse HTML; how to get XML out of it?
to HTML. I can use xsltproc if I want to on the XML file.
You might want to traverse the parse tree HTML::TreeBuilder generates.
Also, not 100% sure, but it might me that HTML tidy can do the XHTML
conversion for you:
Google...
"Validator fixes errors in HTML and XHTML. Converts HTML to XHTML. Free
Software."
[url]http://www.google.com/search?q=html%20tidy%20xhtml[/url]
Sounds like it does :-D.
--
John Bokma Freelance software developer
&
Experienced Perl programmer: [url]http://castleamber.com/[/url]
John Bokma Guest
-
mirod #3
Re: HTML to XML in Perl?
HTML::TreeBuilder has an as_XML method that does a pretty good job at getting proper XML from any HTML. It's not 100% reliable, but it mostly works.
I found HTML::TreeBuilder to be more useful for converting HTML to XML than XML::LibXML, which does not parse a lot of crappy HTML, and than HTML::Tidy, which is (was?) a pain to use.
Junior Member
- Join Date
- Aug 2010
- Posts
- 1



Reply With Quote


