#33376 [NEW]: incorrect namespaces parsing with html file
| From: | frederic dot lecointre at burnweb dot net | Date: | Fri, 17 Jun 2005 00:39:42 +0000 |
| Subject: | #33376 [NEW]: incorrect namespaces parsing with html file | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-80499@lists.php.net to get a copy of this message | ||
From: frederic dot lecointre at burnweb dot net
Operating system: w2k
PHP version: 5.0.4
PHP Bug Type: DOM XML related
Bug description: incorrect namespaces parsing with html file
Description:
------------
incorrect namespaces parsing with html file and DOMDocument::loadHTML
xmlns can't be a namesspace prefix!
html can have mutliple namespaces
Reproduce code:
---------------
<?php
$html_string = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="fr"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:tag="http://tag.com/tag">
<head>
<title></title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"
/>
</head>
<body >
<xforms:view >
<tag:form id="helloForm"></tag:form>
</xforms:view>
</body>
</html>
';
$doc = new DOMDocument('1.0', 'iso-8859-1');
$doc->loadHTML($html_string);
?>
Actual result:
--------------
Warning: DOMDocument::loadHTML(): Namespace prefix xmlns of attribute
xforms is not defined in Entity, line: 3
Warning: DOMDocument::loadHTML(): Namespace prefix xmlns of attribute tag
is not defined in Entity, line: 3
Notice: DOMDocument::loadHTML(): Namespace prefix xforms is not defined in
Entity, line: 9
Warning: DOMDocument::loadHTML(): Tag xforms:view invalid in Entity, line:
9
Notice: DOMDocument::loadHTML(): Namespace prefix tag is not defined in
Entity, line: 10
Warning: DOMDocument::loadHTML(): Tag tag:form invalid in Entity, line: 10
in
--
Edit bug report at http://bugs.php.net/?id=33376&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=33376&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=33376&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=33376&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=33376&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=33376&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=33376&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=33376&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=33376&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=33376&r=support
Expected behavior: http://bugs.php.net/fix.php?id=33376&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=33376&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=33376&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=33376&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=33376&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=33376&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=33376&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=33376&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=33376&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=33376&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=33376&r=mysqlcfg