update docs
Simon Elliott [Fri, 20 May 2011 21:56:58 +0000 (22:56 +0100)]
lib/HTML/Zoom.pm
lib/HTML/Zoom/FilterBuilder.pm

index 596b862..26ad101 100644 (file)
@@ -213,13 +213,14 @@ HTML::Zoom - selector based streaming template engine
             $_->select('.name')->replace_content('Matt')
               ->select('.age')->replace_content('26')
           },
+          # alternate form
           sub {
-            $_->select('.name')->replace_content('Mark')
-              ->select('.age')->replace_content('0x29')
+            $_->replace_content({'.name' => ['Mark'],'.age' => ['0x29'] })
           },
+          #alternate alternate form
           sub {
-            $_->select('.name')->replace_content('Epitaph')
-              ->select('.age')->replace_content('<redacted>')
+            $_->replace_content('.name' => 'Epitaph')
+              ->replace_content('.age' => '<redacted>')
           },
         ],
         { repeat_between => '.between' }
@@ -342,14 +343,12 @@ cleanly:
        ->add_to_attribute( for => $field->{id} )
        ->then
        ->replace_content( $field->{label} )
-
-       ->select('input')
-       ->add_to_attribute( name => $field->{name} )
-       ->then
-       ->add_to_attribute( type => $field->{type} )
-       ->then
-       ->add_to_attribute( value => $field->{value} )
-
+       ->add_to_attribute(
+        input => { 
+         name => $field->{name},
+         type => $field->{type},
+         value => $field->{value}
+       })
     } } @fields
   ]);
 
index 5c79584..fdfcb28 100644 (file)
@@ -460,7 +460,7 @@ Sets an attribute of a given name to a given value for all matching selections.
       ->select('p')
       ->set_attribute(class=>'paragraph')
       ->select('div')
-      ->set_attribute({name=>'class', value=>'divider'});
+      ->set_attribute({class=>'paragraph', name=>'divider'});
 
 Overrides existing values, if such exist.  When multiple L</set_attribute>
 calls are made against the same or overlapping selection sets, the final