Re: How about a saveXHTML for the DOM?
| From: | Raymond Irving | Date: | Fri, 10 Apr 2009 19:26:40 +0000 |
| Subject: | Re: How about a saveXHTML for the DOM? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-291350@lists.php.net to get a copy of this message | ||
--- On Wed, 4/8/09, Michael A. Peters <mpeters@mac.com> wrote:
> From: Michael A. Peters <mpeters@mac.com>
> Subject: Re: [PHP] How about a saveXHTML for the DOM?
>
> saveXML() already does what is needed to provide valid
> xhtml output.
From my test it sometimes generate this like at the end of the page elements. It also
generate things like <script src="file.js" /> which does not work in most browsers.
So we have to process the out string to convert things like <script /> <textarea /> to
<script></script> and <textrea></textarea>
There are other times when saveXML will remove the \n altogether from the code which caused tags to
be displayed in a single line. In addition saveXML() does not preserve html entities. So things like
© gets converted to ©.
Sometimes working with saveHTML and saveXML is like being caught between a rock and a hard place.
I'm trying to figure out which would be easier to do:
Going from saveHTML() to XHTML
Going from saveXML() to XHTML
__
Raymond Irving
Create Rich Ajax/PHP Web apps Today!
Raxan PDI - http://raxanpdi.com