Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Xmladapter.tocursor strange behaviour
Message
De
08/07/2004 07:55:29
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Titre:
Xmladapter.tocursor strange behaviour
Divers
Thread ID:
00921909
Message ID:
00921909
Vues:
66
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 ?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform