Thanks for your help, Sergey.
I think I resolved that problem now. This self-generating code will clean up a SQL cursor before creating XML. In the instance below, I was converting the [statemnt] table, though it can be generalized easily. The Gencode function generates the script to do STRTRAN on any character-type fields to remove ascii characters < 31.
Naturally, I am finding that XMLTOCURSOR is inappropriate for larger data sets. I did a UT search and found that out, but I don't have an easy alternative for converting back to a cursor. This table has about 400,000 records. The XML compresses really well. I can zip a 300MB xml file to a 20mb zip and download it, now I just need to re-convert it on my end. Is there another approach that might be more fruitful?
Close Tables All
Close Databases All
Clear All
Release All
Set Classlib To
CLEAR
Use l:\Shared\statemnt In 0
Select * From statemnt Into Cursor mystmt Readwrite
SELECT MYSTMT
LOCAL cScript, cXMLFile
cScript = GENCODE1()
cXMLFile = [c:\crap\]+ALLTRIM(ALIAS())+[.xml]
EXECSCRIPT(cScript)
Cursortoxml(ALIAS(),cXMLFile,1,512,0,[1])
FUNCTION gencode1
Local lncount, laFldArray(2), cText
cText = ''
lncount = Afields(laFldArray,Alias())
TEXT TO cText NOSHOW ADDITIVE TEXTMERGE
LOCAL i
Select <<ALIAS()>>
FOR i = 1 TO 31
ENDTEXT
For I = 1 To lncount
If Inlist(laFldArray(I,2),[C],[M],[V])
TEXT TO cText NOSHOW ADDITIVE TEXTMERGE
REPLACE <<laFldArray(I,1)>> with STRTRAN(<<laFldArray(I,1)>>,CHR(i),SPACE(1)) ALL
ENDTEXT
Endif
Endfor
TEXT TO cText NOSHOW ADDITIVE TEXTMERGE
ENDFOR
ENDTEXT
RETURN CTEXT
EndFUNC
Jim Newsom
IT Director, ICG Inc.