• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Creating an XML file with CF

New Here ,
Oct 04, 2007 Oct 04, 2007

Copy link to clipboard

Copied

I need to loop through a query to create an xml file. How do I create a file using CF? I thought maybe cffile but I don't see an attribute for "new", just things like append, delete, move etc... Am I missing something here? I've used cfheader to send content to the browser but just not sure how to create a file and place in on the server.

Any help would be appreciated GREATLY!!!!
TOPICS
Advanced techniques

Views

686

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 04, 2007 Oct 04, 2007

Copy link to clipboard

Copied

See if this helps:

http://tutorial97.easycfm.com/

--
Ken Ford
Adobe Community Expert - Dreamweaver
Fordwebs, LLC
http://www.fordwebs.com


"cfcolorado" <webforumsuser@macromedia.com> wrote in message news:fe3poc$cvf$1@forums.macromedia.com...
>I need to loop through a query to create an xml file. How do I create a file
> using CF? I thought maybe cffile but I don't see an attribute for "new", just
> things like append, delete, move etc... Am I missing something here? I've
> used cfheader to send content to the browser but just not sure how to create a
> file and place in on the server.
>
> Any help would be appreciated GREATLY!!!!
>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

Give <cffile action="write" ...> a shot. All the details are in the
documentation either locally or on the internet.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

Thanks to both of you. I'll look through the tutorial now.

I was also given the sample code below but receive an error.
<cfsaveconent variable="xmlString">
<!--- XML CREATION CODE HERE--->
</cfsavecontent>

<cffile action = "write" file = "c:\myXml.xml" output="#xmlString#">

When I try this approach I get the following error:
"Context validation error for tag cfsavecontent.
The end tag </cfsavecontent> encountered on line 28 at column 3 requires a matching start tag. "

At first I thought it was the XML I was trying to insert there but even if I remove all content in the <!--- XML CREATION CODE HERE---> section I still get the error. The XML als test fine on it's own.

Any thoughts?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

you are missing a t

<cfsavecontent variable="xmlString">
<!--- XML CREATION CODE HERE--->
</cfsavecontent>

should work now

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

That looks just fine in the email. I do stuff just like this all the time.

Are you sure there isn't a subtle typo in your code? Maybe a
misspelling of "cfsavecontent" somewhere?



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

SamNUK wrote:
> you are missing a t
>
> <cfsavecontent variable="xmlString">
> <!--- XML CREATION CODE HERE--->
> </cfsavecontent>
>
> should work now

Or a subtle misspelling in the email that I did not see! Good eye SamNUK.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

DOH!

Many thanks Sam! Have a great day!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

LATEST
thanks you to.

It is so easy to do, I am my own worst enemy when typing code

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation