Added itemref support and test

The test also tests "src based tags" as can be seen in dataset name
This commit is contained in:
Yusuf Kandemir
2018-11-12 19:11:52 +03:00
parent e17ceac9ea
commit a5bfeb5ec5
4 changed files with 51 additions and 1 deletions

View File

@ -14,7 +14,11 @@ class MicrodataDOMElement extends \DOMElement
$tokens = $this->tokenizeAttribute('itemref');
foreach ($tokens as $token) {
// @todo Implement xpath query and get the first item
$references = $this->ownerDocument->xpath->query('//*[@id="'.$token.'"]');
if ($first = $references->item(0)) {
$pending[] = $first;
}
}
}