<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
	xmlns:cc="http://colorexchangeformat.com/CxF3-core" xmlns:cp="http://colorexchangeformat.com/CxF3-colorpage">
<xsl:output method='html' version='2.0' encoding='UTF-8' indent='yes'/>
<xsl:template match="/">
  <html>
  <body>
  <h2>x-rite color checker</h2>
	<xsl:apply-templates select="cc:CxF/cc:CustomResources"/>
  </body>
  </html>
</xsl:template>
<xsl:template match="cc:CustomResources/cp:ColorPage">
   <table border="1">
		<xsl:for-each select="cp:Page">
			<xsl:for-each select="cp:Row">
				<tr>
					<xsl:for-each select="cp:Obj">
					  <xsl:variable name="objref" select="@Id"/>				
					  <xsl:for-each select="//cc:Object[@Id=$objref]">
						<xsl:variable name="color" select=".//cc:ColorHTML/@HTML"/>
						<td style="text-align:center; background-color:{$color}; height:80px; width:80px">
							<xsl:value-of select="./@Name"/>
					    </td>
					   </xsl:for-each>
					 </xsl:for-each>
				</tr>
			</xsl:for-each>
        </xsl:for-each>
	</table>
</xsl:template>
</xsl:stylesheet>
