Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need XML from a table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00549739
Message ID:
00550666
Vues:
14
>Just a word of warning: VFP's CURSORTOXML() is fairly limited in waht you can do with it. Yes it will generate valid XML with a schema but XMLTOCURSOR() will only import data of that same format including a schema! Without a schema VFP will try to guess at the structure to create a cursor for you and it doesn't guess so well.
>The problem here is that the schema a) is not used by any shipping software (it's the .Net beta 2 single datatable of a dataset schema) b) can't be made to fit any other data. This includes importing data from SQL Server generated by the XML extensions which don't work either.
>I was pretty bummed about this because this really means that the XML import features only work with data that was generated by VFP in the frist place. The speed would have been nice for a number of things, but with these limitations it's not terribly useful.

The issue here is not the behavior or usefulness of CURSORTOXML(), but the fact that you are trying to use the function in a way in which is was not designed to be used. What you want is to be able to 'inherit/use' an existing table/cursor schema to import XML from an instance document with no schema and have VFP figure out what elements/tags need to update which columns. While that is a great ER and something we are now looking into adding in the future, the CURSORTOXML() function is designed to work of an exisitng schema either inline or external. There is full compatibiliy in VFP7 with SQLServer2000 SQLXML, and I think other replies in this thread discuss that issue.

If you have a cursor/table that you want populated and you know the XML instance document structure (schema) but don't want to generate a schema on the fly, why can't you have an exisitng XSD schema already created and referenced that you can use which is based on the cursor/table you are appending to? People should not feel that CURSORTOXML() is not useful or is design wrong. It works properly for the way it was designed and is very useful. Is there a problem with you having an exisiting XSD schema that you can reference for tables you are appending XML to? If we create the 'feature' you are asking, it may very well be a new command like APPENDFROMXML() or something because it goes beyond and is different behavior and design from CURSORTOXML(). We should work on how you can use/leverage this funciton in your classes now and also discuss what can be done in the future for more flexible XML functionality in VFP.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform