starting to work down the list of methods and figuring out what does what
John Napiorkowski [Sat, 25 Sep 2010 00:04:45 +0000 (20:04 -0400)]
lib/HTML/Zoom/FilterBuilder.pm
t/synopsis/filterbuilder.t

index e07c557..7b0eea0 100644 (file)
@@ -312,8 +312,8 @@ HTML::Zoom::FilterBuilder - Add Filters to a Stream
   ->replace_content('Hello World')
   ->select('body')
   ->replace_content($body)
-  ->select('#stuff p')
-  ->add_to_attribute(class=>'body')
+  ->select('p')
+  ->set_attribute(class=>'para')
   ->to_html;
 
 will produce:
@@ -329,7 +329,8 @@ will produce:
       <title>Hello World</title>
     </head>
     <body><div id="stuff">
-      <p>Stuff</p>
+      <p class="para">Well Now</p>
+      <p class="para">Is the Time</p>
   </div>
   </body>
   </html>
index 9769c3d..59048ae 100644 (file)
@@ -18,7 +18,8 @@ MAIN
 my $body = HTML::Zoom
     ->from_html(<<BODY);
 <div id="stuff">
-    <p>Stuff</p>
+    <p>Well Now</p>
+    <p>Is the Time</p>
 </div>
 BODY
 
@@ -27,6 +28,8 @@ my $output =  $root
 ->replace_content('Hello World')
 ->select('body')
 ->replace_content($body)
+->select('p')
+->set_attribute(class=>'para')
 ->to_html;
 
 
@@ -36,7 +39,8 @@ my $expect = <<HTML;
     <title>Hello World</title>
   </head>
   <body><div id="stuff">
-    <p>Stuff</p>
+    <p class="para">Well Now</p>
+    <p class="para">Is the Time</p>
 </div>
 </body>
 </html>