public function getNamespaces()
{
$request = $this->getRequest(Request::REPORT, $this->workspaceUri);
$request->setBody($this->buildReportRequest('dcr:registerednamespaces'));
$dom = $request->executeDom();
if ($dom->firstChild->localName != 'registerednamespaces-report' || $dom->firstChild->namespaceURI != self::NS_DCR) {
throw new RepositoryException('Error talking to the backend. ' . $dom->saveXML());
}
$mappings = array();
$namespaces = $dom->getElementsByTagNameNS(self::NS_DCR, 'namespace');
foreach ($namespaces as $elem) {
$mappings[$elem->firstChild->textContent] = $elem->lastChild->textContent;
}
return $mappings;
}