in reply to Re^2: read a file and insert closing tags if not present
in thread read a file and insert closing tags if not present
HTML::TreeBuilder handles that simple case:
use strict; use warnings; use HTML::TreeBuilder; my $sgml = <<SGML; <greeting class="simple">Hello, world! SGML my $root = HTML::TreeBuilder->new (); $root->ignore_unknown (0); $root->parse ($sgml); print $root->guts (0)->as_XML ();
Prints:
<greeting class="simple">Hello, world!</greeting>
although I'd not guarantee it will accept everything a real SGML document may contain.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: read a file and insert closing tags if not present
by valavanp (Curate) on Mar 29, 2007 at 09:45 UTC |