Atom Feeds

Wikipedia : Atom (web standard)

W3C : Introduction to Atom

XSL file – “case-study-feeds/atom.xsl”
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom" version="1.0" exclude-result-prefixes="atom">

    <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:include href="../../plugins/tenandtwo-xslt-processor/xsl/date.xsl"/>

    <!-- main -->
    <xsl:template match="/">
        <xsl:apply-templates select="atom:feed"/>
    </xsl:template>

    <!-- feed -->
    <xsl:template match="atom:feed">
        <!-- header -->
        <h3><xsl:value-of select="atom:title"/></h3>
        <h5><xsl:value-of select="atom:subtitle"/></h5>

        <!-- body -->
        <xsl:apply-templates select="atom:entry"/>

        <!-- footer -->
        <hr size="1"/>
        <div>
            <xsl:text>Updated : </xsl:text>
            <time>
                <xsl:attribute name="datetime"><xsl:value-of select="atom:updated"/></xsl:attribute>
                <xsl:call-template name="date-format">
                    <xsl:with-param name="value" select="atom:updated"/>
                    <xsl:with-param name="format" select="'Y-m-d h:i A'"/>
                </xsl:call-template>
            </time>

            <xsl:for-each select="atom:author/*">  <!-- name, email, uri -->
                <br/>
                <xsl:text>Author : </xsl:text>
                <xsl:value-of select="text()"/>
            </xsl:for-each>

            <xsl:if test="string-length(atom:link[@rel='alternate']/@href) &gt; 0">
                <br/>
                <a target="_blank">
                    <xsl:attribute name="href"><xsl:value-of select="atom:link[@rel='alternate']/@href"/></xsl:attribute>
                    <xsl:text>Visit Website →</xsl:text>
                </a>
            </xsl:if>
        </div>
    </xsl:template>

    <!-- entry -->
    <xsl:template match="atom:entry">
        <hr size="1"/>
        <h5>
            <time>
                <xsl:attribute name="datetime"><xsl:value-of select="atom:updated"/></xsl:attribute>
                <xsl:call-template name="date-format">
                    <xsl:with-param name="value" select="atom:updated"/>
                    <xsl:with-param name="format" select="'Y-m-d h:i A'"/>
                </xsl:call-template>
            </time>
        </h5>
        <h4>
            <a target="_blank">
                <xsl:attribute name="href">
                    <xsl:choose>
                        <xsl:when test="string-length(atom:link[@rel='alternate']/@href) &gt; 0">
                            <xsl:value-of select="atom:link[@rel='alternate']/@href"/>
                        </xsl:when>
                        <xsl:when test="string-length(atom:link/@href) &gt; 0">
                            <xsl:value-of select="atom:link/@href"/>
                        </xsl:when>
                        <xsl:otherwise><xsl:value-of select="atom:id"/></xsl:otherwise>
                    </xsl:choose>
                </xsl:attribute>
                <xsl:value-of disable-output-escaping="yes" select="atom:title"/>
            </a>
        </h4>
        <div>
            <xsl:choose>
                <xsl:when test="string-length(.//atom:content) &gt; 0">
                    <xsl:value-of disable-output-escaping="yes" select=".//atom:content"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of disable-output-escaping="yes" select=".//atom:summary"/>
                </xsl:otherwise>
            </xsl:choose>
        </div>
    </xsl:template>

</xsl:stylesheet><!-- end atom.xsl -->

National Weather Service Alerts for OR

[xslt_transform_xml xsl="case-study-feeds/atom.xsl" xml="https://alerts.weather.gov/cap/or.php?x=0" /]
Output

Current watches, warnings, and advisories for Oregon


Freeze Warning issued October 17 at 8:00PM PDT until October 18 at 9:00AM PDT by NWS Pendleton OR

* WHAT…Sub-freezing temperatures as low as 28 expected. * WHERE…North Central Oregon. * WHEN…From 11 PM this evening to 9 AM PDT Friday. * IMPACTS…Frost and freeze conditions could kill crops, other sensitive vegetation and possibly damage unprotected outdoor plumbing.

Freeze Warning issued October 17 at 8:00PM PDT until October 18 at 9:00AM PDT by NWS Pendleton OR

* WHAT…Sub-freezing temperatures as low as 28 expected. * WHERE…Foothills of the Blue Mountains of Oregon and Washington, John Day Basin, Kittitas Valley, Yakima Valley, and Simcoe Highlands. * WHEN…From 11 PM this evening to 9 AM PDT Friday. * IMPACTS…Frost and freeze conditions could kill crops, other sensitive vegetation and possibly damage unprotected outdoor plumbing.

Frost Advisory issued October 17 at 5:35PM MDT until October 18 at 9:00AM MDT by NWS Boise ID

* WHAT…For the Frost Advisory, low temperatures between 32 and 36 will result in frost formation. For the Freeze Watch, sub-freezing temperatures as low as 30 possible. * WHERE…Lower Treasure Valley Zones. * WHEN…For the Frost Advisory, from 3 AM to 9 AM MDT Friday. For the Freeze Watch, from late Friday night through Saturday morning. * IMPACTS…Frost and freeze conditions could kill crops, other sensitive vegetation and possibly damage unprotected outdoor plumbing.

Freeze Watch issued October 17 at 5:35PM MDT until October 19 at 9:00AM MDT by NWS Boise ID

* WHAT…For the Frost Advisory, low temperatures between 32 and 36 will result in frost formation. For the Freeze Watch, sub-freezing temperatures as low as 30 possible. * WHERE…Lower Treasure Valley Zones. * WHEN…For the Frost Advisory, from 3 AM to 9 AM MDT Friday. For the Freeze Watch, from late Friday night through Saturday morning. * IMPACTS…Frost and freeze conditions could kill crops, other sensitive vegetation and possibly damage unprotected outdoor plumbing.

Freeze Warning issued October 17 at 10:41AM PDT until October 18 at 9:00AM PDT by NWS Medford OR

* WHAT…Sub-freezing temperatures as low as 30 degrees in Oregon valleys and as low as 25 degrees in California valleys. * WHERE…In California, the Shasta and Scott valleys, the lower Klamath River valley, and the Mount Shasta region. In Oregon, the Rogue, Applegate, and Illinois valleys. * WHEN…From midnight tonight to 9 AM PDT Friday. * IMPACTS…Frost and freeze conditions could kill crops, other sensitive vegetation and possibly damage unprotected outdoor plumbing.

Freeze Warning issued October 17 at 7:55AM PDT until October 18 at 9:00AM PDT by NWS Portland OR

* WHAT…Sub-freezing temperatures in the upper 20s to lower 30s, coldest in the Parkdale area. * WHERE…Upper Hood River Valley. * WHEN…From midnight tonight to 9 AM PDT Friday. * IMPACTS…Frost and freeze conditions could kill crops, other sensitive vegetation and possibly damage unprotected outdoor plumbing.

Frost Advisory issued October 17 at 7:55AM PDT until October 18 at 9:00AM PDT by NWS Portland OR

* WHAT…Temperatures as low as 35 will result in frost formation. * WHERE…South Willamette Valley, Cascade Foothills of Marion and Linn Counties, and Lane County Cascade Foothills. * WHEN…From midnight tonight to 9 AM PDT Friday. * IMPACTS…Frost could harm sensitive outdoor vegetation. Sensitive outdoor plants may be killed if left uncovered.

Updated :
Author : w-nws.webmaster@noaa.gov