->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:
<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>
my $body = HTML::Zoom
->from_html(<<BODY);
<div id="stuff">
- <p>Stuff</p>
+ <p>Well Now</p>
+ <p>Is the Time</p>
</div>
BODY
->replace_content('Hello World')
->select('body')
->replace_content($body)
+->select('p')
+->set_attribute(class=>'para')
->to_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>