protected function getNodeReferences($path, $name = null, $weak_reference = false)
{
$path = $this->encodeAndValidatePathForDavex($path);
$identifier = $weak_reference ? 'weakreferences' : 'references';
$request = $this->getRequest(Request::PROPFIND, $path);
$request->setBody($this->buildPropfindRequest(array('dcr:' . $identifier)));
$request->setDepth(0);
$dom = $request->executeDom();
$references = array();
foreach ($dom->getElementsByTagNameNS(self::NS_DCR, $identifier) as $node) {
foreach ($node->getElementsByTagNameNS(self::NS_DAV, 'href') as $ref) {
$refpath = str_replace($this->workspaceUriRoot, '', urldecode($ref->textContent));
$refpath = $this->removeTrailingSlash($refpath);
if (null === $name || PathHelper::getNodeName($refpath) === $name) {
$references[] = $refpath;
}
}
}
return $references;
}