From 61bc49e8c0e2a2ad81f74ba661a3d3ddcdbb3454 Mon Sep 17 00:00:00 2001 From: Piotr Date: Mon, 22 Jan 2018 13:41:20 +0100 Subject: [PATCH] Fixed XML mapping validation. Warning: DOMDocument::schemaValidateSource(): Element '{http://gediminasm.org/schemas/orm/doctrine-extensions-mapping}sortable-position': No matching global element declaration available, but demanded by the strict wildcard. --- .../DoctrineExtensions/Mapping/Driver/AbstractXmlDriver.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/FSi/DoctrineExtensions/Mapping/Driver/AbstractXmlDriver.php b/lib/FSi/DoctrineExtensions/Mapping/Driver/AbstractXmlDriver.php index 42e02c1..120928d 100644 --- a/lib/FSi/DoctrineExtensions/Mapping/Driver/AbstractXmlDriver.php +++ b/lib/FSi/DoctrineExtensions/Mapping/Driver/AbstractXmlDriver.php @@ -98,8 +98,10 @@ private function validateFile(DOMDocument $dom) continue; } - foreach ($dom->getElementsByTagNameNS($xmlns->nodeValue, '*') as $elem) { - $elem->parentNode->removeChild($elem); + $domNodeList = $dom->getElementsByTagNameNS($xmlns->nodeValue, '*'); + for ($i = $domNodeList->length; --$i >= 0; ) { + $element = $domNodeList->item($i); + $element->parentNode->removeChild($element); } }