Peter: 2 quick thoughts (while I get a chance to hunt some code for you - gotta get some things done first)
1) since cf deals with xml as arrays and structs, you could probably add the xml "bits" as structs. just keep the xml root node (one only) 2) if they're coming from a query, how about combining the queries using cf functions (in memory - not back to a db table) and convert the result of that to xml hope this helps cheers barry.b -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, 7 January 2005 9:23 AM To: CFAussie Mailing List Subject: [cfaussie] Merging xml child nodes in ColdFusion MX6.1 Hi I just started playing with xml and I need to know how to merge two child nodes (fileName) in the same file. The cfmx code is below. Basically I'm using two queries (fileQuery1 and fileQuery2) to combine files from two directories into on xml file so I can hopefully sort file names in name order (I want to do this with 6 directories in the end). "rowTitle" is to be used to display which directory (or "page") each file is from. "rowTitle" is the reason why I'm trying to do this with xml, I haven't figured out how to use a query (with cfDirectory) to extract the directory name for output The only other way I could figure of doing this is the insert the results from the seperate queries into a database table, with "rowTitle" hardcoded for each separate query but I'm worried this will slow down things too much for the page load from the remote server Thanks Peter Mount [EMAIL PROTECTED] [EMAIL PROTECTED] <cfxml variable="xmlFileName"> <fileList> <fileName> <cfloop query="fileQuey1" startrow="#subStart#" endrow="#subDisplay#"> <cfoutput query="fileQuery1" startrow="#subStart#" maxrows="#subDisplay#"> <fileName>#fileQuery1.name#</fileN ame> <dateLastModified>#fileQuery1.datelastmodified#</dateLastModified> <rowTitle>Client File Unauthorised</rowTitle> </cfoutput> </cfloop> </fileName> <fileName> <cfloop query="fileQuery2" startrow="#subStart#" endrow="#subDisplay#"> <cfoutput query="fileQuery2" startrow="#subStart#" maxrows="#subDisplay#"> <fileName>#fileQuery2.name#</fileN ame> <dateLastModified>#fileQuery2.datelastmodified#</dateLastModified> <rowTitle>Client File Draft</rowTitle> </cfoutput> </cfloop> </fileName> </fileList> </cfxml> <cfset xml=#ToString(xmlFileName)#> <cffile action="write" file="#getDirectoryFromPath(getTemplatePath())#/xml/xmlFileQuery.xml" output="#xml#"> <cffile action="read" file="#ExpandPath('.')#/xml/xmlFileQuery.xml" variable="xmlFileNameText"> <cfset myXmlDocument=XmlParse(xmlFileNameText)> -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/ --- You are currently subscribed to cfaussie as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/
