Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLAdapter toXML defaults numeric fields to 0
Message
 
 
To
03/06/2005 12:05:17
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01019951
Message ID:
01020054
Views:
33
An empty cursor is a cursor w/o records. What blank cursor means?
BTW, you don't need macro substitution in that code at all
...
oXMLAdapter.AddTableSchema(ALLTRIM(tablenames.rec_type))
...
>
>When calling the toXML method, if the cursor I have loaded into the XMLAdapter object via AddTableSchema is blank, than it defaults to a 0 in the XML file. So I looped through all the tables I added and set the isnull property for every field to .T., but this doesn't seem to help. Are there any other properties that I am not finding that keep the toXML command from defaulting numeric fields to 0? I have included the relavent code below. Thanks in advance.
>LOCAL oXMLAdapter as XMLAdapter
>oXMLAdapter = NEWOBJECT('XMLAdapter')
>oXMLAdapter.RespectNesting = .T.
>oXMLAdapter.XMLSchemaLocation = ""
>
>*Add all the tables to the XMLAdapter object
>rec_type_counter = 1
>SELECT tablenames
>SCAN
>  command = "oXMLAdapter.AddTableSchema('"+tablenames.rec_type+"')"
>  &command
>  lc_count = oXMLAdapter.Tables.Item(rec_type_counter).Fields.count
>  FOR i=1 TO lc_count
>    oXMLAdapter.Tables.Item(rec_type_counter).Fields.item(i).isnull = .T.
>  ENDFOR
>  rec_type_counter = rec_type_counter + 1
>ENDSCAN
>	
>oXMLadapter.TOXML(lc_outfile_name,,.t.)
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform