|
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]
|