Test for value of childnote

Author Message
TOPHOLM

  • Total Posts : 26
  • Scores: 0
  • Reward points : 0
  • Joined: 5/15/2006
  • Location: Copenhagen
  • Status: offline
Test for value of childnote Sunday, July 29, 2007 10:34 PM (permalink)
0
Hi everybody

I would like to create a "status field" on our intranet to display the status of the IT systems in our org.

I wolud like to display the status from an RSS feed we use for general news from the IT department.

The feed could look something like this:
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml-stylesheet type="text/xsl" href=[link=http://somewhere.com/somestylesheet.xsl]http://somewhere.com/somestylesheet.xsl[/link] version="1.0"?>
 <rss version="2.0">
 <channel>
      <title>Test RSS feed</title>
      <description>Feed to test &quot;traffic light&quot;</description>
      <link>http://www.testfeed.xml</link>
      <language> da</language>
      <lastBuildDate>Mon, 30 Jul 2007 12:23:51 +0200</lastBuildDate>
      <pubDate>Mon, 30 Jul 2007 12:23:47 +0200</pubDate>
      <generator>FeedForAll v2.0 (2.0.2.8)</generator>
      <item>
          <title>Entry three</title>
          <description>The third entry</description>
          <category domain="">Critical</category>
           <pubDate>Mon, 30 Jul 2007 12:21:38 +0200</pubDate>
      </item>
      <item>
          <title>Entry two</title>
          <description>The second entry</description>
          <pubDate>Mon, 30 Jul 2007 12:21:16 +0200</pubDate>
      </item>
      <item>
          <title>Entry one</title>
          <description>The first entry</description>
          <pubDate>Mon, 30 Jul 2007 12:19:09 +0200</pubDate>
      </item>
 </channel>
 </rss>
 


I would like to have a "traffic light" on the Intranet that changes to red if a category node with "Critical" is present, yellow if the category node contains "Problem", and green if no category node is present. (three different .gif's)
I know I have to check the node and then act on behalf of the result and display the traffic light with the right color, but what is the easiest way to do this ?
Unfortunatlly I cant figur out how to achive this. Hopefully someone here are able to help.
<message edited by TOPHOLM on Sunday, July 29, 2007 10:42 PM>
Best regards

Søren Tøpholm
 
#1
    ebgreen

    • Total Posts : 8227
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: offline
    RE: Test for value of childnote Monday, July 30, 2007 1:05 AM (permalink)
    0
    What have you tried so far? Basicly you would want to do an XPath query to see if there are any nodes that meet your criteria.
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2
      TOPHOLM

      • Total Posts : 26
      • Scores: 0
      • Reward points : 0
      • Joined: 5/15/2006
      • Location: Copenhagen
      • Status: offline
      RE: Test for value of childnote Monday, July 30, 2007 6:10 AM (permalink)
      0
      I'm all new to XML/XSL(T), but I have played around a little.
       
      The XML file is genereted using a RSS feed editor and I have added a style sheet (XSL)
      I use this xsl to display the feed on the Intranet.
       
      Now I want to use the same feed to change an icon in an iframe.
      How do I get the If... Then logic on the result I get from the query ? 
      Can I do an XPath query from HTML, or can I somehow use several style sheets on the same XML source ?
       
      - Søren
       
      #3

        Online Bookmarks Sharing: Share/Bookmark

        Jump to:

        Current active users

        There are 0 members and 1 guests.

        Icon Legend and Permission

        • New Messages
        • No New Messages
        • Hot Topic w/ New Messages
        • Hot Topic w/o New Messages
        • Locked w/ New Messages
        • Locked w/o New Messages
        • Read Message
        • Post New Thread
        • Reply to message
        • Post New Poll
        • Submit Vote
        • Post reward post
        • Delete my own posts
        • Delete my own threads
        • Rate post

        2000-2012 ASPPlayground.NET Forum Version 3.9