General information
Title:
XMLAdapter toXML defaults numeric fields to 0
Hi,
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.)
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only