You are here: Re: entities in xml file « PHP Language « IT news, forums, messages
Re: entities in xml file

Posted by Janwillem Borleffs on 07/19/05 23:49

Rob wrote:
> Ok, wrong example. I used the & because it is a well known entity.
> But I ment any entity. How do I catch these ?
>

Either by using a DTD (see: http://www.w3schools.com/dtd/dtd_entities.asp)
or by replacing entities prior to processing.

Example (Note: replaces more entities then required):

$trans = array_flip(get_html_translation_table(HTML_ENTITIES));
array_walk($trans, create_function('&$a','$a = "&#" . ord($a) . ";";'));

$xml_source_as_string = str_replace(
$trans,
$xml_source_as_string
);


JW

 

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

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