X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FHTML%2FElement%2FLibrary.pod;h=d3675e2809072b1c184c84431fbfe3c5c44e5ed3;hb=c978a62d4df31421ab1da8aab452d3e3c871d6a1;hp=c7cde764c2da5f3504d1b0e54570382bd6167287;hpb=d161c455bd0d5835fca07d91ac428da07f47136b;p=html-element-library.git diff --git a/lib/HTML/Element/Library.pod b/lib/HTML/Element/Library.pod index c7cde76..d3675e2 100644 --- a/lib/HTML/Element/Library.pod +++ b/lib/HTML/Element/Library.pod @@ -1089,27 +1089,89 @@ to display: +=head2 Tree-Killing Methods +=head3 $tree->prune -=head1 SEE ALSO +This removes any nodes from the tree which consist of nothing or nothing but whitespace. +See also delete_ignorable_whitespace in L. -=over +=head2 Loltree Functions + +A loltree is an arrayref consisting of arrayrefs which is used by +C<< new_from__lol >> in L to produce HTML trees. +The CPAN distro L creates such XML trees by parsing XML files, +analagous to L. The purpose of the functions in this section is to allow +you manipulate a loltree programmatically. + +These could not be methods because if you bless a loltree, then HTML::Tree will barf. + +=head3 HTML::Element::newchild($lol, $parent_label, @newchild) + +Given this initial loltree: + + my $initial_lol = [ note => [ shopping => [ item => 'sample' ] ] ]; -=item * L +This code: -A perl package for creating and manipulating HTML trees + sub shopping_items { + my @shopping_items = map { [ item => _ ] } qw(bread butter beans) ; + @shopping_items; + } + + my $new_lol = HTML::Element::newnode($initial_lol, item => shopping_items()); + + will replace the single sample with a list of shopping items: + + + [ + 'note', + [ + 'shopping', + + [ + 'item', + 'bread' + ], + [ + 'item', + 'butter' + ], + [ + 'item', + 'beans' + ] + + ] + ]; + +Thanks to kcott and the other Perlmonks in this thread: +http://www.perlmonks.org/?node_id=912416 -=item * L + +=head1 SEE ALSO + +=head2 L + +A perl package for creating and manipulating HTML trees. + +=head2 L An L - based module which allows for manipulation of HTML trees using cartesian coordinations. -=item * L +=head2 L An L - based module inspired by XMLC (L), allowing for dynamic HTML generation via tree rewriting. +=head2 Push-style templating systems + +A comprehensive cross-language +L. + + =head1 TODO =over @@ -1156,16 +1218,23 @@ down instead: =cut -=head1 SEE ALSO - -L -=head1 AUTHOR / SOURCE +=head1 AUTHOR and ACKS Terrence Brannon, Etbone@cpan.orgE +I appreciate the feedback from M. David Moussa Leo Keita regarding some issues with the +test suite, namely (1) CRLF leading to test breakage in F and (2) using the +wrong module in F thus not having the right functionality available. + Many thanks to BARBIE for his RT bug report. +Many thanks to perlmonk kcott for his work on array rewriting: +L. +It was crucial in the development of newchild. + +=head2 Source Repo + The source is at L =head1 COPYRIGHT AND LICENSE