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 ?