/**
* Adds the template for the given types as described in the XML document.
*
* The types can be arbitrary, so that another bundle can easily add a new type and use the information from the
* webspace.
*
* @param Webspace $webspace
*
* @return Webspace
*/
protected function generateTemplates(Webspace $webspace)
{
foreach ($this->xpath->query('/x:webspace/x:templates/x:template') as $templateNode) {
/* @var \DOMNode $templateNode */
$template = $templateNode->nodeValue;
$type = $templateNode->attributes->getNamedItem('type')->nodeValue;
$webspace->addTemplate($type, $template);
}
return $webspace;
}