topical media & game development
[]
readme
course(s)
preface
I
1
2
II
3
4
III
5
6
7
IV
8
9
10
V
11
12
afterthought(s)
appendix
reference(s)
example(s)
resource(s)
_
mashup-amazon-13-13-05-GoogleAmazon-AmazonGoogle.xsl
/
xsl
<?xml
version="1.0" encoding="UTF-8"?>
<xsl
:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform
" xmlns:a="
http://webservices.amazon.com/AWSECommerceService/2005-10-05
" xmlns:y="urn:yahoo:prods" xmlns:e="urn:ebay:apis:eBLBaseComponents" xmlns:g="urn:google:search"> <!-- Define a parameter -->
<xsl
:param name="resultPage">
</xsl
:param>
<xsl
:output method="xml" encoding="ISO-8859-1" omit-xml-declaration="yes"/>
<xsl
:template match="/">
<rss
version="2.0" xmlns:openSearch="
http://a9.com/-/spec/opensearch/1.1/
" >
<channel>
<title>
AMZN + GOOGLE Search Results
</title>
<link>
http://Mashups.FrancisShanahan.com>
<description>
Syndicated Amazon and Google Results
</description>
<language>
en-us
</language>
<generator>
Francis Shanahan[.com]
</generator>
<managing
Editor>dotnet@francisshanahan.com
</managing
Editor>
<xsl
:apply-templates select="MyMashup/a:ItemSearchResponse/a:Items/a:Item"/>
<xsl
:apply-templates select="MyMashup/e:GetSearchResultsResponse/e:SearchResultItemArray"/>
<xsl
:apply-templates select="MyMashup/g:MyGoogle/g:item"/>
<open
Search:startIndex>
<xsl
:value-of select="
resultPage"/>
</open
Search:startIndex>
<open
Search:itemsPerPage>20
</open
Search:itemsPerPage>
<open
Search:totalResults>
<xsl
:value-of select="MyMashup/a:ItemSearchResponse/a:Items/a:TotalResults"/>
</open
Search:totalResults>
</channel>
</rss>
</xsl
:template>
<xsl
:template match="a:Item">
<item>
<title>
Amazon:
<xsl
:value-of select="a:ItemAttributes/a:Title" />
</title>
<description>
<img src="
<xsl
:value-of select="a:SmallImage/a:URL" />" alt="
<xsl
:value-of select="a:ItemAttributes/a:Title" />" title="
<xsl
:value-of select="a:ItemAttributes/a:Title" />" align="left" />
<xsl
:apply-templates select="a:OfferSummary"/>
<xsl
:apply-templates select="a:ItemAttributes"/>
<xsl
:apply-templates select="a:EditorialReviews/a:EditorialReview"/>
</description>
<link>
<xsl
:value-of select="a:DetailPageURL" />
</link>
</item>
</xsl
:template> <!-- Google Stuff -->
<xsl
:template match="g:item">
<item>
<title>
Google:
<xsl
:value-of select="g:title" />
</title>
<description>
<xsl
:value-of select="g:description" />
</description>
<link>
<xsl
:value-of select="g:link" />
</link>
</item>
</xsl
:template> <!-- Amazon stuff follows -->
<xsl
:template match="a:OfferSummary"> <b>Lowest Price:</b>
<xsl
:value-of select="a:LowestNewPrice/a:FormattedPrice" /> | <b>Total New:</b>
<xsl
:value-of select="a:TotalNew" /> | <b>Total Used:</b>
<xsl
:value-of select="a:TotalUsed" /> | <b>Total Used:</b>
<xsl
:value-of select="a:TotalUsed" /> | <b>Total Collectible:</b>
<xsl
:value-of select="a:TotalCollectible" /> | <b>Total Refurbished:</b>
<xsl
:value-of select="a:TotalRefurbished" /><br/>
</xsl
:template>
<xsl
:template match="a:ItemAttributes"> <b>List Price:</b>
<xsl
:value-of select="a:ListPrice/a:FormattedPrice" /> |
<xsl
:apply-templates select="a:Feature"/>
<xsl
:apply-templates select="a:Director"/>
<xsl
:apply-templates select="a:Actor"/>
</xsl
:template>
<xsl
:template match="a:Feature"> <li>
<xsl
:value-of select="." /></li>
</xsl
:template>
<xsl
:template match="a:Director"> Director:
<xsl
:value-of select="."/><br/>
</xsl
:template>
<xsl
:template match="a:Actor"> Actor:
<xsl
:value-of select="."/><br/>
</xsl
:template>
<xsl
:template match="a:EditorialReviews/a:EditorialReview"> Editorial Review:
<xsl
:value-of select="a:Source"/><br/>
<xsl
:value-of select="a:Content"/><br/>
</xsl
:template> <!-- Yahoo stuff follows -->
<xsl
:template match="y:Result/y:Catalog">
<item>
<title>
Yahoo:
<xsl
:value-of select="y:ProductName" />
</title>
<description>
<img src="
<xsl
:value-of select="y:Thumbnail/y:Url" />" alt="
<xsl
:value-of select="y:ProductName" />" title="
<xsl
:value-of select="y:ProductName" />" align="left" width="
<xsl
:value-of select="y:Thumbnail/y:Width" />" height="
<xsl
:value-of select="y:Thumbnail/y:Height" />"/> <b>Prices from </b>
<xsl
:value-of select="y:PriceFrom"/> to
<xsl
:value-of select="y:PriceTo"/><br/>
<xsl
:value-of select="y:Description" />
</description>
<link>
<xsl
:value-of select="y:Url" />
</link>
</item>
</xsl
:template> <!-- Ebay stuff follows -->
<xsl
:template match="e:GetSearchResultsResponse/e:SearchResultItemArray">
<xsl
:apply-templates select="e:SearchResultItem" />
</xsl
:template>
<xsl
:template match="e:SearchResultItem">
<xsl
:apply-templates select="e:Item" />
</xsl
:template>
<xsl
:template match="e:Item">
<item>
<title>
eBay:
<xsl
:value-of select="e:Title" />
</title>
<description>
<xsl
:apply-templates select="e:VendorHostedPicture" />
<xsl
:value-of select="e:Title" /><br/> Item ID:
<xsl
:value-of select="e:ItemID" /><br/>
<xsl
:apply-templates select="e:BuyItNowPrice" />
<xsl
:apply-templates select="e:SellingStatus" />
</description>
<link>
<xsl
:value-of select="e:ListingDetails/e:ViewItemURL" />
</link>
</item>
</xsl
:template>
<xsl
:template match="e:BuyItNowPrice"> Buy It Now Price:
<xsl
:value-of select="." /> <br/>
</xsl
:template>
<xsl
:template match="e:SellingStatus"> Number of Bids:
<xsl
:value-of select="e:BidCount" /><br/> Current Price:
<xsl
:value-of select="e:CurrentPrice" /><br/>
</xsl
:template>
<xsl
:template match="e:VendorHostedPicture"> <img align="left" src="
<xsl
:value-of select="e:GalleryURL" />" >
</xsl
:template>
</xsl
:stylesheet>
[]
readme
course(s)
preface
I
1
2
II
3
4
III
5
6
7
IV
8
9
10
V
11
12
afterthought(s)
appendix
reference(s)
example(s)
resource(s)
_
(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.