MKDoc::XML::Stripper 0.75 review

Download
by rbytes.net on

MKDoc::XML::Stripper is a Perl module to remove unwanted XML / XHTML tags and attributes. SYNOPSIS use MKDoc::XML::Stripper;

License: Perl Artistic License
File size: 40K
Developer: Jean-Michel Hiver
0 stars award from rbytes.net

MKDoc::XML::Stripper is a Perl module to remove unwanted XML / XHTML tags and attributes.

SYNOPSIS

use MKDoc::XML::Stripper;

my $stripper = new MKDoc::XML::Stripper;
$stripper->allow (qw /p class id/);

my $ugly = '< p class="para" style="color:red" >Hello, < strong >World< /strong >!< /p >';
my $neat = $stripper->process_data ($ugly);
print $neat;
Should print:
< p class="para" >Hello, World!< /p >

MKDoc::XML::Stripper is a class which lets you specify a set of tags and attributes which you want to allow, and then cheekily strip any XML of unwanted tags and attributes.

In MKDoc, this is used so that editors use structural XHTML rather than presentational tags, i.e. strip anything which looks like a tag, a 'style' attribute or other tags which would break separation of structure from content.

Requirements:
Perl

MKDoc::XML::Stripper 0.75 keywords