Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLAdapter toXML defaults numeric fields to 0
Message
 
 
To
06/06/2005 15:59:26
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:
01020639
Views:
20
This message has been marked as the solution to the initial question of the thread.
Hi Kristin,

If you want Nulls in XML you've to put Nulls instead of empty values in the cursor fields. The IsNull property only controls if Nulls are allowed for specific field.

>Sorry, I meant to say that if there is an empty numeric field in the cursor, than it defaults to a 0 in the XML output. I would have thought that the isnull property = .T. would suppress the 0, but it did not seem to help. I have changed my code per your suggestion to:
>
>
>rec_type_counter = 1
>SELECT tablenames
>SCAN
>  oXMLAdapter.AddTableSchema(ALLTRIM(tablenames.rec_type))
>  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.)
>
>
>Thanks for you help.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform