Well, I got it working, didn't realize I could use the Array access
operator like I can in Actionscript and Javascript (ECMA praise here?).


Here is the script, but how can I make it cleaner  so not as much is
hardcoded - i.e. get names of all the fields and then loop over those x
number of times?

<cfscript>
        lrXML = XmlNew();
        lrXML.xmlRoot = XmlElemNew(lrXML,"lData");
        for (i = 1; i LTE #qAllLessons.RecordCount#; i = i + 1){
                lrXML.lData.XmlChildren[i] =
XmlElemNew(lrXML,"Content");
                lrXML.lData.XmlChildren[i].XmlChildren[1] =
XmlElemNew(lrXML,"ID");
                lrXML.lData.XmlChildren[i].XmlChildren[2] =
XmlElemNew(lrXML,"Lesson");
                lrXML.lData.XmlChildren[i].XmlChildren[3] =
XmlElemNew(lrXML,"Required");
                lrXML.lData.XmlChildren[i].XmlChildren[4] =
XmlElemNew(lrXML,"Time");
                lrXML.lData.XmlChildren[i].ID.XmlText =
#qLessons.ID[i]#;
                lrXML.lData.XmlChildren[i].Lesson.XmlText =
#qLessons.Lesson[i]#;
                lrXML.lData.XmlChildren[i].Required.XmlText =
#qLessons.Required[i]#;
                lrXML.lData.XmlChildren[i].Time.XmlText =
#qLessons.Time[i]#;
        }
</cfscript>

Jason Merrill   |   E-Learning Solutions   |  icfconsulting.com






NOTICE:
This message is for the designated recipient only and may contain privileged or 
confidential information. If you have received it in error, please notify the 
sender immediately and delete the original. Any other use of this e-mail by you 
is prohibited.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:211757
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to