public function load($source, $contentType = 'text/xml', $options = [])
{
$loaded = $this->prepareSource($source, $contentType, $options);
if ($loaded instanceof Loader\Result || $loaded instanceof \DOMDocument) {
if ($loaded instanceof Loader\Result) {
$this->_document = $loaded->getDocument();
$this->setContentType($loaded->getContentType());
if ($selection = $loaded->getSelection()) {
$this->push($selection);
}
} else {
$this->_document = $loaded;
$this->setContentType($contentType);
}
$this->_xpath = NULL;
$this->applyNamespaces();
return $this;
}
throw new Exceptions\InvalidSource($source, $contentType);
}