<?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">
<xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/>
<xsl:template match="/">
  <html>
  <body>
  <h2>x-rite color checker</h2>
	<xsl:apply-templates select="cc:CxF/cc:Resources"/>
  </body>
  </html>
</xsl:template>
<xsl:template match="cc:Resources/cc:ObjectCollection">
   <table border="1">
      <tr bgcolor="#b4b4b4">
        <th align="center"> </th>
        <th align="center"> </th>
	<th align="center"> </th>
	<th colspan="3" align="center">sRGB</th>
	<th colspan="3" align="center">CIE L*a*b*</th>
	<th align="center" cellpadding="3" >Munsell</th>
      </tr>
      <tr bgcolor="#b4b4b4">
        <th align="center">No.</th>
        <th align="center" cellpadding="3" >Name</th>
	<th align="center" cellpadding="3" >patch</th>
	<th align="center" cellpadding="3" >R</th>
	<th align="center" cellpadding="3" >G</th>
	<th align="center" cellpadding="3" >B</th>
	<th align="center" cellpadding="3" >L*</th>
	<th align="center" cellpadding="3" >a*</th>
	<th align="center" cellpadding="3" >b*</th>
	<th align="center" cellpadding="3" >HVC Notation</th>
      </tr>
      <xsl:for-each select="cc:Object">
	<tr>
			<xsl:variable name="xnumber">
				<xsl:value-of select="@Id"/>
            </xsl:variable>
            <td><xsl:value-of select="substring-after($xnumber,'R')" /></td>
            <td><xsl:value-of select="@Name"/></td>
		    <xsl:for-each select="cc:DeviceColorValues">
		      <xsl:for-each select="cc:ColorHTML/@HTML">
	    		<td bgcolor="{.}"> </td>
		      </xsl:for-each>
		    </xsl:for-each>
		<xsl:for-each select="cc:ColorValues">
		    <xsl:for-each select="cc:ColorSRGB">
            		<td><xsl:value-of select="./cc:R"/></td><td><xsl:value-of select="./cc:G"/></td>
			<td><xsl:value-of select="./cc:B"/></td>
		    </xsl:for-each>
		    <xsl:for-each select="cc:ColorCIELab">
            		<td><xsl:value-of select="./cc:L"/></td><td><xsl:value-of select="./cc:B"/>
			</td><td><xsl:value-of select="./cc:B"/></td>
		    </xsl:for-each>
		</xsl:for-each>
		<xsl:for-each select="cc:DeviceColorValues">
			<xsl:for-each select="cc:ColorNotation">
			<td><xsl:value-of select="@Notation"/></td>
			</xsl:for-each>
		</xsl:for-each>
	</tr>
      </xsl:for-each>
    </table>
    
    <xsl:for-each select="cc:Object[1]/cc:DeviceColorValues/cc:ColorHTML">
     <xsl:for-each select="id(@ColorSpecification)">
		<b>Color Patches rendered for illuminant </b>     
		 <b><xsl:value-of select="./cc:TristimulusSpec/cc:Illuminant"/></b>
     </xsl:for-each>
    </xsl:for-each>

</xsl:template>
<xsl:template match="cc:Resources/cc:ColorSpecificationCollection">
</xsl:template>
<xsl:template match="cc:Resources/cc:ProfileCollection">
</xsl:template>
</xsl:stylesheet>
