Re: [xml] php5 breaks html parser





On 4.5.2009 21:01 Uhr, Bernhard zwischenbrugger wrote:
Hi all

First of all, I tried to report this bug at the PHP Bug reporting system.
see:
http://bugs.php.net/bug.php?id=48148
http://bugs.php.net/bug.php?id=47666

People at PHP don't feel responsible for that. So maybe it's a libxml
problem.

We already told you, that the loadHTML*() Methods are not namespace
aware and only meant for non-namespace-aware HTML4 documents and not
XHTML. Use the XML methods, if you're so keen on the namespaces.

And yes, this difference comes from the libxml2 library, but I don't
think anyone will tell you anything else here.

chregu



Problem Description:

PHP dublicates the xhtml namespace.

Example:

<?php
@$dom=domDocument::loadHTMLFile("http://www.w3.org/";
<http://www.w3.org/%22>);
header("Content-type:text/xml");
echo $dom->saveXML($dom->documentElement);
?>

Expected result:
----------------
Well formed XML.

Actual result:
--------------
<html xmlns="http://www.w3.org/1999/xhtml";
<http://www.w3.org/1999/xhtml%22>
xmlns="http://www.w3.org/1999/xhtml"; <http://www.w3.org/1999/xhtml%22> ...

(duplicate namespace)

----

See also my error page at:
http://lamp2.fhstp.ac.at/~lbz/beispiele/ss2009/bug/

thanks

Bernhard

PS: The php dom html-parser worked without problems for years.

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]