Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 12, 2012 12:42 AM by TimoYang
Member
21 Points
128 Posts
May 09, 2012 05:13 PM|LINK
Hi I have a XML RSS Feed file and is using the XSLT style. 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 - <?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>
rss.xslt - <?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> <tr> <td colspan="2" style="height:20px;"> <hr></hr> </td> </tr> </xsl:for-each> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>
Contributor
3732 Points
1275 Posts
May 11, 2012 02:47 AM|LINK
What problem have you got now??
May 11, 2012 11:41 AM|LINK
When I run this xml file it does not look like a RSS Feed. What am I doing wrong?
May 12, 2012 12:42 AM|LINK
There must be something wrong with your RSS feed's formation…… plz check that first……
deongee
Member
21 Points
128 Posts
XML using RSS, XSLT problem
May 09, 2012 05:13 PM|LINK
Hi I have a XML RSS Feed file and is using the XSLT style. 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 - <?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>rss.xslt - <?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> <tr> <td colspan="2" style="height:20px;"> <hr></hr> </td> </tr> </xsl:for-each> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>TimoYang
Contributor
3732 Points
1275 Posts
Re: XML using RSS, XSLT problem
May 11, 2012 02:47 AM|LINK
What problem have you got now??
deongee
Member
21 Points
128 Posts
Re: XML using RSS, XSLT problem
May 11, 2012 11:41 AM|LINK
When I run this xml file it does not look like a RSS Feed. What am I doing wrong?
TimoYang
Contributor
3732 Points
1275 Posts
Re: XML using RSS, XSLT problem
May 12, 2012 12:42 AM|LINK
There must be something wrong with your RSS feed's formation…… plz check that first……