Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with XMLAdapter ToCursor method
Message
From
14/02/2008 17:32:32
Calvin Smith
Wayne Reaves Computer Systems
Macon, Georgia, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
Problem with XMLAdapter ToCursor method
Miscellaneous
Thread ID:
01292823
Message ID:
01292823
Views:
102
I am trying to get some XML data into a cursor. I create an XMLAdapter object using something like this:

cxml='res.xml'
o = NEWOBJECT('XMLAdapter')
IF VARTYPE(o)='O'
x=o.LoadXML(cXML,.t.)
o.Tables(1).ToCursor()
endif

This produces an error on the line o.tables(1).ToCursor() -> "Index or expression does not match an existing member of the collection". When I examine the object o the tables collection is empty. I have never worked with XMLAdapter before and the help is somewhat lacking. There is no XSD file and the XML data looks like this -(Sorry the XML is so ugly- it is incredibly difficult to post XML data here.)
<Contract><Codes><Code PaymentDueDate="2008/02/21" DeliveredDate="" DeliveredUser=" "RetrievedDate="">121313</Code>
<Code PaymentDueDate="2008/02/28" DeliveredDate="" DeliveredUser="" RetrievedDate="">121443</Code>
<Code PaymentDueDate="2008/03/06" DeliveredDate="" DeliveredUser="" RetrievedDate="">423112</Code>
<Code PaymentDueDate="2008/03/13" DeliveredDate="" DeliveredUser="" RetrievedDate="">423344</Code>
<Code PaymentDueDate="2008/03/20" DeliveredDate="" DeliveredUser="" RetrievedDate="">122132</Code>
<Code PaymentDueDate="2008/03/27" DeliveredDate="" DeliveredUser="" RetrievedDate="">341111</Code>
</Codes><ResetCode>324442</ResetCode></Contract>
Can anyone point me in the right direction... Thanks!
A problem is a problem only as long as it has a possible solution. Lacking that, it becomes a FACT!
Next
Reply
Map
View

Click here to load this message in the networking platform