Thanks - works great.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Bruce Dunwiddie
Sent: Tuesday, August 26, 2003 2:54 PM
To: [EMAIL PROTECTED]
Subject: RE: [KCFusion] XML error handling


This should work for you or atleast give you the general idea of how to
handle the error.

<cfhttp url="http://someurl.com"; method="Get" resolveurl="YES"></cfhttp>
<cftry>
        <cfset resultcontent = XmlParse(cfhttp.fileContent)>
        <cfcatch type="Any">
                <!--- Do something else--->
                <cfset resultcontent = "The XML is HOSED!!!">
        </cfcatch>
</cftry>

Bruce Dunwiddie
Ticket Technology
P: 866.543.3331
F: 913.451.7832
[EMAIL PROTECTED]


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Scott McWilliams
Sent: Tuesday, August 26, 2003 12:54 PM
To: [EMAIL PROTECTED]
Subject: [KCFusion] XML error handling


I'm pretty new to error handling, so any help is very much appreciated.

Is it possible to check a file before XmlParse to ensure it is a properly
formatted XML file?  The issue I'm having is that I pull in XML formatted
data from a remote application using the following code:

<cfhttp url="http://someurl.com"; method="Get" resolveurl="YES"></cfhttp>
<cfset resultcontent = XmlParse(cfhttp.fileContent)>

This works fine when cfhttp.filecontent is properly formatted XML text.
Unfortunately, the remote application that I'm pulling from will spit out
improperly formatted XML text about 2% of the time.  The remote application
will fault unpredictably in the middle of the data leaving unclosed nodes.
This causes an error with XmlParse.  Fixing the remote application is not an
option.

I've tried using IsXmlDoc(cfhttp.FileContent), but since the document is
merely formatted text prior to XmlParse, this always returns False.

Is there a way to check the file before XmlParse or to catch the error so
that my application can continue?

Thanks in advance.



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Bradley Miller
Sent: Monday, August 25, 2003 2:21 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [KCFusion] CSV Driver in MX ?


Ah -- another wrinkle in the swap to a new server . . . . where's my CSV
drivers in ColdFusion MX?



______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]




______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]





______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]


 
 
______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/[EMAIL PROTECTED]
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]
 

Reply via email to