1 Reply Latest reply on Feb 2, 2010 2:16 PM by ilssac

    XML Output with multiple categories


      I am driving myself insane trying to get this to output and I can't seem to find much on the internet that is helpful. Sometimes there is 1 category and sometimes there could be 2.


      For example:


      <Heading>Study: Ban on cell phone use hasn't reduced accident rate</Heading>
      <Contents>Content regarding cell phone use.</Contents>
      <Category ID="438024898">General Auto News</Category>
      <Category ID="438022448">Electronics</Category>


      I set myitems with the xml search and can manage to output everything below perfectly, except for the multiple categories.


      <cfloop from="1" to="#arrayLen(myItems)#" index="i">



      #myItems[i].Categories.Category.xmltext#        this outputs only the first one, but I can not seem to get the second.




      Thanks for any help in advance!!!!

        • 1. Re: XML Output with multiple categories
          ilssac Level 5
          <cfloop from="1" to="#arrayLen(myItems[i].Categories.Category#" index="c"






          Category is just a nested array just like your myItems was.


          Or you could do another xmlSearch if you prefer.