Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML empty manipulation
Message
De
20/09/2001 02:27:53
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
XML empty manipulation
Divers
Thread ID:
00558610
Message ID:
00558610
Vues:
62
In this code:
* Directly get an XMLDOM object
loXML=loHTTP.ResponseXML

* Check for error
IF EMPTY(loXML.XML)
   MESSAGEBOX(loHTTP.ResponseBody)
   RETURN
ENDIF

XMLToCursor(loXML.XML,'Temp')
SELECT Temp
BROWSE
If the XML object contains an empty cursor, that will make XMLToCursor() to generate an error. Well, the reaction of VFP is quite severe as it closes VFP. It makes sense however that it can't show the cursor as the XML only contains the cursor name. From the server side, I generate the cursor no matter if it contains records or not. On the client side, as the XML contains the cursor name, it will not go into the error which is displaying a messagebox. However, when continuing to XMLToCursor(), a situation occurs as it can't display the cursor. How can I detect if I have an empty cursor? Or, basically, is it better to send the structure all the time when generating the XML so XMLToCursor() will always work even if no record is part of it as it will always knows how to build the cursor from the data structure?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform