>>It won't solve your problem, but may help you to identify its source. This is a replacement for the
STRCONV() function (takes a ISO-Latin-1 string and converts it to UFT-8 encoding to be used in XML documents):
>
>It's not quite a replacement as STRCONV() doesn't convert the greater less signs. When my XML is ready to be converted, if I call your function, I will end up with an invalid XML as no tag is present anymore in the string. I had to comment those two ligns in order to achieve the same thing as STRCONV().
Yeah, sorry, that was/is the intention (to go for proper encoding in XML data elements). It shouldn't be used, as you noticed, with complete documents.
>However, the only way I was able to make use of your function was to use it against the field directly, such as:
>
>
>SELECT Title,Message FROM ALIAS() INTO CURSOR Temp
>
>* Create XML object
>...
>
>* Add root
>...
>
>SCAN
> ...
>
> * Add each field
> loXML.AddElement(loProperty,'Title',Titre)
> loXML.AddElement(loProperty,'Abstract',IsoToUTF8(Message))
>
>ENDSCAN
>RETURN loXML.XML()
>
Instead of
loXML.xml (it's a property, so you can drop the parenthesis), can't you try to use the
save() method that preserves the encoding declaration (even if you have to put it in a temp file and restore it for the
RETURN)?
----------------------------------
António Tavares Lopes