Stripping illegal characters out of an XML document
| From: | Daniel Pupius | Date: | Thu, 06 Jun 2002 11:47:57 +0000 |
| Subject: | Stripping illegal characters out of an XML document | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-100927@lists.php.net to get a copy of this message | ||
Hi there. I'm working with RDF/XML that is strict on what characters are
allowed within the elements and attributes. I was wondering if anyone had a
script that processed a string and replaced all illegal-characters with
their HTML code, for example "&" is converted to & and " to ". It should
also work for characters like "é".
It would be possible to process the strings before they are inserted into
the XML document - if that is easier.
If there isn't a script that'll do this I'll have to write my own - which
could be quite time consuming ;(
Thanks
Dan