You are here: Re: XML parsing and HTML comments « PHP Programming Language « IT news, forums, messages
Re: XML parsing and HTML comments

Posted by Colin McKinnon on 09/14/05 11:03

Andy Hassall wrote:

> On Tue, 13 Sep 2005 13:27:18 +0100, Colin McKinnon
> <colin.deletethis@andthis.mms3.com> wrote:
>
>> Mostly it works fine, however it ignores
>>anything that looks like an HTML comment. This is a bit of a problem as I
>>see a lot of code written like:
>>
>><script type='text/javascript>
>><!--
>
> expat (the XML parser used in these functions) has support for adding
> comment
> handlers, but that doesn't appear to be hooked into the PHP extension, so
> you can't get at that functionality without patching the source of the
> extension.
>

erk.

Thanks Andy. At least I know I'm not doing something stupid.

For software I'm planning to release, patching the source isn't an ideal
solution. I managed to implement a workaround by running this on the XML
first:

$xml=str_replace('<!--', '<![CDATA[<!--', $xml);
$xml=str_replace('-->', '-->]]>', $xml);

(again not ideal, but hopefully less painful than recompiling/maintaining
expat)

C.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация