topical media & game development

talk show tell print

mashup-amazon-11-11-02-RestaurantBrowser-AmazonRestaurants.xsl / xsl



  <?xml version="1.0" encoding="utf-8"?>
  
  <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:ymaps="http://api.maps.yahoo.com/Maps/V1/AnnotatedMaps.xsd"
      xmlns:a="http://webservices.amazon.com/AWSECommerceService/2005-10-05"
      xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
    <xsl:output method="xml"/>
    <xsl:template match="/">
      <rss version="2.0">
        <channel>
          <title>Amazon GeoRSS</title>
          <link>http://www.Amazon.com>
          <description>Sample GeoRSS file listing restaurants from Amazon</description>
          <image>
            <url>images/food.gif</url>
          </image>
          <ymaps:Groups>
            <Group>
              <Title>Steak Restaurants</Title>
              <Id>Steak House</Id>
              <BaseIcon width="40px" height="40px"><![CDATA[images/steak.gif]]></BaseIcon>
            </Group>
            <Group>
              <Title>French Restaurants</Title>
              <Id>French</Id>
              <BaseIcon width="40px" height="40px"><![CDATA[images/french.gif]]></BaseIcon>
            </Group>
            <Group>
              <Title>Seafood Restaurants</Title>
              <Id>Seafood</Id>
              <BaseIcon width="40px" height="40px"><![CDATA[images/seafood.gif]]></BaseIcon>
            </Group>
            <Group>
              <Title>Pizza</Title>
              <Id>Pizza</Id>
              <BaseIcon width="40px" height="40px"><![CDATA[images/pizza.gif]]></BaseIcon>
            </Group>
          </ymaps:Groups>
  
          <xsl:apply-templates select="a:ItemSearchResponse/a:Items/a:Item" />
        </channel>
      </rss>
    </xsl:template>
  
    <xsl:template match="a:Item">
      <item>
        <title>
          <xsl:value-of select="a:ItemAttributes/a:Title"/>
        </title>
        <link>
          <xsl:value-of disable-output-escaping="yes" select="concat('&lt;','![CDATA[')" />
          <xsl:value-of select="a:DetailPageURL" />
          <xsl:value-of disable-output-escaping="yes" select="concat(']]', '&gt;')"/>
        </link>
        <description>
          [<xsl:value-of select="a:ItemAttributes/a:Cuisine"/>]
          <xsl:value-of select="a:CustomerReviews/a:Review/a:Content"/>
  
        </description>
        <ymaps:Address>
          <xsl:value-of select="a:ItemAttributes/a:Address/a:Address1" />
        </ymaps:Address>
        <ymaps:CityState>
          <xsl:value-of select="a:ItemAttributes/a:Address/a:City" />, <xsl:value-of select="a:ItemAttributes/a:Address/a:State" />
        </ymaps:CityState>
        <ymaps:Zip>
          <xsl:value-of select="a:ItemAttributes/a:Address/a:PostalCode" />
        </ymaps:Zip>
        <ymaps:Country>US</ymaps:Country>
        <ymaps:GroupId><xsl:value-of select="a:ItemAttributes/a:Cuisine"/></ymaps:GroupId>      
  <ymaps:ItemUrl>http://mashups.FrancisShanahan.com/getdata.aspx?operation=ItemLookup&ResponseGroup=Large&ItemId= select="a:ASIN"/>&amp;xsl=amazonItemIframe.xsl&amp;contentType=text/html</ymaps:ItemUrl>
      </item> 
    </xsl:template>
  </xsl:stylesheet>


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.