foreach ($this->strip_attributes
as $attrib) { $this->
strip_attr($attrib,
$xpath);
} } if ($this->add_attributes
) { foreach ($this->add_attributes
as $tag =>
$valuePairs) { $this->
add_attr($tag,
$valuePairs,
$document);
} } // Replace relative URLs
$this->base =
$base;
foreach ($this->replace_url_attributes
as $element =>
$attributes) { $this->
replace_urls($document,
$element,
$attributes);
} // If image handling (caching, etc.) is enabled, cache and rewrite all the image tags.