If you are just after products, you can dramatically simplify the code by using xmlsearch() to get them with xpath instead of manually looping multiple levels down.
-- Shu Ha Ri: Agile and .NET blog http://www.bifrost.com.au/ On 31 December 2011 08:50, Justin Scott <[email protected]> wrote: > > > Okay... I've worked this every way I can think > > of and, I admit it, I just don't get it. > > Hi Rick, replace your inner-most loop with the following. It should > get you going in the right direction. It looks like there is another > layer of sub-categories which needs to be accounted for: > > <!--- Loop over the sub-categories ---> > <cfloop from='1' to='#arrayLen(xmlProductContent.products.SubCategory)#' > index='subCategoryCount'> > > <!--- Localize our current sub-category ---> > <cfset thisSubCategory = > xmlProductContent.products.SubCategory[subCategoryCount] /> > <h2>#thisSubCategory.SubCategoryName.xmlText#</h2> > > <!--- Loop over the products in this sub-category ---> > <cfloop from="1" to="#arrayLen(thisSubCategory.Product)#" > index="productCount"> > <!--- Localize our current product for easier access ---> > <cfset thisProduct = thisSubCategory.Product[productCount] /> > <!---<cfdump var="#thisProduct#" />---> > <p> > ID: #thisProduct.xmlAttributes.ID#<br /> > Model Name: #thisProduct.ModelName.xmlText#<br /> > Image: <img src="#thisProduct.SmallImage.xmlText#" /> > </p> > </cfloop> <!--- Products ---> > > </cfloop> <!--- Sub-Categories ---> > > > -Justin Scott > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:349275 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

