I am looking for a way to add attributes for the root node when using XMLViews in CakePHP3. The Script generates a simple sitemap.xml which needs the namespace included in the urlset
tag. Not to much code to show, but anyway:
function sitemap($language='en') {
[..]
$_rootNode = 'urlset';
$this->set(compact('url'));
$this->set('_rootNode', $_rootNode);
$this->set('_serialize', ['url']);
}
I am aware, that I could add real views for the XML, but I would prefer this way of doing this