Hi Frank
Depending on how you need your XML file formatted, the following code will create an xml file (a basic file with no schema). Remembering that xml is just fancy formatted text.
Hope this helps
!!-file path
fspec="C:\Your File Path\File Name.xml"
!!-First write - note this uses Mode = WO
chx = open("text",fspec,"Separator='\t',Mode = WO,FULLPATH")
OUTPUT chx, 1,1,"<Header 1>"
OUTPUT chx,1,2," <Header 2>"
close chx
!!- Create the main part of the xml file - note we use Mode = WA (Write Append Here)
!!- Loop into this sub routine as required
gosub 'Write XML Body'
!!-Finish off with this
ch = open("text",fspec,"Separator='\t',Mode = WA,FULLPATH")
OUTPUT ch,1,1," </Header 2>"
OUTPUT ch, 1,2,"</Header 1>"
close ch
end
!!=========
'Write XML Body':
ch = open("text",fspec,"Separator='\t',Mode = WA,FULLPATH")
OUTPUT ch,1,1,"<Body 1>"
OUTPUT ch,1,2,"<Field 2>" + Parameter1 + "</Field 2>"
OUTPUT ch,1,3,"<Field 3>" + Parameter2 + "</Field 3>"
OUTPUT ch,1,4,"<Field 4>" + Parameter3 + "</Field 4>"
OUTPUT ch,1,5,"<Field 5>" + Parameter4 + "</Field 5>"
OUTPUT ch,1,6,"<Field 6>"
OUTPUT ch,1,7,Parameter5
OUTPUT ch,1,8,"</Field 6>"
OUTPUT ch,1,9,"<Field 7>" + Parameter6 + "</Field 7>"
OUTPUT ch,1,10,"</Body 1>"
close ch
return