Deon Gee

Deon Gee

  • NA
  • 4
  • 8.8k

XML, XSLT and RSS Problem

May 9 2012 3:56 PM

<p>Hi I have a XML RSS Feed file and is using the XSLT style.&nbsp; I want to pull data from a table for the Feed and when I run the XML file it has no information just the RSS Feed style. What am I doing wrong?<br><br>Here is my codes:<br><br></p>
myData.xml<p><?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="rss.xslt"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <Title>Gee Web Solutions</Title>
    <link>http://www.sigar.mil/rss/</link>
    <description>Watch articles from C# Corner</description>
    <copyright>© 1999 - 2011  Mindcracker LLC. All Rights Reserved</copyright>
    <item>

      <FeedSpeeches ID="1">
        <Title>Deon</Title>
        <Author>Gee</Author>
    
          <Description>Washington</Description>
          <Link>http://www.sigar.mil/rss/</Link>
     
      </FeedSpeeches>


    </item>

  </channel>
</rss></p><br>rss.xslt<p><?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
    <html>
      <head>
        <title>Gee Web Solutions</title>
      </head>
      <body>
        <table cellpadding="2" cellspacing="0" border="0" width="75%">
          <xsl:for-each select="FeedSpeeches">
          <xsl:for-each select="rss/channel/item">
            <tr style="color:#0080FF;">
              <td style="text-align:left;font-weight:bold;">
                <xsl:value-of select ="Title"></xsl:value-of>
              </td>
              <td style="text-align:right;font-weight:bold;">
                <i>
                  <xsl:value-of select ="Author"></xsl:value-of>
                </i>, <xsl:value-of select="pubDate"/>
              </td>
            </tr>
            <tr>
              <td colspan="2" style="text-align:left;padding-top:10px;">
                <xsl:value-of select="Description"/>
              </td>
            </tr>
            <tr>
              <td colspan="2" style="text-align:right;">
                <a href="{link}" rel="bookmark">
                  More...
                </a>
              </td>
            </tr>