<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes">

<xsl:template match="/">
<html>
	<head>
		<title>Vincent Van Gogh Becomes Programmer</title>
	</head>
	<body>
	
	<h3>Van Gogh, Famous Artist, Becomes Programmer!</h3>
		
		<p>Late news item...</p>
		
		<xsl:for-each select="vvgsources/source">
		<xsl:for-each select="document(@filename)/Order/Customer">		
		<ul>						   
			<li>
				<b>Artist:</b><xsl:value-of select="Name"></xsl:value-of>
			</li>
			<li>
				<b>Card number:</b> <xsl:value-of select="Cardnum"></xsl:value-of>
			</li>						
	   </ul>	  
		</xsl:for-each>
	  </xsl:for-each>
	  
	<p>More and more famous artists are 'turning programmer'. Consider this example:</p>
	
	<xsl:for-each select="vvgsources/source">		
	<ul>	
			<xsl:for-each select="document(@filename)/catalog/painting[1]">
		<li>					
			   <xsl:value-of select="title"></xsl:value-of> painted in <xsl:value-of select="date"></xsl:value-of>			  
		</li>		
		</xsl:for-each> 
		 <xsl:for-each select="document(@filename)/portal/sites/site">
		<li>				
			    A useful RSS is available at <xsl:value-of select="resource"></xsl:value-of>	       
		</li>		
		</xsl:for-each> 		
	</ul>
	 </xsl:for-each>
	 
	<p>Recent purchases include:</p>
	<xsl:for-each select="vvgsources/source">	  
	   <xsl:for-each select="document(@filename)/Order/Manifest/Item">	   
		 	<xsl:sort select="Title"/>
	<ul>	  
	    		
		<li><xsl:value-of select="Title"></xsl:value-of></li>								   
	</ul>
	   
	</xsl:for-each>	
    </xsl:for-each>
	</body>
</html>
</xsl:template>

</xsl:stylesheet>

