Please help!  I am attempting to consume an XML Webservice and having a
slight problem. All works well with the code below except, several of the
items in the loop are null.... therefore I get an "Element FIRSTNAME.XMLTEXT
is undefined" ERROR.

HOW do I write code that says:
"If there is no data, skip to the next field and so on...."
In this case there is a CompanyName, no FirstName, no LastName, but there is
a Phone.

Thanks in advance for your assistance.

Sifu

<CFSET PEOPLE = xmlobj.irxml>
<cfset FAQObjs = xmlObj.IRXML.PEOPLE />
<CFSET FAQList = xmlobj.irxml.PEOPLE.ANALYST />
<CFSET ANALYSTCount = ArrayLen(FAQObjs.xmlChildren)>
<CFSET ANALYSTList = ArrayLen(FAQList.xmlChildren)>

<cfloop from="1" to="#ArrayLen(FAQList)#" index="i">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="25"></td>
          <td width="250">#FAQList[i].Company.CompanyName.xmltext#</td>
          <td width="200">#FAQList[i].FirstName.xmltext#
#FAQList[i].LastName.xmltext#</td>
          <td>#FAQList[i].Location.Phone.xmltext#</td>
          <td width="25"> </td>
        </tr>
      </table>
  </cfloop>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to