If nothing else, could you generate the structure in a non-XML struct, and
then once it's completely generated, iterate over it to generate text inside
CFSAVECONTENT or CFXML?  Hardly an elegant solution, but sometimes that's
what you have to go with.

barneyb

---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com

> -----Original Message-----
> From: Owens, Howard [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 16, 2003 4:13 PM
> To: CF-Talk
> Subject: RE: Dynamically populating an XML document
>
>
> Thanks, but ...
>
> That won't work for me because I wind up with a loop inside a
> loop, looping
> over the same elements.
>
> I need to dynamically increase the size of my structure with each loop and
> output after the loop exists.
>
> I guess I'm thinking about this wrong, and I need to use an array of
> structures.
>
> H.
>
>
> > -----Original Message-----
> > From:       [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]
> > Sent:       Monday, June 16, 2003 4:05 PM
> > To: CF-Talk
> > Subject:    Re: Dynamically populating an XML document
> >
> > I've never been in a situation where create a document via the DOM was
> > necessary. cfsavecontent does the trick for me.
> >
> > <cfsavecontent variable="foo">
> > <collection>
> >         <cfloop...>
> >         <file>some value</file>
> >         </cfloop>
> > </collection>
> > </cfsavecontent>
> >
> > <cfset file_log = xmlParse(foo)>
> >
> > --
> > mailto:[EMAIL PROTECTED]
> > Monday, June 16, 2003, 6:33:22 PM, you wrote:
> >
> > OH> I have a newly created XML document:
> >
> > OH>  <cfscript>
> > OH>         file_log = XmlNew();
> > OH>         file_log.xmlRoot = XmlElemNew(file_log, "Collection");
> > OH>         file_log.xmlRoot.XmlChildren[1] = XmlElemNew(file_log,
> > "File");
> > OH>  </cfscript>
> >
> > OH> I want to loop over some values and insert them, so the
> document ends
> > up
> > OH> looking something like this:
> >
> > OH> <collection>
> > OH>         <file>some value</file>
> > OH>         <file>some value</file>
> > OH>         <file>some value</file>
> > OH>         <file>some value</file>
> > OH> </collection>
> >
> > OH> I'm trying to insert with some variation of:
> >
> > OH>  <cfset StructInsert(file_log.Collection.XmlAttributes, "File",
> > OH> "selectedElements[i].XmlAttributes.id#.pdf")>
> >
> > OH> But I keep getting this error with every thing I try:
> >
> > OH> Missing argument name. When using named parameters to a function,
> > every
> > OH> parameter must have a name.
> >
> > OH> I'm not getting what I'm missing?
> >
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. 
http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to