Hi All
This place is becoming a home away from home for me :}
I have a user form with about 13 different user input fields.
I call them text 1-13 I would like to write them out to an XML file named by the date and time.
Can you point me in the right direction ?
Bob
Writing text to an XML file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Writing text to an XML file
Writing to a text file is pretty easy. There are (at least) two different ways:
For generating xml I usually don't bother with the built-in xml routines - it's easier to do this myself:
and, of course, you can get fancier with CDATA stuff or whatever as needed. Just gather all the xml into a variable, then put it into a text file and you're done.
Code: Select all
ask file -- see where the user wants to store the file
if it is not empty then
put tText into url ("file:" & tPath)
end if
Code: Select all
ask file -- see where the user wants to store the file
if it is not empty then
open file tPath
write tText to file tPath
close file tPath
end if
Code: Select all
function xmlTag pTag, pText
local tXML
put "<" & pTag & ">" into tXML
put pText after tXML
put "</" & pTag & ">" after tXML
return tXML
end xmlTag