On 12/10/06, James Holmes <[EMAIL PROTECTED]> wrote:
>
> <cfset
> temp=QuerySetCell(myQuery,"imgsrc",#galleryObject.Gallery.album[i].img[i].XmlAttributes.src#,
>
> #i#)>


Yeah, that was a typo, I've been trying everything I can think of... Here is
what I'm testing now and still no luck. I get the two gallery Albums
correctly but the images are only looping through the second album. No data
is displayed from the first. The Dump of MyQuery2 shows 4 rows instead of 5.
I have 3 pictures in the first album and 2 in the second. Only picture data
from the second album is being dumped.


<cfprocessingdirective suppresswhitespace="yes">
<cfsilent>
<!---GET THE XML FILE FOR THIS GALLERY--->

<cffile action="READ" file="#ExpandPath(PathToXml/XML/slideshow_84.xml')#"
variable="GalleryXML">
<cfset galleryObject = xmlParse(GalleryXML, FALSE)>

<!---SET THE START OF THE GALLERY CHILDNODES--->

<cfset gallery=galleryObject.Gallery.XmlChildren>

<!---SET THE NUMBER OF ROWS IN THE GALLERY--->

<cfset size=ArrayLen(gallery)>

<!---MAKE THE QUERIES THAT GENERATE THE ALBUM OUTPUT--->

<cfset myQuery=QueryNew("title, description" ) />
<cfset temp=QueryAddRow(myQuery, #size#)>

<!---FIRST LOOP IS NEEDED BECAUSE THERE ARE MULTIPLE ALBUMS IN A GALLERY--->

<cfloop index="i" from="1" to=#size#>
 <cfset
temp=QuerySetCell(myQuery,"title",#galleryObject.Gallery.album[i].XmlAttributes.title#,
#i#)>
 <cfset
temp=QuerySetCell(myQuery,"description",#galleryObject.Gallery.album[i].XmlAttributes.description#,
#i#)>

  <!---SET THE START OF THE ALBUM CHILDNODES--->

  <cfset galleryimg=galleryObject.Gallery.album[i].XmlChildren>

  <!---FIND OUT HOW MANY IMAGES ARE IN THE CURRENT ALBUM--->

  <cfset subsize=ArrayLen(galleryimg)>

  <cfset myQuery2=QueryNew("imgcaption, imgsrc, imgtitle, imgtn","VarChar,
VarChar, VarChar, VarChar" ) />
  <cfset temp2=QueryAddRow(myQuery2, #subsize#)>

  <!---SECOND LOOP IS NEEDE BECAUSE THERE ARE MULTIPLE IMAGES IN A ALBUM--->

  <cfset temp=QueryAddRow(myQuery2, #subsize#)>
  <cfloop index="j" from="1" to=#subsize#>
   <cfset
temp2=QuerySetCell(myQuery2,"imgcaption",#galleryObject.Gallery.album[i].img[j].XmlAttributes.caption#,
#j#)>
   <cfset
temp2=QuerySetCell(myQuery2,"imgsrc",#galleryObject.Gallery.album[i].img[j].XmlAttributes.src#,
#j#)>
   <cfset
temp2=QuerySetCell(myQuery2,"imgtitle",#galleryObject.Gallery.album[i].img[j].XmlAttributes.title#,
#j#)>
   <cfset
temp2=QuerySetCell(myQuery2,"imgtn",#galleryObject.Gallery.album[i].img[j].XmlAttributes.tn#,
#j#)>
  </cfloop>
</cfloop>
</cfsilent>
</cfprocessingdirective>
<cfdump var="#myQuery#">
<cfdump var="#myQuery2#">


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:263511
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to