#19239 [Opn->Bgs]: missing end-tags not being cought as errors

From: Date: Thu, 05 Sep 2002 20:27:43 +0000
Subject: #19239 [Opn->Bgs]: missing end-tags not being cought as errors
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-18519@lists.php.net to get a copy of this message
ID: 19239 Updated by: sniper@php.net Reported By: danielc@analysisandsolutions.com -Status: Open +Status: Bogus Bug Type: XML related Operating System: NT 4.0 and FreeBSD 4.1.1 PHP Version: 4.2.2 New Comment: http://www.php.net/manual/en/function.xml-parse.php Look at the 'isFinal' parameter.. Previous Comments: ------------------------------------------------------------------------ [2002-09-04 22:01:41] danielc@analysisandsolutions.com XML documents with missing closing tags at the end of the data are not considered well-formed according to http://www.w3.org/TR/2000/REC-xml-20001006#dt-etag "The end of every element that begins with a start-tag must be marked by an end-tag containing a name that echoes the element's type as given in the start-tag" But, PHP's xml_parse() function isn't rejecting them. This is happening in PHP 4.2.2 on Windows NT and 4.1.2 on FreeBSD 4.1.1. <?php # This is well-formed and parses fine. $Contents = '<?xml version="1.0"?> <!DOCTYPE TEST SYSTEM "foo.dtd"> <T>Some Data</T>'; # This is NOT well-formed BUT parses. $Contents = '<?xml version="1.0"?> <!DOCTYPE TEST SYSTEM "foo.dtd"> <T>Some Data'; $Parser = xml_parser_create('ISO-8859-1'); if ( xml_parse($Parser, $Contents) ) { echo "Parsed fine.\n"; } else { echo "Had problem parsing file:\n " . xml_error_string(xml_get_error_code($Parser)); echo "\n"; } ?> ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19239&edit=1

« previous php.bugs (#18519) next »