> -----Original Message-----
> From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 04, 2005 3:21 PM
> To: CF-Talk
> Subject: Re: XML Is or NOT?
>
> <cfif IsDefined(XMLResponse.RateV2Response.Package.Error)>
>
> Same error
>
> Element RATEV2RESPONSE.PACKAGE.ERROR is undefined in XMLRESPONSE
You NEED the quotes, but you DON'T need the pound signs.
IsDefined() takes one parameter - the NAME of a variable (a string). It
returns "true" if a variable by that name exists, "false" if not.
So the input has to be a string.
These two lines do EXACTLY the same thing:
<cfif IsDefined(XMLResponse.RateV2Response.Package.Error)>
<cfif IsDefined("#XMLResponse.RateV2Response.Package.Error#")>
Quotes indicate a string and pound signs distinguish a variable value within
a string. So both of these end up trying to get the _value_ of
XMLResponse.RateV2Response.Package.Error and see if there's a variable by
that name.
This one however:
<cfif IsDefined("XMLResponse.RateV2Response.Package.Error")>
Will look for that variable name and return whether or not it exists.
It's worth it to check out livedocs.macromedia.com, there's an extensive
chapter on parsing XML in CF and full documentation for all functions.
Jim Davis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223282
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