Web Development

General discussion


Exporting to XML from Submit form

By wiseone ·
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,

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -


by Jaqui In reply to Exporting to XML from Sub ...

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.

Collapse -

It doesnt matter

by wiseone In reply to doesn't

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

<events startDate="2003-01-01" endDate="2005-12-31">
<event title="Party Availability" description="Reserved" startDate="2005-08-15 11:00:00" endDate="2005-08-15 12:00:00" allDay="0" eventType="once" />
<event title="Party Availability" description="Available" startDate="2005-08-15 09:00:00" endDate="2005-08-15 11:00:00" allDay="0" eventType="once" />
<event title="Party Availability" description="Available" startDate="2005-08-16 09:00:00" endDate="2005-08-16 10:00:00" allDay="0" eventType="once" />
<event title="Party Availability" description="Available" startDate="2005-09-16 09:00:00" endDate="2005-09-16 10:00:00" allDay="0" eventType="once" />
<event title="Test Event 5" description="every second tuesday" startDate="2003-01-01" endDate="2003-12-31" allDay="1" eventType="weekly">
<pattern sun="0" sat="0" fri="0" thu="0" wed="0" tue="1" mon="0" recur="2" />
<event title="Test Event 6" description="third wednesday of each month, see <u> <a href='http://www.sparkos.com/'>sparkos.com</a> </u>" startDate="2003-01-01" endDate="2003-12-31" allDay="1" eventType="monthly">
<pattern day="wed" week="3" recur="1" />
<event title="Test Event 7" description="last friday of april" startDate="2003-01-01" endDate="2003-12-31" allDay="1" eventType="yearly">
<pattern day="fri" week="5" month="3" />

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?

Collapse -


by Jaqui In reply to It doesnt matter

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.

Collapse -

XML function

by jbogart23 In reply to Exporting to XML from Sub ...

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.

Related Discussions

Related Forums