Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 19th, 2008, 05:41 PM
Points: 1,561, Level: 16
Points: 1,561, Level: 16 Points: 1,561, Level: 16 Points: 1,561, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jul 2005
Location: , , .
Posts: 317
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP.NET XML Feed Error

I have an ASP.NET page that parses an external XML feed (please see code below). It works...but when the feed goes down, it subsequently brings my site down. So I've created a default XML document that's located on my internal server a backup method when/if the external feed goes down. But I have no idea how to do this. If someone could let me know how to accomplish this, or point me in the right direction, that would be great. Thanks in advance.

'Check for active amber alert
Dim strAlertTitle As String, strAlertDescription As String
Dim intAlertCounter As Integer = 0
Dim alert_xmld As XmlDocument
Dim alert_nodelist As XmlNodeList
Dim alert_node As XmlNode
'Create the XML Document
alert_xmld = New XmlDocument()

'Load the Xml file
alert_xmld.Load("http://codeamber.org/a1xl04act/amberalert.xml") 'LIVE
        'alert_xmld.Load("http://www.mysite.com/docs/xml/alert.xml") 'DEFAULT XML DOC TO USE AT DOWNTIME

'Get the list of name nodes
alert_nodelist = alert_xmld.SelectNodes("/AmberAlerts/AmberAlert[Alertstatus/@status = 'open' and contains(Alertinfo/@states, 'CO')]")

'Loop active amber alerts
For Each alert_node In alert_nodelist
    intAACounter = intAACounter + 1
    If intAACounter >= 1 Then
        strAlertTitle = "Amber Alert"
        strAlertDescription = "There is currently an amber alert in Colorado."
    Else If intAACounter = 0 Then
        strAlertTitle = "Amber Alert"
        strAlertDescription = "There are currently no amber alerts in Colorado."
    End If
Next 'end loop

Response.Write(strAlertTitle & ": " & strAlertDescription & "<br /><br />")

Similar Threads
Thread Thread Starter Forum Replies Last Post
Implementing RSS FEED in Asp.Net suresh_net RSS and Atom 0 August 8th, 2008 10:15 AM
Problems parsing XML Feed in Javascript kwilliams Classic ASP Professional 0 December 18th, 2007 06:33 PM
parse error xml load document asp.net academics2006 ASP.NET 1.0 and 1.1 Basics 0 March 13th, 2006 03:21 PM
xml feed with javascript jon8884 Javascript 5 June 22nd, 2005 01:15 PM
XML news feed sankar XML 1 December 17th, 2003 05:28 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.