I am working with an XML object with many optional elements.
I am trying to use StructKeyExists to see if optional elements are
indeed populated, but I can't figure out how to code the statement.
Right now, I have given up and used the <cftry> option as
shown below and it is working fine, but I understand that the
StructKeyExists is more efficient.
This is working...
<cftry>
<cfset varCompanyName =
xmlQuoteIn.Quotes.Quote.Policies.Policy.Company.Name.XmlText>
<cfcatch type="any"><cfset
varCompanyName=""></cfcatch>
</cftry>
My attempt at using StructKeyExists looks like this (but it
doesn't work)...
<cfif
StructKeyExists(xmlQuoteIn.Quotes.Quote.Policies.Policy,"Company.Name")>
Is there a way to make the above "StructKeyExists" statement
work?
Thank you,
David Josephs