topical media & game development
mashup-amazon-14-14-02-AmazonMobile-amazonItemWml.xml / xml
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:n="http://webservices.amazon.com/AWSECommerceService/2005-10-05" exclude-result-prefixes="n">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/" >
<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE wml PUBLIC "-//OPENWAVE.COM//DTD WML 1.3//EN" "http://www.openwave.com/dtd/wml13.dtd"> ]]></xsl:text>
<wml>
<card id="main1" title="Amazon Item Details">
<p>Amazon Item Details</p>
<xsl:apply-templates select="n:ItemLookupResponse/n:Items/n:Item"/>
<p><a href="default.wml">[Home]</a></p>
</card>
</wml>
</xsl:template>
<xsl:template match="n:Item">
<p mode="wrap">
<b><xsl:value-of select="n:ItemAttributes/n:Title" /></b><br/>List Price $$<xsl:value-of select="n:ItemAttributes/n:ListPrice/n:Amount div 100" /><br/>
ASIN: <xsl:value-of select="n:ASIN" /><br/>
<xsl:apply-templates select="n:CustomerReviews/n:AverageRating"/><br/>
<xsl:apply-templates select="n:ItemAttributes"/><br/>
</p>
</xsl:template>
<xsl:template match="n:ItemAttributes">
<xsl:apply-templates select="n:Feature"/>
<xsl:apply-templates select="n:Director"/>
<xsl:apply-templates select="n:Actor"/>
<xsl:apply-templates select="n:Artist"/>
<xsl:apply-templates select="n:Author"/>
<xsl:apply-templates select="n:ISBN"/>
<xsl:apply-templates select="n:PublicationDate"/>
<xsl:apply-templates select="n:Publisher"/>
</xsl:template>
<xsl:template match="n:Author">Author: <xsl:value-of select="."/><br/></xsl:template>
<xsl:template match="n:ISBN">ISBN: <xsl:value-of select="."/><br/></xsl:template>
<xsl:template match="n:PublicationDate">Publication Date: <xsl:value-of select="."/><br/></xsl:template>
<xsl:template match="n:Publisher">Publisher: <xsl:value-of select="."/><br/></xsl:template>
<xsl:template match="n:Binding">Binding: <xsl:value-of select="."/><br/></xsl:template>
<xsl:template match="n:CustomerReviews/n:AverageRating">Average Rating: <xsl:value-of select="."/> out of 5<br/></xsl:template>
<xsl:template match="n:Feature">* <xsl:value-of select="." /><br/></xsl:template>
<xsl:template match="n:Director"><b>Director: </b><xsl:value-of select="." /><br/></xsl:template>
<xsl:template match="n:Actor"><b>Actor: </b><xsl:value-of select="." /><br/></xsl:template>
<xsl:template match="n:Artist"><b>Artist: </b><xsl:value-of select="." /><br/></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.