Discussion Locked

Exporting to XML from Submit form

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to Export information from a flash mx 2004 Submit form into an XML document.
I do not want to overwrite the XML document but append to it.
The XML file feeds a calendar I have created in flash so when the XML file is updated the Flash file is updated and the date selected shows the information.
As long as my XML file and SWF file are in the same directory any changes I make to my XML file are shown in my SWF file.

I have read numerous articles on creating an XML from a submit form but this would overwrite all the data I have in the file and I want to append to it.

anyone have any Ideas or able to point me in the right direction>?

BTW any submit form will do for my purposes it doesnt have to be in lfash -- HTML ASP etc would work

Thanks in advance,
Nathan

4 replies

by jaqui

matter what tech you use to do it.
when you open the file to append data, it will be at the beginning of the file.
you have to read down to the end of file marker and then start writing the data to append.

if inserting any other place you have to read the file into the data you want added, from the insert point onwards.
then write it to disk again.
in a list:
1) open file. [ xml ]
2) find point to insert data.
3) insert data.
4) write file to disk.

by wiseone

Where in XML file the new data goes.
I just need to know how to get a submit form to append or edit the existing XML file
I dont really care where in the file the data goes.

This is my XML code BTW

It could be in the middle of the file when my calendar.swf reads the XML it will just populate the dates accordingly.

As I said I just cant figure out how to get my form to write into my XML file and not write over it.

I've been looking into an ASP script in Flash using the FileSystemObject to write to a file.
Does that sound right?

by jaqui

until you specify where to start writing the new data, it will write over the old file.

you have to create the complete new file in ram, with old file included, then write to disk, or you will just write over the old file.

by jbogart23

If you'd like, I have an XML function in ASP that I think will help. Just send me an email and I'll forward it on to you.

This discussion is closed to new replies.