how to check if attribute exists in a xml node in coldfusion
<cfif structKeyExists( node[1].xmlAttributes, "name" )>
<cfset statefileName = node[1].xmlAttributes.name/>
<cfelse>
<cfset statefileName = ""/>
<cfset statefileName = ""/>
</cfif>
here Name is attribute thats i am trying to know if it is defined or not.
isdefined fuction will not work here in finding node or attribute.
structKeyExists will help in finding if an attribute is present in a node or not.
thank you for posting this, Prashant!
ReplyDeleteu r welcome
ReplyDelete