I think IsDefined() doesn't support variable names with array indexes
in them, so isDefined("myarray[3]") throws the same error (I think). I
don't know why they made that decision. But if you know what i is and
you know that it's lte the length of the array of children in that xml
packet, I would think you would want to set a local variable anyway:
<cfset currentOffer =
parseData.ItemLookupResponse.Items.Item.Offers.Offer[i]>
<cfif isDefined("currentOffer.Seller.SellerId.XmlText")>do
stuff</cfif>
> Just out of interest, why is...
> #parsedData.ItemLookupResponse.Items.Item.Offers.Offer[i].
> Seller.SellerId.Xm
> lText#
> Perfectly valid, but
> isDefined("parsedData.ItemLookupResponse.Items.Item.Offers
> .Offer[i].Seller.S
> ellerId.XmlText")
> Throws the error "must be a syntactically valid variable
> name".
> IT IS!!! YOU JUST OUTPUT IT!!!
> Why must the square brackets be changed to hash marks and
> vice-versa
> depending on where you use it!
> --
> James Smith
> IT Director - Music Express
s. isaac dealey 434.293.6201
new epoch : isn't it time for a change?
add features without fixtures with
the onTap open source framework
http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:5:203659
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/5
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:5
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.5
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54