Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Xmladapter.tocursor strange behaviour
Message
From
08/07/2004 07:55:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
Xmladapter.tocursor strange behaviour
Miscellaneous
Thread ID:
00921909
Message ID:
00921909
Views:
64
I found a behaviour in XMLAdapter.toCursor that seems very much like a bug.

If I have a cursor in which one of the fields has the same name as the cursor itself (including case), when I serialize this cursor (oxmladapter.toxml) and then get the cursor back from the XML, the records are duplicated. Each record has a blank record associated.

Try this code:
Create Cursor mycursor (myfield c(10), mycursor c(10))
Append Blank
Replace mycursor.myfield with "OLEO"

oXML=NewObject("XMLAdapter")
oxml.PreserveWhiteSpace= .T.
oXML.AddTableSchema("mycursor")
oXML.ToXML('m.cXML')

Select mycursor
Use

oXML2=NewObject('XMLAdapter')
oXML2.LoadXML(cXML)
oxmltable2=oxml2.tables(1)
oxmltable2.ToCursor

Select mycursor
Browse
You should notice that originally I had one record, and in the end, I got 2 records (one is blank).

If I change the name of the cirsor or the name of the field, then everything goes ok.

Anyone knows anything about this ?
Next
Reply
Map
View

Click here to load this message in the networking platform