Jean-Marc Molina <jmmolina@pasdepourriel-free.fr> wrote:[color=blue]
> Error I get :
> XML Parsing Error: not well-formed
> Location: news.php?action=syndicate&format=rss2
> Line Number 1, Column 102:<?xml version="1.0" encoding="ISO-8859-15"?><rss
> version="2.0"><channel><title>Website title - News (
> ----------------------------------------------------------------------------
> -----------------------------------------------------------^
>
> The not well-formed character is an accentuated character, as you can see on
> the following code sample :[/color]
....[color=blue]
> $title_el->set_content ('Website title - News (????)');[/color]
....[color=blue]
> Removing the accentuated characters from the title generates a well formed
> XML file. Note that I also tried to encode the characters using the
> htmlentities function but it didn't change anything.[/color]
Disclaimer: I haven't ever used xmldomdoc in php.
If you are trying to create wellformed XML you should use UTF8 as the
encoding, since that is about the only encoding that XML utils must
support. That is also your problem, your xml doc. is in UTF8 since you
haven't told anyone otherwise (and I can't find how to do that in the
domxml reference).
htmlenties doesn't work either because there are only 5 xmlentities by
default: & ' " > <
IMHO the best solution would be to translate you string to UTF8:
http://nl.php.net/manual/en/function...t-encoding.php
(be sure to tell it's iso-8859-15 or else the EUR symbol will get
dropped for the generic currency symbol).
Or use
http://nl.php.net/manual/en/function.utf8-encode.php after
manually encoding EUR.
--
Daniel Tryba