protected function addSiteId($siteId, $template)
	{
		$dom   = TemplateLoader::load($template);
		$xpath = new DOMXPath($dom);
		$query = '//*[namespace-uri() != "' . TemplateLoader::XMLNS_XSL . '"]'
		       . '[not(ancestor::*[namespace-uri() != "' . TemplateLoader::XMLNS_XSL . '"])]';
		foreach ($xpath->query($query) as $element)
		{
			$element->setAttribute('data-s9e-mediaembed', $siteId);
		}

		return TemplateLoader::save($dom);
	}
protected function addSiteId($siteId, $template)
	{
		$dom   = TemplateLoader::load($template);
		$xpath = new DOMXPath($dom);
		$query = '//*[namespace-uri() != "' . TemplateLoader::XMLNS_XSL . '"]'
		       . '[not(ancestor::*[namespace-uri() != "' . TemplateLoader::XMLNS_XSL . '"])]';
		foreach ($xpath->query($query) as $element)
		{
			$element->setAttribute('data-s9e-mediaembed', $siteId);
		}

		return TemplateLoader::save($dom);
	}
protected function addSiteId ( $ siteId , $ template ) { $ dom = TemplateLoader :: load ( $ template ) ; $ xpath = new DOMXPath ( $ dom ) ; $ query = '//*[namespace-uri() != "' . TemplateLoader :: XMLNS_XSL . '"]' . '[not(ancestor::*[namespace-uri() != "' . TemplateLoader :: XMLNS_XSL . '"])]' ; foreach ( $ xpath -> query ( $ query ) as $ element ) { $ element -> setAttribute ( 'data-s9e-mediaembed' , $ siteId ) ; } return TemplateLoader :: save ( $ dom ) ; }
Added the siteId value to given template in a data-s9e-mediaembed attribute

@param  string $siteId   Site ID
@param  string $template Original template
@return string           Modified template
Added the siteId value to given template in a data - s9e - mediaembed attribute