SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Aug 2004
    Location
    Swindon
    Posts
    304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    getting stuff from xml

    Hi all

    Im trying to do some stuff with amazon and im stuck with how to achieve something

    Im grabbing details from the returned xml and all is good.

    Im doing it like this.....

    Code:
    <!--- get the Features--->
    <cfif structkeyexists(amzResult.ItemlookupResponse.Items.Item.ItemAttributes,"Feature")>
    	<cfset Feature = amzResult.ItemlookupResponse.Items.Item.ItemAttributes.Feature.xmltext>
    <cfelse>
    	<cfset Feature="">	
    </cfif>
    this is great, but somethimes there are more that one item above ie 3 or 4 features, is there a way i can loop and grab all the ones called (in this eg) feature?

    Im not sure how to check if there is more than 1

    If that makes any sense

  2. #2
    SitePoint Enthusiast Paul_K's Avatar
    Join Date
    Jul 2008
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd take a look at XMLSearch

    http://www.cfquickdocs.com/cf8/?getD...arch#XmlSearch

    And use xpath to find all the elements your after.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •