See if you can get a schema (ie an xsd file) - see help xmladapter under XMLSchemaLocation
>>>>>...
>>So, summing up: a reasonable approach would be to (a) always read the file contents into a string, (b) fetch and strip off the BOM, if there is one, (c) check for file contents consistency (that is, match between actual file encoding and declared XML encoding), (d) force consistency, if needed, by transforming the string, and then (e) .LoadXML() the result of previous steps.
>I got the other company to send me new files as some of the existing ones were inconsistent.
>I've attached one of the new xml files and with them I tried 2 things.
>First up in the VFP 9 command window
>
LOCAL adapter as xmladapter
>adapter = CREATEOBJECT("XMLAdapter")
>adapter.RespectNesting = .T.
>lcContent = FILETOSTR("Orders-150620171615_4480-3.xml")
>adapter.LoadXML(SUBSTR(lcContent,4))
>? adapter.tables.Count --- this return 0
>
> I also tried this instead of using lcContent, but still Count = 0
>
adapter.LoadXML("Orders-150620171615_4480-3.xml", .T., .F.)
>
>
>I also tried the above after taking the file, opening it in notepad and then saving as ansi.
>~M
Gregory