Hey, your response below contained the key to the answer ... thanks. This works:
if(structKeyExists(AmazonXML.ItemSearchResponse.Items.Item[i],"SmallImage")) H. -----Original Message----- From: Aaron Rouse [mailto:[EMAIL PROTECTED] Sent: Thursday, June 29, 2006 8:02 PM To: CF-Talk Subject: Re: If the structure exists, otherwise ... consistency needed Do what I did in my example code I sent you which was a check for smaller and then a check for the next one. On 6/29/06, Howard Owens <[EMAIL PROTECTED]> wrote: > > -----Original Message----- > From: Josh Nathanson [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 29, 2006 2:03 PM > To: CF-Talk > Subject: Re: If the structure exists, otherwise ... consistency needed > > I think you may want: > > if(structKeyExists(AmazonXML.ItemLookupResponse.Items.Item.ItemAttributes, > "Author")) > > { > Book.Author > =AmazonXML.ItemLookupResponse.Items.Item.ItemAttributes.Author.XmlText; > } > > How about giving that a try... > > -- Josh > > -------------------- > > Josh, > > That was a real promising response, because it worked on my single-item > test > query, but on the multiple item code that I really need to have work, it > doesn't. > > The following line throws the error that follows: > > if(structKeyExists(AmazonXML.ItemSearchResponse.Items.Item > [i].SmallImage,"UR > L")) > > "Element SMALLIMAGE is undefined in a Java object of type class > coldfusion.xml.XmlNodeMap " > > Which is why I had switched the reference to: > > > if(structKeyExists(AmazonXML.ItemSearchResponse.Items.Item[i]," > SmallImage.UR > L")) > > > which always returns false. > > H. > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:245108 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54