Mike Lewis
Programmer
I'm using an XML Adapter to load an XML string to a set of VFP cursors. Specifically:
This code recently crashed with an error,"XML Parse error: Invalid unicode character."
I tracked it down to an unexpected character (
in a phone number field. After I eliminated that character, it crashed again with the same error, which this time was a  in another record. I deleted that character and all was well.
Is there any way I can tell the XML Adapter to always ignore these bad characters? I've got no control over the contents of the XML, and no way of stopping any garbage getting into it.
I know I can write some VFP code to parse the XML strings before submitting them to loXML.LoadXML, but these are huge strings, so I'm looking for a more elegant solution.
Thanks in advance.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro tips, advice, training, consultancy
Custom software for your business
Code:
loXML = CREATEOBJECT("XMLAdapter")
....
lcXML = <some XML>
loXML.LoadXML(lcXML)
This code recently crashed with an error,"XML Parse error: Invalid unicode character."
I tracked it down to an unexpected character (
Is there any way I can tell the XML Adapter to always ignore these bad characters? I've got no control over the contents of the XML, and no way of stopping any garbage getting into it.
I know I can write some VFP code to parse the XML strings before submitting them to loXML.LoadXML, but these are huge strings, so I'm looking for a more elegant solution.
Thanks in advance.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro tips, advice, training, consultancy
Custom software for your business