Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor to XML not picking up lines
Message
From
12/06/2017 05:34:46
 
 
To
12/06/2017 03:21:18
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008 R2
Network:
Windows Server 2008 R2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01650938
Message ID:
01651918
Views:
76
>>>Thanks for the help so far. tried a few things but hitting a wall on this.
>>>I tried the code and it worked if the xml file was a string in the program. I tried the code by copying the contents of the file that I was trying to import and it worked okay. So I then tried pointing to the file directly as this is what I will need to do, but I started getting problems. I've included the code below. When I do the original xml to cursor I get the document header information which I can then validate etc. I then try to use the second half to get the detail lines. This worked if the code referenced the OriginalFile string, however it will not work if I use FileToStr of the xml file or similar variations. The fact that it worked when part of the file but not when passed as a variable has me baffled. Any further help appreciated.
>>>
>>>Edit: despite lcXMLFile having data, when I do the command m.XML.loadXML(lcXMLFile) it returns no data.
>>>
>>
>>Can you post, as an attachment, a zip of an XML file that fails to be loaded?
>
>I think the Load() method has to be used when loading a file
>
>LoadXml() is for strings I believe

Yes, Mark already tried to FILETOSTRing the document before loadXMLing it, but it fails, nonetheless, so I suspect that there is a problem with the file to be consumed this way, probably a BOM.
----------------------------------
António Tavares Lopes
Previous
Reply
Map
View

Click here to load this message in the networking platform