protected function loadOutputResource(\SimpleXMLElement $parent, $tagName, $themePath)
{
$nodes = $this->getNodes($parent, $tagName);
if (count($nodes) == 0) {
$this->getErrorHandler()->error(ThemeErrors::XML_MISSING_TAG, $tagName, $parent->getName());
throw new FailedException();
}
if (count($nodes) > 1) {
$this->getErrorHandler()->error(ThemeErrors::XML_TO_MANY_TAGS, $tagName, $parent->getName(), 1);
throw new FailedException();
}
$node = $nodes[0];
/* @var $node \SimpleXMLElement */
try {
$rsc = new Resource();
$rsc->setName($tagName);
$rsc->setPath($this->escapePath($themePath . $this->readAttribute($node, self::ATTR_PAGE_SRC)));
return $rsc;
} catch (XMLMissingAttribueException $e) {
$this->getErrorHandler()->error(ThemeErrors::XML_MISSING_ATTRIBUTE, $e->getAttributeName(), $tagName);
throw new FailedException();
}
}