Barrie Slaymaker > XML-Filter-TableWrapper > XML::Filter::TableWrapper

Download:
XML-Filter-TableWrapper-0.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.02   Source  

NAME ^

XML::Filter::TableWrapper - Wrap a table's cells in to a certain number of rows

SYNOPSIS ^

    use XML::Filter::TableWrapper;
    use XML::SAX::Machines qw( Pipeline );

    ## Ouput a table with 5 rows, the last row having 3 cells:
    Pipeline(
        XML::Filter::TableWrapper->new(
            Columns => 3,   # The default is 5
        ),
        \*STDOUT,
    )->parse_string( "<table>" . "<td/>" x 23 . "</table" );

DESCRIPTION ^

Takes a list of elements and inserts (by default) <tr>...</tr> elements to make an table with a specified number of columns (5 by default). By default, it assumes that the container element is named "{}table" (the "{}" means it is not namespaced), but this can be changed:

    XML::Filter::TableWrapper->new(
        ListTags => "{$my_ns}rows",
        Columns  => 3,
    );

for instance.

LIMITATIONS ^

These can be read as possible future features:

Columns
    $h->Columns( 1024 );
    my $columns = $h->Columns;

Set/get the number of columns to wrap to.

syntax highlighting: