in reply to Repair malformed XML
The quick and dirty hack below could repair your badly formatted XML snippet (after adding the missing namespace declarations):
Note that, however, I am not entirely sure that it always gueesses right on adding the remaining closing tags back, so I would not rely on this feature...use XML::LibXML; my $parser = XML::LibXML->new(); $parser->recover(1); my $doc = $parser->parse_file($ARGV[0]); print $doc->toString(1);
rg0now
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Repair malformed XML
by spoulson (Beadle) on Feb 03, 2005 at 20:54 UTC | |
|
Re^2: Repair malformed XML
by spoulson (Beadle) on Feb 03, 2005 at 16:55 UTC | |
by Tanktalus (Canon) on Feb 03, 2005 at 17:25 UTC | |
by spoulson (Beadle) on Feb 03, 2005 at 18:23 UTC | |
by rg0now (Chaplain) on Feb 03, 2005 at 17:38 UTC | |
by spoulson (Beadle) on Feb 03, 2005 at 17:55 UTC |