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 - "XML Schema Too Complex" problem

Status
Not open for further replies.

JRB-Bldr

Programmer
May 17, 2001
3,281
US
I finally broke down and upgraded to VFP9 in order to get the XMLAdapter tool to use for XML -> DBF conversions and vice versa.

Now when I attempt to run it against a client supplied XML & XSD file set, I get an error message.
XML Schema Is Too Complex

The code I am running for a preliminary test is as follows:
Code:
LOCAL lcFile as String
LOCAL lcXSDFile as String
lcFile = GETFILE('XML', 'Browse to locate the XML file')
lcXSDFile = GETFILE('XSD', 'Browse to locate the SCHEMA file')

adapter = CREATEOBJECT("XMLAdapter")
adapter.XMLSchemaLocation = lcXSDFile
adapter.LoadXML(lcFile,.T.)

* ^^^^ Error Occurs Here ^^^^

For Each oXMLTable In adapter.Tables
   oXMLTable.ToCursor()
Endfor

The 2 files (XML & XSD) will open for display purposes with Microsoft's Sample Visual Foxpro Form to View XML, so I have to assume that the files are good files and not corrupted.

I need to get data from this client, which is supplied in XML format, into VFP tables/cursors on a regular basis (not just one time). And once processed I need to get the data back into XML format (albeit to a different XSD format).

From reading here and elsewhere on the web, I thought that VFP9's XMLAdapter was going to be the answer.

Where do I go from here?

As always your advice/suggestions are greatly appreciated.

Thanks,
JRB-Bldr
 
Did you look at the code in the sample to see what they're doing differently than you?

Tamar
 
Tamar - thank you for the reply.

Yes, in the M$ sample form, they are using the DOM object and merely displaying the TEXT property of it. It comes out as one LONG string rather than individual field values and individual records.

But its working confirms to me that the XML file is not corrupted and I would have expected it to work with VFP9's XML Adapter.

I don't want to have to parse the DOM Text property. If I was going to go to that much trouble, I'd parse the original XML document itself.

All Microsoft explains about the XML Schema Is Too Complex error message is:

The LoadXML method was unable to fully understand the supplied XML Schema
* Check to make sure the supplied schema contains valid XSD data types or the schema and XML format is supported by Visual FoxPro.

Duh!!!
That is not much help.

The fact that the M$ Form works to display both Schema and Text of the sample XML file pretty much confirms that it is OK.
Where is it explained what is and what is NOT supported by VFP9? I can't find anything in the VFP Help file.

And, even if I do find what is supported, it doesn't really matter that much.
Supported schema or not, I still need to find how to deal with what my client sends to me.

I am still looking for someone to come along with a good answer as to how to proceed.

Thanks,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top