<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE doc [
	<!ENTITY nbsp "&#160;">
]>

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:template match="PhoneDogResponse">
		<style type="text/css">
			h1 {background-color:#E8E8E8;font-size:22px;}
			h2 {font-size:18px;}
			h3 {font-size:16px;color:#44870E;margin-bottom:2px;}
			#cellularitemexpertreview {clear:both;margin-bottom:20px;}
			#thumb {float:left;margin-right:20px;}
			#ratings {float:left;}
			#attribute {clear:both;border-bottom:dotted 1px #cccccc;}
			#attribute #name {width:200px;float:left;background-color:#F7F7F7;padding:2px;}
			#attribute #value {padding:2px;}
			#chapters {clear:both;margin-top:20px;margin-bottom:20px;border-bottom:dotted 1px #ccc;padding-bottom:10px;}
		</style>

		<xsl:apply-templates select="Errors"/>
		<xsl:apply-templates select="CellularItemExpertReviews"/>
	</xsl:template>

	<xsl:template match="Errors">
		<xsl:value-of select="Error"/>
		<br/>
	</xsl:template>

	<xsl:template match="CellularItemExpertReviews">
		<xsl:if test="@TotalPages > 1">
			<b>Total records: </b>
			<xsl:value-of select="@TotalRecords"/>
			<p/>
		</xsl:if>
		<xsl:apply-templates select="CellularItemExpertReview "/>
	</xsl:template>

	<xsl:template match="CellularItemExpertReview ">
		<div id="cellularitemexpertreview">
			<xsl:if test="ImageMedium">
				<div id="thumb">
					<xsl:element name="img">
						<xsl:attribute name="src">
							<xsl:value-of select="ImageMedium/@Url"/>
						</xsl:attribute>
					</xsl:element>
				</div>
			</xsl:if>
			<h1>
				<xsl:value-of select="DisplayName"/> In-Depth Expert Review
			</h1>
			Published on: <xsl:value-of select="PublishDate"/><br/>
			Author: <xsl:value-of select="Author/Name"/>
			<p/>
			<h3>Ratings</h3>
			<div id="ratings">
				<xsl:apply-templates select="Ratings"/>
			</div>
			<div id="chapters">
				<xsl:apply-templates select="Chapter"/>
			</div>
		</div>
	</xsl:template>

	<xsl:template match="Ratings">
		<xsl:apply-templates select="Attribute"/>
	</xsl:template>
	
	<xsl:template match="Attribute">
		<div id="attribute">
			<div id="name">
				<xsl:value-of select="@Name"/>
			</div>
			<div id="value">
				&nbsp;<xsl:value-of select="@Value"/>
			</div>
		</div>
	</xsl:template>

	<xsl:template match="Chapter">
		<h2>
			<xsl:value-of select="Name"/>
		</h2>
		
		<xsl:value-of select="Content" disable-output-escaping="yes"/>
	</xsl:template>

</xsl:stylesheet> 

