12 Replies Latest reply on Nov 4, 2010 5:33 AM by Dave Watts

    Retrieve XML

    lovewebdev Level 1

      I have XML that looks like this


      <?xml version="1.0" encoding="utf-8"?>
      <videos total="39" >
        <video id="565455" title="With Love" />


      I'm trying to dispay the xml using coldfusion. I've done this before but the problem i have this time is trying to access the id and title values in the video.


      Can someone give me a simple example of retrieving this?


      I have:

      <cfset mydoc = XmlParse(CFHTTP.FileContent)>
      <cfset pb = mydoc.rsp.XmlChildren>
      <cfset size = ArrayLen(pb)>


      <cfset myquery = QueryNew("id, title")>
      <cfset temp = QueryAddRow(myquery, #size#)>


      <cfloop index="i" from = "1" to = #size#>





      Sorry if my cf is so bad!!