From 6ce6fdabc0a3645e1f452ee881eb41e9fa4dbd25 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Sat, 8 Nov 2014 14:15:35 +0000 Subject: [PATCH] Optimise queries within a target node --- src/MicrodataPhpDOMElement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MicrodataPhpDOMElement.php b/src/MicrodataPhpDOMElement.php index fd3a9c3..6433f87 100644 --- a/src/MicrodataPhpDOMElement.php +++ b/src/MicrodataPhpDOMElement.php @@ -189,7 +189,7 @@ protected function traverse($node, &$toTraverse, &$props, $root) { // An xpath expression is used to get children instead of childNodes // because childNodes contains DOMText children as well, which breaks on // the call to getAttributes() in itemProp(). - $children = $this->ownerDocument->xpath()->query($node->getNodePath() . '/*'); + $children = $this->ownerDocument->xpath()->query('./*', $node); foreach ($children as $child) { $this->traverse($child, $toTraverse, $props, $root); }