+nodes), placing it as the last children of the first innermost element.
# "123Test
"
$dom->parse('Test
')->at('p')->wrap_content('123')->root;
@@ -641,47 +900,13 @@ children of the first innermost element.
$dom = $dom->xml($bool);
Disable HTML semantics in parser and activate case-sensitivity, defaults to
-auto detection based on processing instructions.
-
-=head1 OPERATORS
-
-L overloads the following operators.
-
-=head2 array
-
- my @nodes = @$dom;
-
-Alias for L"child_nodes">.
-
- # ""
- $dom->parse('123')->[0];
-
-=head2 bool
-
- my $bool = !!$dom;
-
-Always true.
-
-=head2 hash
-
- my %attrs = %$dom;
-
-Alias for L"attr">.
-
- # "test"
- $dom->parse('Test
')->at('div')->{id};
-
-=head2 stringify
-
- my $str = "$dom";
-
-Alias for L"to_string">.
+auto detection based on XML declarations.
=head1 COLLECTION METHODS
-Some L methods return an array-based collection object, which can
-either be accessed directly as an array reference, or with the following
-methods.
+Some L methods return an array-based collection object based on
+L, which can either be accessed directly as an array
+reference, or with the following methods.
# Chain methods
$collection->map(sub { ucfirst })->shuffle->each(sub {
@@ -734,8 +959,8 @@ passed to the callback and is also available as C<$_>.
# Longer version
my $first = $collection->first(sub { $_->$method(@args) });
- # Find first value that contains the word "dom"
- my $interesting = $collection->first(qr/dom/i);
+ # Find first value that contains the word "tiny"
+ my $interesting = $collection->first(qr/tiny/i);
# Find first value that is greater than 5
my $greater = $collection->first(sub { $_ > 5 });
@@ -766,8 +991,8 @@ C<$_>.
# Longer version
my $new = $collection->grep(sub { $_->$method(@args) });
- # Find all values that contain the word "dom"
- my $interesting = $collection->grep(qr/dom/i);
+ # Find all values that contain the word "tiny"
+ my $interesting = $collection->grep(qr/tiny/i);
# Find all values that are greater than 5
my $greater = $collection->grep(sub { $_ > 5 });
@@ -801,8 +1026,8 @@ passed to the callback and is also available as C<$_>.
# Longer version
my $new = $collection->map(sub { $_->$method(@args) });
- # Append the word "dom" to all values
- my $domified = $collection->map(sub { $_ . 'dom' });
+ # Append the word "tiny" to all values
+ my $domified = $collection->map(sub { $_ . 'tiny' });
=head2 reduce
@@ -896,9 +1121,21 @@ Report any issues on the public bugtracker.
Dan Book
+Code and tests adapted from L, a lightweight DOM parser by the L team.
+
+=head1 CONTRIBUTORS
+
+=over
+
+=item Matt S Trout (mst)
+
+=back
+
=head1 COPYRIGHT AND LICENSE
-This software is Copyright (c) 2015 by Dan Book.
+Copyright (c) 2008-2015 Sebastian Riedel.
+
+Copyright (c) 2015 L"AUTHOR"> and L"CONTRIBUTORS"> for adaptation to standalone format.
This is free software, licensed under:
@@ -906,6 +1143,8 @@ This is free software, licensed under:
=head1 SEE ALSO
-L, L, L, L, L
+L, L, L, L, L
+
+=for Pod::Coverage TO_JSON
=cut