Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLAdapter and schemaLocation error

Status
Not open for further replies.

Goofus828

Programmer
Nov 9, 2005
127
US
Hi all!
I'm in the early stages of trying to import a financial file that is in XML into VFP9.

I am using this code from a prior post to open the xml file and view the data.
Code:
* Read the XML file into a memory variable
lcXML = FILETOSTR(GETFILE())

loXML = CREATEOBJECT("XMLAdapter")
    
* Convert XML to one or more cursor
WITH loXML
  .LoadXML(lcXML)                                                                                                                                                    
  FOR lnI = 1 TO .Tables.Count
    lcCursorName = "SomeCursor" + TRANSFORM(lnI)
    USE IN SELECT(lcCursorName)
    .Tables(lnI).ToCursor(.F., lcCursorName)
  ENDFOR
ENDWITH

When I run the code, i get an error on the .LoadXML function:

XML Error: XML Parse error: The system cannot locate the object specified.
Line 0, Position 0.


I believe that it is because it cannot find the information in the XSI:schemaLocation web address.

XML:
<informationTable xsi:schemaLocation="[URL unfurl="true"]http://www.sec.gov/edgar/document/thirteenf/informationtable[/URL] eis_13FDocument.xsd" xmlns="[URL unfurl="true"]http://www.sec.gov/edgar/document/thirteenf/informationtable"[/URL] xmlns:n1="[URL unfurl="true"]http://www.sec.gov/edgar/document/thirteenf/informationtable"[/URL] xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance">[/URL]

When I manually type those addresses in my browser, I get the file not found pages.

Can I replace those web address with a local drive name ie: c:/edgar/documents/thirteenf eis_13FDocument.xsd and have the VFP code not crash?
I have the XSD and XLS files in this path.

Thanks!
 
JRB-BLDR, I tried that code but it assumes I know the names of the tags.

But that was not my question. My question is about the xml-infoset in the xml-code example I provided.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top