[OT] Figuring Out XML Error?

Peter W A Wood peterwawood at gmail.com
Mon Oct 12 05:43:46 EDT 2009


Hi Scott

> Thanks for looking Peter.  It seems possible to discern the error  
> even just
> using a Web browser, but how to correct it?

By referring to a couple of tutorials and the dictionary, I managed to  
cobble together this simple skeleton of how to correct the file using  
RunRev. I'm sure that most people on this list could do better:

By referring to a couple of tutorials and the dictionary

set the defaultFolder to "/Users/peter/Desktop"
put url ("file:"  & "document.xml") into myXML
replace "á" with numToChar(195) & numToChar(161) in myXML
replace "é" with numtoChar(195) & numToChar(169) in myXML
-- etc.
put myXML into url ("file:" & "newdocument.xml")

In case it isn't obvious what the above script does is change all the  
occurrences of  á to the UTF-8 character sequence for a small a  
with an acute accent. It does the same to a small e with an acute  
accent. Unfortunately, their are a lot more to add. I'm not aware of a  
programatic way of converting from HTML "escape" characters to UTF-8.

I did test against the file you supplied and it worked in the sense  
that the XML validator found a different error.

I hope this helps.

Regards

Peter




More information about the use-livecode mailing list