Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:output method="html" />
<xsl:template match="rss/channel">
<!--Gets the top 5 records-->
<xsl:for-each select="item[position()<=5]">
<xsl:choose>
<!--Check if the title has the keyword ADV or Video in it-->
<xsl:when test="contains(title,'ADV') or contains(title,'Video')">
<div>I Removed This Item!</div>
</xsl:when>
<!--If not, show a formatted item-->
<xsl:otherwise>
<div style="border-bottom: dotted 1px Gray;padding-top: 5px; padding-bottom: 3px;">
<div>
<a href="{link}" target="_blank">
<xsl:value-of select="title" />
</a>
</div>
<div style="margin-left: 4px;" class="rssDescription">
<xsl:value-of disable-output-escaping="yes" select="description" />
</div>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
private void GetFeed(string strURL, string xsltFilePath, Literal outputLocation)
{
try
{
string xsltFile = Server.MapPath(xsltFilePath);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(strURL);
XslTransform xslDoc = new XslTransform();
xslDoc.Load(xsltFile);
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
xslDoc.Transform(xmlDoc, null, sw);
outputLocation.Text = sb.ToString();
}
catch (Exception ex)
{
throw new Exception(ex.Message);
}
}
protected void Page_Load()
{
if (!IsPostBack)
{
GetFeed("[URL unfurl="true"]http://rss.weather.com/weather/rss/local/21727?cm_ven=LWO&cm_cat=rss&par=LWO_rss",[/URL]
"xml/weather.xslt", rssWeather);
}
}