> I've been noticing that if there's an error in the feed--which seems to
> happen as CF finds extra or special characters that it doesn't
> like--then the entire page breaks, and I'd rather not have that happen.

XML documents should be well-formed for them to be parsed.
You might want to correct the "feed", if possible. Some of the characters
that lead to an invalid xml document are...
Invalid : Replace
< : &lt;
> : &gt;
& : &amp;
" : &quot;
' : &apos;

Example  <Author>Dietel & Dietal</Author>
Here "&" should be replaced with "&amp;" for a valid xml doc.

I thought isXmlDoc() would check for xml doc validity,
am curious..what this function really does.

Anyways you can try somthing like.

<cffile action="read" file="E:\CFusionMX\wwwroot\books.xml"
variable="books">
<cfoutput>
<cftry>
<cfset oDoc=xmlParse(books)>
 valid xml doc!.<br>
 #odoc.Books.Book[1].Title.XmlText#<br>
 <cfcatch type="any">
 xml document not valid!.<br>
 </cfcatch>
</cftry>
</cfoutput>

Hope this helps.

Joe Eugene



> -----Original Message-----
> From: Russ [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 09, 2003 7:16 AM
> To: CF-Talk
> Subject: XML Error Trapping in CFMX
>
>
> I've been working on bringing down feeds in XML/RSS in ColdFusion MX,
> and it works really well.
>
> Mostly.
>
> I've been noticing that if there's an error in the feed--which seems to
> happen as CF finds extra or special characters that it doesn't
> like--then the entire page breaks, and I'd rather not have that happen.
>
> In fact, since users are choosing from a number of feeds, I'd prefer to
> capture the error and then simply void that request and move to the next
> one without breaking a page.
>
> Is this a feasible/reasonable request, and if so, what direection should
> I be looking in?  I'm working on a CFTRY, but I'm still struggling.
>
> Thanks in advance for any advice.
>
> Russ
> blueChrome design, LLC
> www.bluechromedesign.com
>
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to