public function addHtmlContent(string
$content, string
$charset = 'UTF-8'
) { $dom =
$this->
parseHtmlString($content,
$charset);
$this->
addDocument($dom);
$base =
$this->
filterRelativeXPath('descendant-or-self::base'
)->
extract(['href'
]);
$baseHref =
current($base);
if (\
count($base) && !
empty($baseHref)) { if ($this->baseHref
) { $linkNode =
$dom->
createElement('a'
);
$linkNode->
setAttribute('href',
$baseHref);
$link =
new Link($linkNode,
$this->baseHref
);
$this->baseHref =
$link->
getUri();
} else { $this->baseHref =
$baseHref;
} } } /**
* Adds an XML content to the list of nodes.
*
* The libxml errors are disabled when the content is parsed.
*
* If you want to get parsing errors, be sure to enable
* internal errors via libxml_use_internal_errors(true)
* and then, get the errors via libxml_get_errors(). Be
* sure to clear errors with libxml_clear_errors() afterward.
*
* @param int $options Bitwise OR of the libxml option constants
* LIBXML_PARSEHUGE is dangerous, see
* http://symfony.com/blog/security-release-symfony-2-0-17-released
*
* @return void
*/