I have switched my zend framework version from 1.11 to 1.12.3 In the tests i detect a strange error that i cannot explain. I have some xml fetch and processing routines that yell at me.
PHP Fatal error: Uncaught exception 'Zend_Dom_Exception' with message
'Invalid XML: Detected use of illegal DOCTYPE' in ....
In zend framework 1.11 i had library/Zend/Dom/Query.php:197:
switch ($type) {
case self::DOC_XML:
$success = $domDoc->loadXML($document);
break;
....
In 1.12 the code looks strange
switch ($type) {
case self::DOC_XML:
$success = $domDoc->loadXML($document);
foreach ($domDoc->childNodes as $child) {
if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
require_once 'Zend/Dom/Exception.php';
throw new Zend_Dom_Exception(
'Invalid XML: Detected use of illegal DOCTYPE'
);
}
}
break;
.....
If i get this right, this routine will not parse doc xml with doctype. Little example that fails on my computer all the time:
require_once 'Zend/Dom/Query.php';
$f = '<?xml version="1.0" standalone="yes"?>' .
'<!DOCTYPE hallo [<!ELEMENT hallo (#PCDATA)>]>' .
'<hallo>Hallo Welt!</hallo>';
$dom = new Zend_Dom_Query($f);
$results = $dom->queryXpath('//hallo');
Can someone explain this to me??? I testeted with Zend Framework 1.12.3 and php 5.3.2 and 5.4.6