Re: Generate XHTML (HTML compatible) Code using DOMDocument
| From: | Raymond Irving | Date: | Mon, 13 Apr 2009 16:01:40 +0000 |
| Subject: | Re: Generate XHTML (HTML compatible) Code using DOMDocument | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-291431@lists.php.net to get a copy of this message | ||
Hi Michael,
Your script works fine. The only problem I'm having is that it does not support html entities.
The following code will cause the page to crash:
<p>©</p>
I think that's because you're using loadXML and not loadHTML.
Has anyone from the dev team contacted the libxml guys about the utf-8 issue with loadHTML()?
__
Raymond Irving
--- On Mon, 4/13/09, Michael A. Peters <mpeters@mac.com> wrote:
> From: Michael A. Peters <mpeters@mac.com>
> Subject: Re: [PHP] Generate XHTML (HTML compatible) Code using DOMDocument
> To: "Michael Shadle" <mike503@gmail.com>
> Cc: "Raymond Irving" <xwisdom@yahoo.com>, "php-general@lists.php.net"
> <php-general@lists.php.net>
> Date: Monday, April 13, 2009, 5:56 AM
> Michael A. Peters wrote:
>
> >
> > I wonder if the real utf8 problem people experience is
> really with loadHTML() and not with saveHTML() ??
> >
>
> Go to http://www.clfsrpm.net/xss/dom_script_test.php
>
> The page was meant to test something else but enter some
> UTF-8 into the textarea (well formed xhtml) -
>
> With IE - html 4 is the only thing it will output but with
> FireFox and Opera, by default it outputs xhtml but you can
> check a box to force html.
>
> When it outputs html it uses saveHTML()
> When it outputs xhtml it uses saveXML()
>
> The source is linked there so you can see.
>
> Anyway - it looks saveHTML() works fine with UTF8 as long
> as loadXML() was used to load the data.
>
> I've tried both Hebrew and Polytonic Greek.
> It outputs correctly regardless of html or xhtml - but only
> after I changed the code to load the textarea as xml opposed
> to html.
>
> -- PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>