and also if you using the query then you need to do <cfoutput query
Main Topics
Browse All Topicsi have the folling code that write to an xml file:
<cfoutput>
<CFXML variable="event">
<event>
<date>#form.date#</date>
<time>#form.time#</time>
<title>#form.title#</title
<image>images/kiss.jpg</im
<description>
<![CDATA[#form.description
</description>
<link><![CDATA[]]></link>
</event>
</CFXML>
</cfoutput>
<cffile action="append" charset="utf-8" file = "D:\Hosting\knicknoc\think
This is the file that was generated:
<br>
<br>
<cfdump var="#event#">
everytime I append to the page it recreates the <?xml version="1.0" encoding="UTF-8"?> and also i want it to append between 2 the events tags as you see below, no matter how many times they do the <event> write or append. What do I need to do???
i need to change it so that it will write into a page like this:
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event>
<date>01/03/2001</date>
<time>9:30p</time>
<title>test2</title>
<image>images/kiss.jpg</im
<description>
<![CDATA[test description 2]]>
</description>
<link/>
</event>
<event>
<date>01/03/2001</date>
<time>9:30p</time>
<title>test2</title>
<image>images/kiss.jpg</im
<description>
<![CDATA[test description 2]]>
</description>
<link/>
</event>
<event>
<date>01/03/2001</date>
<time>9:30p</time>
<title>test2</title>
<image>images/kiss.jpg</im
<description>
<![CDATA[test description 2]]>
</description>
<link/>
</event>
</events>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
thats not quite it
let say I have this already:
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event>
<date>01/03/2001</date>
<time>9:30p</time>
<title>test2</title>
<image>images/kiss.jpg</image
<description>
<![CDATA[test description 2]]>
</description>
<link/>
</event>
</events>
then they add a new event i want it to append like this:
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event>
<date>01/03/2001</date>
<time>9:30p</time>
<title>test2</title>
<image>images/kiss.jpg</image
<description>
<![CDATA[test description 2]]>
</description>
<link/>
</event>
::::::::::::::::::::::::::
<event>
<date>08/07/2008</date>
<time>10:30p</time>
<title>test3</title>
<image>images/kiss.jpg</image
<description>
<![CDATA[test description 3]]>
</description>
<link/>
</event>
</events>
check some of these options
http://labs.adobe.com/tech
You're always going to have a hard time "appending" to an xml file because of its nature. If you append to an xml file you in a sense tack something on the end, well xml files usually have a root node, if you append after that you'll have issues.
To fix your issue I would read in your XML document, then append your new elements to the XML structure, then write the file back out. I would never append to the end.
Business Accounts
Answer for Membership
by: erikTsomikPosted on 2008-09-11 at 11:46:11ID: 22453183
try htis
Select allOpen in new window