XSL Examples

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
		
	<xsl:template match="/">
		<html>
			<body>
				<ul>
					<xsl:apply-templates></xsl:apply-templates>
				</ul>
			</body>
			
		</html>		
	</xsl:template>	
	
	<xsl:template match="address">
		<li><xsl:value-of select="name"></xsl:value-of></li>
	</xsl:template>
	
	
</xsl:stylesheet>
	

Assume the twitter feed from: http://twitter.com/statuses/public_timeline.xml

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
	
	
	<xsl:template match="/">
		<html>
			<head>
				<style>
					body {
						width : 100%;
						background-color: #F2E6CE;
					}
					
					#content {
						width: 960px;
						background-color: #606362;			
						margin-left: auto;
						margin-right: auto;
						color: #F2E6CE;			
						margin-top: 100px;
						border-radius: 8px;	
					}
					
					li {
						padding: 5px;
						display: block;
						height: 50px;
					}
					
					li .thumb {
						float: left;
						border: 2px solid #1D1D1F;
						margin-right: 20px;
					}								
					
				</style>
			</head>
			<body>
				<div id="wrapper">
					<div id="content">
						<ul>
							<xsl:apply-templates></xsl:apply-templates>
						</ul>
						
					</div>
				</div>
			</body>
		</html>
	</xsl:template>
	
	<xsl:template match="status">
		<li>
			<xsl:apply-templates select="user/profile_image_url" ></xsl:apply-templates>			
			<span class="status"><xsl:value-of select="text" /></span>
		</li>
	</xsl:template>
	
	<xsl:template match="status/user/profile_image_url">
		<img src="{.}" class="thumb" />
	</xsl:template>
	
</xsl:stylesheet>
	
course: