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 Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

