Oops, missed Jon's message thereby repeating it. I guess the point is that
there are easy ways to do this: it's generally easier to manipulate a string
then parse it than it is to manipulate a CF XML data structure. But you
haven't explained what you're trying to do. If your collection looks like
this:

<collection>
        <file>some value</file>
        <file>some value</file>
        <file>some value</file>
        <file>some value</file>
</collection>

Then Jon's code will do the job surely?


> -----Original Message-----
> From: Matthew Walker [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, 17 June 2003 11:29 a.m.
> To: CF-Talk
> Subject: RE: Dynamically populating an XML document
> 
> <cfsavecontent variable="myxml">
>       <collection>
>               <cfoutput>
>                       <cfloop>
>                               <file>#value#</file>
>                       </cfloop>
>               </cfoutput>
>       </collection>
> </cfsavecontent>
> 
> The thing with XML is that it's just plain text, so it's pretty intuitive
> to
> work with before parsing. After parsing it seems to be relatively cryptic.
> 
> > -----Original Message-----
> > From: Owens, Howard [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, 17 June 2003 10:33 a.m.
> > To: CF-Talk
> > Subject: Dynamically populating an XML document
> >
> > I have a newly created XML document:
> >
> >  <cfscript>
> >     file_log = XmlNew();
> >     file_log.xmlRoot = XmlElemNew(file_log, "Collection");
> >     file_log.xmlRoot.XmlChildren[1] = XmlElemNew(file_log, "File");
> >  </cfscript>
> >
> > I want to loop over some values and insert them, so the document ends up
> > looking something like this:
> >
> > <collection>
> >     <file>some value</file>
> >     <file>some value</file>
> >     <file>some value</file>
> >     <file>some value</file>
> > </collection>
> >
> > I'm trying to insert with some variation of:
> >
> >  <cfset StructInsert(file_log.Collection.XmlAttributes, "File",
> > "selectedElements[i].XmlAttributes.id#.pdf")>
> >
> > But I keep getting this error with every thing I try:
> >
> > Missing argument name. When using named parameters to a function, every
> > parameter must have a name.
> >
> > 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

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

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

Reply via email to