We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Geting XML Value from Nested CFLOOP

jeffmace
jeffmace asked
on
Medium Priority
398 Views
Last Modified: 2012-05-06
I am getting the same values over and over again.  I am not sure what I am doing wrong with this nested loop.

Here is my code, the FULL XML CODE IS BELOW

<CFHTTP url="URL HERE" method="get">
<cfset xmlDoc = XMLParse(cfhttp.filecontent)>
<cfoutput>
  <cfloop from="1" to="#ArrayLen(xmlDoc.Demographics.response.pages.page)#" index="i">
    <strong>#xmlDoc.Demographics.response.pages.page[i].name.xmlText#</strong><br>
    <cfloop from="1" to="#ArrayLen(xmlDoc.Demographics.response.pages.page.tables.table)#" index="x">
      #xmlDoc.Demographics.response.pages.page.tables.table[x].name.xmlText#<br>
      <cfloop from="1" to="#ArrayLen(xmlDoc.Demographics.response.pages.page.tables.table.data.attribute)#" index="y">
        #xmlDoc.Demographics.response.pages.page.tables.table.data.attribute[y].name.xmlText#<br>
        <cfloop from="1" to="#ArrayLen(xmlDoc.Demographics.response.pages.page.tables.table.data.attribute.values)#" index="z">
         Neighborhood: #xmlDoc.Demographics.response.pages.page.tables.table.data.attribute.values[z].neighborhood.value.xmlText#<br>
         City: #xmlDoc.Demographics.response.pages.page.tables.table.data.attribute.values[z].city.value.xmlText#<br>
         Nation: #xmlDoc.Demographics.response.pages.page.tables.table.data.attribute.values[z].nation.value.xmlText#<br><br>
        </cfloop>
      </cfloop>
    </cfloop>
    <br>
    <br>
  </cfloop>
</cfoutput>
<?xml version="1.0" encoding="utf-8" ?> 
- <Demographics:demographics xmlns:Demographics="http://www.zillow.com/static/xsd/Demographics.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zillow.com/static/xsd/Demographics.xsd /vstatic/81d13a774afdb0ce0935e5c0fd1f0b3d/static/xsd/Demographics.xsd">
- <request>
  <state>WA</state> 
  <city>Seattle</city> 
  <neighborhood>Ballard</neighborhood> 
  </request>
- <message>
  <text>Request successfully processed</text> 
  <code>0</code> 
  </message>
- <response>
- <region>
  <id>250017</id> 
  <state>Washington</state> 
  <city>Seattle</city> 
  <neighborhood>Ballard</neighborhood> 
  </region>
- <links>
  <main>http://www.zillow.com/local-info/WA-Seattle/Ballard/</main> 
  <affordability>http://www.zillow.com/local-info/WA-Seattle/Ballard-home-value/</affordability> 
  <homesandrealestate>http://www.zillow.com/local-info/WA-Seattle/Ballard-homes/</homesandrealestate> 
  <people>http://www.zillow.com/local-info/WA-Seattle/Ballard-people/</people> 
  <forSale>http://www.zillow.com/homes/for_sale/Ballard-Seattle-WA-98117/</forSale> 
  <forSaleByOwner>http://www.zillow.com/homes/fsbo/Ballard-Seattle-WA-98117/</forSaleByOwner> 
  <foreclosures>http://www.zillow.com/homes/for_sale/Ballard-Seattle-WA-98117/fore_lt/</foreclosures> 
  </links>
- <charts>
- <chart>
  <name>Average Condo Value</name> 
  <url>http://www.zillow.com/app?chartType=affordability_avgCondoValue&graphType=barChart&regionId=250017&regionType=8&service=chart</url> 
  </chart>
- <chart>
  <name>Average Home Value</name> 
  <url>http://www.zillow.com/app?chartType=affordability_avgHomeValue&graphType=barChart&regionId=250017&regionType=8&service=chart</url> 
  </chart>
- <chart>
  <name>Dollars Per Square Feet</name> 
  <url>http://www.zillow.com/app?chartType=affordability_pricePerSqft&graphType=barChart&regionId=250017&regionType=8&service=chart</url> 
  </chart>
- <chart>
  <name>Zindex Distribution</name> 
  <url>http://www.zillow.com/app?chartType=affordability_ZindexByDistribution&graphType=barChart&regionId=250017&regionType=8&service=chart</url> 
  </chart>
- <chart>
  <name>Home Type</name> 
  <url>http://www.zillow.com/app?chartType=home_homeType&graphType=barChart&regionId=250017&regionType=8&service=chart</url> 
  </chart>
- <chart>
  <name>Owners vs. Renters</name> 
  <url>http://www.zillow.com/app?chartType=home_ownVsRent&graphType=barChart&regionId=250017&regionType=8&service=chart</url> 
  </chart>
- <chart>
  <name>Home Size in Square Feet</name> 
  <url>http://www.zillow.com/app?chartType=home_homeSize&graphType=barChart&regionId=250017&regionType=8&service=chart</url> 
  </chart>
- <chart>
  <name>Year Built</name> 
  <url>http://www.zillow.com/app?chartType=home_yearBuilt&graphType=barChart&regionId=250017&regionType=8&service=chart</url> 
  </chart>
  </charts>
- <market>
  <forSaleCount>32</forSaleCount> 
  <recentlySoldCount>159</recentlySoldCount> 
  </market>
- <pages>
- <page>
  <name>Affordability</name> 
- <tables>
- <table>
  <name>Affordability Data</name> 
- <data>
- <attribute>
  <name>Zillow Home Value Index</name> 
- <values>
- <neighborhood>
  <value currency="USD">363000</value> 
  </neighborhood>
- <city>
  <value currency="USD">403000</value> 
  </city>
- <nation>
  <value currency="USD">204769</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>1-Yr. Change</name> 
- <values>
- <neighborhood>
  <value currency="USD">-0.1387900355871886</value> 
  </neighborhood>
- <city>
  <value currency="USD">-0.11816192560175055</value> 
  </city>
- <nation>
  <value currency="USD">-0.10533950253190551</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Zestimate Per Sq. Ft.</name> 
- <values>
- <neighborhood>
  <value currency="USD">346.8387</value> 
  </neighborhood>
- <city>
  <value currency="USD">369.0076</value> 
  </city>
- <nation>
  <value currency="USD">257.6997</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Flips (Sold Twice Within the Last Yr.)</name> 
- <values>
- <neighborhood>
  <value type="percent">0</value> 
  </neighborhood>
- <city>
  <value type="percent">0.010662789288743</value> 
  </city>
- <nation>
  <value type="percent">0.02302134345647</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Turnover (Sold Within Last Yr.)</name> 
- <values>
- <neighborhood>
  <value type="percent">0.08763144717075613</value> 
  </neighborhood>
- <city>
  <value type="percent">0.04222844190199399</value> 
  </city>
- <nation>
  <value type="percent">0.02177690128703452</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Property Tax</name> 
- <values>
- <neighborhood>
  <value currency="USD">2874.5667</value> 
  </neighborhood>
- <city>
  <value currency="USD">3773.5624</value> 
  </city>
- <nation>
  <value currency="USD">2861.1644</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Median Condo Value</name> 
- <values>
- <neighborhood>
  <value currency="USD">312000</value> 
  </neighborhood>
- <city>
  <value currency="USD">342000</value> 
  </city>
- <nation>
  <value currency="USD">216500</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Median Single Family Home Value</name> 
- <values>
- <neighborhood>
  <value currency="USD">471000</value> 
  </neighborhood>
- <city>
  <value currency="USD">470000</value> 
  </city>
- <nation>
  <value currency="USD">234000</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Median 2-Bedroom Home Value</name> 
- <values>
- <neighborhood>
  <value currency="USD">371000</value> 
  </neighborhood>
- <city>
  <value currency="USD">394500</value> 
  </city>
- <nation>
  <value currency="USD">205000</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Median 3-Bedroom Home Value</name> 
- <values>
- <neighborhood>
  <value currency="USD">421500</value> 
  </neighborhood>
- <city>
  <value currency="USD">464000</value> 
  </city>
- <nation>
  <value currency="USD">231500</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Median 4-Bedroom Home Value</name> 
- <values>
- <neighborhood>
  <value currency="USD">496000</value> 
  </neighborhood>
- <city>
  <value currency="USD">531000</value> 
  </city>
- <nation>
  <value currency="USD">337500</value> 
  </nation>
  </values>
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-PricePerSqFt</name> 
- <data>
- <attribute>
  <name>$100-200</name> 
  <value type="percent">0.01031991744066</value> 
  </attribute>
- <attribute>
  <name>$200-300</name> 
  <value type="percent">0.259029927760577</value> 
  </attribute>
- <attribute>
  <name>$300-400</name> 
  <value type="percent">0.506707946336429</value> 
  </attribute>
- <attribute>
  <name>$400-500</name> 
  <value type="percent">0.195046439628482</value> 
  </attribute>
- <attribute>
  <name>$500-600</name> 
  <value type="percent">0.018575851393188</value> 
  </attribute>
- <attribute>
  <name>$600-800</name> 
  <value type="percent">0.004643962848297</value> 
  </attribute>
- <attribute>
  <name><$100</name> 
  <value type="percent">0.004643962848297</value> 
  </attribute>
- <attribute>
  <name>>$800k</name> 
  <value type="percent">0.001031991744066</value> 
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-ZestimateBand</name> 
- <data>
- <attribute>
  <name>$100-200k</name> 
  <value type="percent">0.024549098196392</value> 
  </attribute>
- <attribute>
  <name>$200-300k</name> 
  <value type="percent">0.20440881763527</value> 
  </attribute>
- <attribute>
  <name>$300-400k</name> 
  <value type="percent">0.242985971943887</value> 
  </attribute>
- <attribute>
  <name>$400-500k</name> 
  <value type="percent">0.274549098196392</value> 
  </attribute>
- <attribute>
  <name>$500-600k</name> 
  <value type="percent">0.142785571142284</value> 
  </attribute>
- <attribute>
  <name>$600-800k</name> 
  <value type="percent">0.082164328657314</value> 
  </attribute>
- <attribute>
  <name>>$800k</name> 
  <value type="percent">0.01002004008016</value> 
  </attribute>
  </data>
  </table>
- <table>
  <name>Zindex:ZindexHomeType</name> 
- <data>
- <attribute>
  <name>Condo</name> 
  <value currency="USD">312000</value> 
  </attribute>
- <attribute>
  <name>SFR</name> 
  <value currency="USD">471000</value> 
  </attribute>
  </data>
  </table>
  </tables>
  </page>
- <page>
  <name>Homes & Real Estate</name> 
- <tables>
- <table>
  <name>Homes & Real Estate Data</name> 
- <data>
- <attribute>
  <name>Owners</name> 
- <values>
- <neighborhood>
  <value type="percent">0.35028618</value> 
  </neighborhood>
- <city>
  <value type="percent">0.48412441</value> 
  </city>
- <nation>
  <value type="percent">0.66268764</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Renters</name> 
- <values>
- <neighborhood>
  <value type="percent">0.64971382</value> 
  </neighborhood>
- <city>
  <value type="percent">0.51587559</value> 
  </city>
- <nation>
  <value type="percent">0.33731236</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Median Home Size (Sq. Ft.)</name> 
- <values>
- <neighborhood>
  <value>1170</value> 
  </neighborhood>
- <city>
  <value>1460</value> 
  </city>
- <nation>
  <value>1548</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Avg. Year Built</name> 
- <values>
- <neighborhood>
  <value>1987</value> 
  </neighborhood>
- <city>
  <value>1948</value> 
  </city>
- <nation>
  <value>1974</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Single-Family Homes</name> 
- <values>
- <neighborhood>
  <value type="percent">0.274411617426139</value> 
  </neighborhood>
- <city>
  <value type="percent">0.744142613732302</value> 
  </city>
- <nation>
  <value type="percent">0.773489943802217</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Condos</name> 
- <values>
- <neighborhood>
  <value type="percent">0.495242864296444</value> 
  </neighborhood>
- <city>
  <value type="percent">0.198488515480691</value> 
  </city>
- <nation>
  <value type="percent">0.089624612631314</value> 
  </nation>
  </values>
  </attribute>
  </data>
  </table>
- <table>
  <name>BuiltYear</name> 
- <data>
- <attribute>
  <name>>2000</name> 
  <value type="percent">0.376753507014028</value> 
  </attribute>
- <attribute>
  <name>1900-1919</name> 
  <value type="percent">0.21192384769539</value> 
  </attribute>
- <attribute>
  <name>1920-1939</name> 
  <value type="percent">0.049599198396793</value> 
  </attribute>
- <attribute>
  <name>1940-1959</name> 
  <value type="percent">0.054108216432865</value> 
  </attribute>
- <attribute>
  <name>1960-1979</name> 
  <value type="percent">0.119739478957915</value> 
  </attribute>
- <attribute>
  <name>1980-1999</name> 
  <value type="percent">0.187875751503006</value> 
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-HomeSize</name> 
- <data>
- <attribute>
  <name><1000sqft</name> 
  <value type="percent">0.390407426508509</value> 
  </attribute>
- <attribute>
  <name>>3600sqft</name> 
  <value type="percent">0.022176379577101</value> 
  </attribute>
- <attribute>
  <name>1000-1400sqft</name> 
  <value type="percent">0.294481691593604</value> 
  </attribute>
- <attribute>
  <name>1400-1800sqft</name> 
  <value type="percent">0.136668385765858</value> 
  </attribute>
- <attribute>
  <name>1800-2400sqft</name> 
  <value type="percent">0.077875193398659</value> 
  </attribute>
- <attribute>
  <name>2400-3600sqft</name> 
  <value type="percent">0.076843733883445</value> 
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-HomeType</name> 
- <data>
- <attribute>
  <name>Condo</name> 
  <value type="percent">0.495242864296444</value> 
  </attribute>
- <attribute>
  <name>Other</name> 
  <value type="percent">0.230345518277416</value> 
  </attribute>
- <attribute>
  <name>SingleFamily</name> 
  <value type="percent">0.274411617426139</value> 
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-Occupancy</name> 
- <data>
- <attribute>
  <name>Own</name> 
  <value type="percent">0.35028618</value> 
  </attribute>
- <attribute>
  <name>Rent</name> 
  <value type="percent">0.64971382</value> 
  </attribute>
  </data>
  </table>
  </tables>
  </page>
- <page>
  <name>People</name> 
- <tables>
- <table>
  <name>People Data</name> 
- <data>
- <attribute>
  <name>Median Household Income</name> 
- <values>
- <neighborhood>
  <value currency="USD">41202.9453206937</value> 
  </neighborhood>
- <city>
  <value currency="USD">45736</value> 
  </city>
- <nation>
  <value currency="USD">44512.0130806292</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Single Males</name> 
- <values>
- <neighborhood>
  <value type="percent">0.218182040689239</value> 
  </neighborhood>
- <city>
  <value type="percent">0.230033266826908</value> 
  </city>
- <nation>
  <value type="percent">0.146462187349365</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Single Females</name> 
- <values>
- <neighborhood>
  <value type="percent">0.197726979090431</value> 
  </neighborhood>
- <city>
  <value type="percent">0.187486853578992</value> 
  </city>
- <nation>
  <value type="percent">0.124578258618535</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Median Age</name> 
- <values>
- <neighborhood>
  <value>39</value> 
  </neighborhood>
- <city>
  <value>37</value> 
  </city>
- <nation>
  <value>36</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Homes With Kids</name> 
- <values>
- <neighborhood>
  <value type="percent">0.149933859172205</value> 
  </neighborhood>
- <city>
  <value type="percent">0.181808339938523</value> 
  </city>
- <nation>
  <value type="percent">0.313623902816284</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Average Household Size</name> 
- <values>
- <neighborhood>
  <value>1.82278897942217</value> 
  </neighborhood>
- <city>
  <value>2.08</value> 
  </city>
- <nation>
  <value>2.58883240001203</value> 
  </nation>
  </values>
  </attribute>
- <attribute>
  <name>Average Commute Time (Minutes)</name> 
- <values>
- <neighborhood>
  <value>26.56776121676753</value> 
  </neighborhood>
- <city>
  <value>26.6363786935206</value> 
  </city>
- <nation>
  <value>26.375545725891282</value> 
  </nation>
  </values>
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-AgeDecade</name> 
- <data>
- <attribute>
  <name>>=70s</name> 
  <value type="percent">0.114872901061</value> 
  </attribute>
- <attribute>
  <name>0s</name> 
  <value type="percent">0.0698273234810158</value> 
  </attribute>
- <attribute>
  <name>10s</name> 
  <value type="percent">0.0614721332267584</value> 
  </attribute>
- <attribute>
  <name>20s</name> 
  <value type="percent">0.210411237406907</value> 
  </attribute>
- <attribute>
  <name>30s</name> 
  <value type="percent">0.222130722421361</value> 
  </attribute>
- <attribute>
  <name>40s</name> 
  <value type="percent">0.159760457231474</value> 
  </attribute>
- <attribute>
  <name>50s</name> 
  <value type="percent">0.100382039995932</value> 
  </attribute>
- <attribute>
  <name>60s</name> 
  <value type="percent">0.0611431851755522</value> 
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-CommuteTime</name> 
- <data>
- <attribute>
  <name><10min</name> 
  <value type="percent">0.116523248268039</value> 
  </attribute>
- <attribute>
  <name>>=60min</name> 
  <value type="percent">0.0482377198229543</value> 
  </attribute>
- <attribute>
  <name>10-20min</name> 
  <value type="percent">0.266281330068427</value> 
  </attribute>
- <attribute>
  <name>20-30min</name> 
  <value type="percent">0.255069379257092</value> 
  </attribute>
- <attribute>
  <name>30-45min</name> 
  <value type="percent">0.189151878627933</value> 
  </attribute>
- <attribute>
  <name>45-60min</name> 
  <value type="percent">0.124736443955555</value> 
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-Household</name> 
- <data>
- <attribute>
  <name>NoKids</name> 
  <value type="percent">0.850066140827795</value> 
  </attribute>
- <attribute>
  <name>WithKids</name> 
  <value type="percent">0.149933859172205</value> 
  </attribute>
  </data>
  </table>
- <table>
  <name>Census Summary-RelationshipStatus</name> 
- <data>
- <attribute>
  <name>Divorced-Female</name> 
  <value type="percent">0.0854375513590899</value> 
  </attribute>
- <attribute>
  <name>Divorced-Male</name> 
  <value type="percent">0.0602982799519792</value> 
  </attribute>
- <attribute>
  <name>Married-Female</name> 
  <value type="percent">0.178297193386233</value> 
  </attribute>
- <attribute>
  <name>Married-Male</name> 
  <value type="percent">0.186687382837076</value> 
  </attribute>
- <attribute>
  <name>Single-Female</name> 
  <value type="percent">0.197726979090431</value> 
  </attribute>
- <attribute>
  <name>Single-Male</name> 
  <value type="percent">0.218182040689239</value> 
  </attribute>
- <attribute>
  <name>Widowed-Female</name> 
  <value type="percent">0.0632616593158969</value> 
  </attribute>
- <attribute>
  <name>Widowed-Male</name> 
  <value type="percent">0.0101089133700551</value> 
  </attribute>
  </data>
  </table>
  </tables>
- <segmentation>
- <liveshere>
  <title>Makin' It Singles</title> 
  <name>Upper-scale urban singles.</name> 
  <description>Pre-middle-age to middle-age singles with upper-scale incomes. May or may not own their own home. Most have college educations and are employed in mid-management professions.</description> 
  </liveshere>
- <liveshere>
  <title>Aspiring Urbanites</title> 
  <name>Urban singles with moderate income.</name> 
  <description>Low- to middle-income singles over a wide age range. Some have a college education. They work in a variety of occupations, including some management-level positions.</description> 
  </liveshere>
- <liveshere>
  <title>Bright Lights, Big City</title> 
  <name>Very mobile singles living in the city.</name> 
  <description>Singles ranging in age from early 20s to mid-40s who have moved to an urban setting. Most rent their apartment or condo. Some have a college education and work in services and the professional sector.</description> 
  </liveshere>
  </segmentation>
- <uniqueness>
- <category type="Education">
  <characteristic>Bachelor's degrees</characteristic> 
  </category>
- <category type="Employment">
  <characteristic>Females working for non-profits</characteristic> 
  <characteristic>Self-employed (unincorporated businesses)</characteristic> 
  <characteristic>Work in arts, design, entertainment, sports, or media occupations</characteristic> 
  <characteristic>Work in computer or mathematical occupations</characteristic> 
  <characteristic>Work in office and administrative support occupations</characteristic> 
  </category>
- <category type="People & Culture">
  <characteristic>Born in the Midwest</characteristic> 
  <characteristic>Born in the Northeast</characteristic> 
  <characteristic>Born in the South</characteristic> 
  <characteristic>Divorced females</characteristic> 
  <characteristic>Single females</characteristic> 
  <characteristic>Single males</characteristic> 
  <characteristic>Widowed females</characteristic> 
  </category>
- <category type="Transportation">
  <characteristic>Get to work by bicycle</characteristic> 
  <characteristic>Get to work by bus</characteristic> 
  </category>
  </uniqueness>
  </page>
  </pages>
  </response>
  </Demographics:demographics>
- <!--  H:14  T:116ms  S:19248  R:Tue Feb 10 11:10:04 PST 2009  B:3.0.62464-comp_rel_a 
  -->

Open in new window

Comment
Watch Question

You need to index the loops that are nested as well..
I think...



You get the idea... I didn't run this because I dont have the url...

Also.. Im not sure this is the best way... but it'll probably work.

<CFHTTP url="URL HERE" method="get">
<cfset xmlDoc = XMLParse(cfhttp.filecontent)>
<cfoutput>
  <cfloop from="1" to="#ArrayLen(xmlDoc.Demographics.response.pages.page)#" index="i">
    <strong>#xmlDoc.Demographics.response.pages.page[i].name.xmlText#</strong><br>
    <cfloop from="1" to="#ArrayLen(xmlDoc.Demographics.response.pages.page[i].tables.table)#" index="x">
      #xmlDoc.Demographics.response.pages.page[i].tables.table[x].name.xmlText#<br>
      <cfloop from="1" to="#ArrayLen(xmlDoc.Demographics.response.pages.page[i].tables.table[x].data.attribute)#" index="y">
        #xmlDoc.Demographics.response.pages.page[i].tables.table[x].data.attribute[y].name.xmlText#<br>
        <cfloop from="1" to="#ArrayLen(xmlDoc.Demographics.response.pages.page[i].tables.table[x].data.attribute[y].values)#" index="z">
         Neighborhood: #xmlDoc.Demographics.response.pages.page[i].tables.table[x].data.attribute[y].values[z].neighborhood.value.xmlText#<br>
         City: #xmlDoc.Demographics.response.pages.page[i].tables.table[x].data.attribute[y].values[z].city.value.xmlText#<br>
         Nation: #xmlDoc.Demographics.response.pages.page[i].tables.table[x].data.attribute[y].values[z].nation.value.xmlText#<br><br>
        </cfloop>
      </cfloop>
    </cfloop>
    <br>
    <br>
  </cfloop>
</cfoutput> 

Open in new window

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
So the inner most should have I X Y Z
outer most would only have I
etc...

Author

Commented:
Thanks, on that last loop, is there a way to check if those values exist.  If you look at the XML structure, you will see that it changes after about 10 loops.  The neighborhood, city and nation values stop.  Is there a way to do a CFIF statement to check for the existance of those values, becase now I am getting an error?

If you want, I will make a new question to get you points for this one as well.  Its just hard to refer back to other questions and repeat everything while it really has to do with this.  Your code above is correct and I will accept that answer, just wondering if you have information on this questions.

Thanks
i think you can do.
 stuckkeyexists("keyname",xmlstruct)

or even do isdefined("xml.node.node.node")

I can tell if you if give me a sec.. but you may want to open a new question to help keep the EE database clear and easy for someone else to find a answer to this question.

Author

Commented:
Ok, i am accepting your answer here and created a new question here:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Cold_Fusion_Markup_Language/Q_24131501.html

Thanks
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.