Index: tests/Zend/Dom/QueryTest.php =================================================================== --- tests/Zend/Dom/QueryTest.php (revision 24554) +++ tests/Zend/Dom/QueryTest.php (working copy) @@ -309,6 +309,22 @@ $this->assertType('DOMDocument', $doc); $this->assertEquals('utf-8', $doc->encoding); } + + /** + * @group ZF-11376 + */ + public function testXhtmlDocumentWithXmlDeclaration() + { + $xhtmlWithXmlDecl = << + + </head> + <body><p>Test paragraph.</p></body> +</html> +EOB; + $this->query->setDocument($xhtmlWithXmlDecl, 'utf-8'); + $this->assertEquals(1, $this->query->query('//p')->count()); + } } // Call Zend_Dom_QueryTest::main() if this source file is executed directly.