View Single Post
  #11 (permalink)  
Old July 28th, 2005, 02:42 PM
kwilliams kwilliams is offline
Banned
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

Ok, well this is what I've got.

XML doc:
<ealerts>
    <alert>
        <title>eAlert - Title #1</title>
        <rss_url>#</rss_url>
        <link>#</link>
        <image_url>http://SERVER/DIRECTORY/images/gif/ealert_title1.gif</image_url>
        <width>49</width>
        <height>48</height>
        <status>active</status>
    </alert>
    <alert>
        <title>eAlert - Title #2</title>
        <rss_url>#</rss_url>
        <link>#</link>
        <image_url>http://SERVER/DIRECTORY/images/gif/ealert_title2.gif</image_url>
        <width>49</width>
        <height>48</height>
        <status>active</status>
    </alert>

</ealerts>
XMLDocument method:
Code:
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" Debug="true" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Xml" %>
<script runat="server">
'Pull in eAlerts data
Sub Main()
    Dim m_xmld As XmlDocument
    Dim m_nodelist As XmlNodeList
    Dim m_node As XmlNode
    'Create the XML Document
    m_xmld = New XmlDocument()
    'Load the Xml file
    m_xmld.Load("http://SERVER/DIRECTORY/docs/xml/ealerts.xml")
    'Get the list of name nodes
    m_nodelist = m_xmld.SelectNodes("/ealerts/alert")
    'Loop through the nodes
    For Each m_node In m_nodelist
      Dim titleValue = m_node.ChildNodes.Item(0).InnerText
      Dim rss_urlValue = m_node.ChildNodes.Item(1).InnerText
      Dim linkValue = m_node.ChildNodes.Item(2).InnerText
      Dim image_urlValue = m_node.ChildNodes.Item(3).InnerText
      Dim widthValue = m_node.ChildNodes.Item(4).InnerText
      Dim heightValue = m_node.ChildNodes.Item(5).InnerText
      Dim statusValue = m_node.ChildNodes.Item(6).InnerText
      'Get the Gender Attribute Value
      'Dim genderAttribute = m_node.Attributes.GetNamedItem("gender").Value

      'Write Result to the Console
      Response.Write("<strong>eAlert</strong><br />Title: " & titleValue & _
      " RSS URL: " & rss_urlValue & _
      " Link: " & linkValue & _
      " Image URL: " & image_urlValue & _
      " Width: " & widthValue & _
      " Height: " & heightValue & _
      " Status: " & statusValue)

    Next
End Sub
</script>
The good news is that no errors are returned, but the bad news is neither are any results...just a blank page. I'm not sure why that is, because the properties & syntax appear to be correct. If you see anything that I'm obviously missing, please let me know. I'll just keep on testing it out in the meantime.

KWilliams
Reply With Quote