<?xml     version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ccbnxml="http://xml.corporate-ir.net" exclude-result-prefixes="xsl xmlns ccbnxml">

     <!--'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    INCLUDES
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-->
    <!--'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    OUTPUT MEHTOD
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-->
    <xsl:output method="html" omit-xml-declaration="yes" indent="yes" standalone="no"/>
    <!--'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    GLOBAL PARAMETERS
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-->
    <xsl:param name="m_strTicker" select="''"/>
    <!--'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    GLOBAL VARIABLES
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-->
    <!--''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    MAIN TEMPLATE
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-->
    <xsl:template match="/">
        <xsl:apply-templates select="/*/StockQuotes/Stock_Quote[@Class = $m_strTicker]"/>
        <!--page-level template-->
    </xsl:template>
    <!--'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''-->
    <xsl:template match="Stock_Quote">

    <div id="StockInfoQuote">
       <table width="100%" border="0" cellspacing="0" cellpadding="2" class="TopQuoteTbl">
            <form method="post" name="frmTicker">
                <tr>
                    <td><div class="TopTitle">Domtar Corporation (UFS)</div></td>

                    <xsl:variable name="strLanguage" select="'FRC'" />
                    <xsl:choose>
                    <xsl:when test="$strLanguage = 'ENC'">

                        <td align="right">
                        Last trade : 
                        <xsl:call-template name="DisplayDateEN"><xsl:with-param name="strDate" select="Date/@Date"/></xsl:call-template> 
                
                        <xsl:call-template name="DisplayTimeEN"><xsl:with-param name="strTime" select="Date/@Time"/></xsl:call-template>&#160;ET
                        </td>

                    </xsl:when>  
                    <xsl:otherwise>

                        <td align="right">
                        Derni&#232;re mise &#224; jour : 
                        <xsl:call-template name="DisplayDateFR"><xsl:with-param name="strDate" select="Date/@Date"/></xsl:call-template><br />
                
                        <xsl:call-template name="DisplayTimeEN"><xsl:with-param name="strTime" select="Date/@Time"/></xsl:call-template>&#160;HE
                        </td>

                    </xsl:otherwise>
                    </xsl:choose>

                </tr>
                <tr>
                    <td colspan="2" align="left">
                <input type="hidden" name="selTicker" value="" />
                <table class="SelectTitleTbl" border="0" cellspacing="0" cellpadding="2">
                <tr>
                
                          <td class="SelectTitle" nowrap="true">Bourse :</td>
                          <xsl:for-each select="//Stock_Quote[@Class != '']"> 
                           
                    <td>
                       
                    
                      <a href="javascript:void(null)" onClick="document.getElementById('selTicker').value='{@Class}';document.frmTicker.submit();">
                        <xsl:choose>
                                         <xsl:when test="@Class = $m_strTicker">
                                             <xsl:attribute name="class">SelectStockSel</xsl:attribute>
                                         </xsl:when>
                             <xsl:otherwise>
                                             <xsl:attribute name="class">SelectStock</xsl:attribute>
                                         </xsl:otherwise>
                                    </xsl:choose>
                        <xsl:value-of select="@Class"/>
                      </a>
                     </td>
                    <xsl:if test="position() &lt; count(//Stock_Quote[@Class != ''])">
                          <td class="SelectTitleSep">|</td>    
                    </xsl:if>                          
                     </xsl:for-each>
                          </tr>
                  </table>
                    </td>
                </tr>
            </form>
         </table>
<div id="MainQuoteTblDiv">
<div class="BottomBorderDiv">
<table width="100%" border="0" cellspacing="0" cellpadding="2" class="MainQuoteTbl">
<xsl:variable name="strLanguage" select="'FRC'" />
<xsl:choose>
<xsl:when test="$strLanguage = 'ENC'">
    <tr class="modTblLabelOdd">
        <td></td>
        <td class="rightsectionVal">
            $<xsl:value-of select="Trade"/>
        </td>
    </tr>
    <tr class="modTblLabelEven">
        <td>Variation</td>
        <td class="rightsectionVal">
            <xsl:choose>
            <xsl:when test="Change = '0.00'">$0</xsl:when>
            <xsl:otherwise> 
                $<xsl:value-of select="Change"/>
            </xsl:otherwise>   
            </xsl:choose>
        </td>
    </tr>
    <tr class="modTblLabelOdd">
        <td>Variation nette (%)</td>
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(Change * 100 div PreviousClose, '#0.00') "/>%</td>
    </tr>
    <tr class="modTblLabelEven">
        <td>Volume</td>
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(Volume, '###,###,##0')"/>
        </td>
    </tr>
    <tr class="modTblLabelOdd">
        <td>Bas</td>
        <td class="rightsectionVal">
            $<xsl:value-of select="Low"/>
        </td>
    </tr>
    <tr class="modTblLabelEven">
        <td>Haut</td>
        <td class="rightsectionVal">
            $<xsl:value-of select="High"/>
        </td>
    </tr>
    <tr class="modTblLabelOdd">
        <td>Bas 52 semaines</td>
        <td class="rightsectionVal">
            $<xsl:value-of select="FiftyTwoWeekLow"/>
        </td>
    </tr>   
    <tr class="modTblLabelEven">
        <td>Haut 52 semaines</td>
        <td class="rightsectionVal">
            $<xsl:value-of select="FiftyTwoWeekHigh"/>
        </td>
    </tr>
    <tr class="modTblLabelOdd">
        <td></td> 
        <td class="rightsectionVal">
            $<xsl:value-of select="format-number(MarketCap, '###,###,###,###')"/>
        </td>           
    </tr>         
    <tr class="modTblLabelEven">
        <td>Nombre d'actions en circulation</td>
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(SharesOutstanding, '###,###,###,###')"/>
        </td>
    </tr>
</xsl:when>  
<xsl:otherwise>
    <tr class="modTblLabelOdd">
        <td>Derni&#232;re mise &#224; jour</td>        
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(Trade, '#0.00') "/>$
        </td>
    </tr>
    <tr class="modTblLabelEven">
        <td>Variation</td>
        <td class="rightsectionVal">
            <xsl:choose>
            <xsl:when test="Change = '#0,00'">0$</xsl:when>
            <xsl:otherwise> 
                <xsl:value-of select="format-number(Change, '#0.00') "/>$
            </xsl:otherwise>   
            </xsl:choose>
        </td>
    </tr>
    <tr class="modTblLabelOdd">
        <td>Variation nette (%)</td>
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(Change * 100 div PreviousClose, '#0.00') "/>%
        </td>
    </tr>
    <tr class="modTblLabelEven">
        <td>Volume</td>
        <td class="rightsectionVal">
            <xsl:value-of select="translate(format-number(Volume, '###,###,###'),',',' ') "/>
        </td>
    </tr>
    <tr class="modTblLabelOdd">
        <td>Bas</td>
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(Low, '#0.00') "/>$
        </td>
    </tr>
    <tr class="modTblLabelEven">
        <td>Haut</td>
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(High, '#0.00') "/>$
        </td>
    </tr>
    <tr class="modTblLabelOdd">
        <td>Bas 52 semaines</td>
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(FiftyTwoWeekLow, '#0.00') "/>$
        </td>
    </tr>   
    <tr class="modTblLabelEven">
        <td>Haut 52 semaines</td>
        <td class="rightsectionVal">
            <xsl:value-of select="format-number(FiftyTwoWeekHigh, '#0.00')"/>$
        </td>
    </tr>
    <tr class="modTblLabelOdd">
        <td>Capitalisation boursi&#232;re</td> 
        <td class="rightsectionVal">
            <xsl:value-of select="translate(format-number(MarketCap, '###,###,###,###'),',',' ') "/>$
        </td>           
    </tr>         
    <tr class="modTblLabelEven">
        <td>Nombre d'actions en circulation</td>
        <td class="rightsectionVal">
            <xsl:value-of select="translate(format-number(SharesOutstanding, '###,###,###,###'),',',' ') "/>
        </td>
    </tr>
</xsl:otherwise>
</xsl:choose>
</table>
</div></div>
    </div>
    </xsl:template>
<xsl:template name="DisplayDateEN">
<xsl:param name="strDate"/>
<!--strDate is assumed to be in yyyymmdd format-->
<!--year parse-->
<xsl:variable name="strYear" select="substring($strDate,1,4)"/>
<!--month parse and string map-->
<xsl:variable name="intMonth">
<xsl:value-of select="substring($strDate,5,2)"/>
</xsl:variable>
<xsl:variable name="strMonth">
<xsl:if test="$intMonth='01'">January</xsl:if>
<xsl:if test="$intMonth='02'">February</xsl:if>
<xsl:if test="$intMonth='03'">March</xsl:if>
<xsl:if test="$intMonth='04'">April</xsl:if>
<xsl:if test="$intMonth='05'">May</xsl:if>
<xsl:if test="$intMonth='06'">June</xsl:if>
<xsl:if test="$intMonth='07'">July</xsl:if>
<xsl:if test="$intMonth='08'">August</xsl:if>
<xsl:if test="$intMonth='09'">September</xsl:if>
<xsl:if test="$intMonth='10'">October</xsl:if>
<xsl:if test="$intMonth='11'">November</xsl:if>
<xsl:if test="$intMonth='12'">December</xsl:if>
</xsl:variable>
<!--day parse and remove trailing 0 if applicable-->
<xsl:variable name="strDay">
<xsl:choose>
<xsl:when test="substring($strDate,7,1) = '0'">
<xsl:value-of select="substring($strDate,8,1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($strDate,7,2)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--display date as Dec. mm, YYYY-->
<xsl:value-of select="concat($strMonth,' ',$strDay,', ',$strYear)"/>
</xsl:template>


<xsl:template name="DisplayDateFR">
<xsl:param name="strDate"/>
<!--strDate is assumed to be in yyyymmdd format-->
<!--year parse-->
<xsl:variable name="strYear" select="substring($strDate,1,4)"/>
<!--month parse and string map-->
<xsl:variable name="intMonth">
<xsl:value-of select="substring($strDate,5,2)"/>
</xsl:variable>
<xsl:variable name="strMonth">
<xsl:if test="$intMonth='01'">Janvier</xsl:if>
<xsl:if test="$intMonth='02'">F&#233;vrier</xsl:if>
<xsl:if test="$intMonth='03'">Mars</xsl:if>
<xsl:if test="$intMonth='04'">Avril</xsl:if>
<xsl:if test="$intMonth='05'">Mai</xsl:if>
<xsl:if test="$intMonth='06'">Juin</xsl:if>
<xsl:if test="$intMonth='07'">Juillet</xsl:if>
<xsl:if test="$intMonth='08'">Ao&#251;t</xsl:if>
<xsl:if test="$intMonth='09'">Septembre</xsl:if>
<xsl:if test="$intMonth='10'">Octobre</xsl:if>
<xsl:if test="$intMonth='11'">Novembre</xsl:if>
<xsl:if test="$intMonth='12'">D&#233;cembre</xsl:if>
</xsl:variable>
<!--day parse and remove trailing 0 if applicable-->
<xsl:variable name="strDay">
<xsl:choose>
<xsl:when test="substring($strDate,7,1) = '0'">
<xsl:value-of select="substring($strDate,8,1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring($strDate,7,2)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!--display date as Dec. mm, YYYY-->
<xsl:value-of select="concat('Le ',$strDay,' ',$strMonth,' ',$strYear)"/>
</xsl:template>


<xsl:template name="DisplayTimeEN">
<xsl:param name="strTime"/>
<!--strTime is assumed to be in 00:00:00 format-->
<xsl:if test="string-length($strTime) &gt; 0">
<!--hour parse-->
<xsl:variable name="intHour" select="substring($strTime,1,2)"/>
<!--minute parse-->
<xsl:variable name="intMinute" select="substring($strTime, 4,2)"/>
<!--display time-->
<xsl:choose>
<xsl:when test="number($intHour) &lt; 12">
<xsl:variable name="strHour">
<xsl:choose>
<xsl:when test="number($intHour) &lt; 10">
<xsl:value-of select="substring($intHour, 2, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$intHour"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($strHour, ':', $intMinute, ' a.m')"/>
</xsl:when>
<xsl:when test="number($intHour) = 12">
<xsl:value-of select="concat($intHour, ':', $intMinute, ' p.m')"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="intNonMilitaryHour" select="number($intHour) - 12"/>
<xsl:variable name="strHour">
<xsl:choose>
<xsl:when test="number($intNonMilitaryHour) &lt; 10">
<xsl:value-of select="substring(string($intNonMilitaryHour), 1, 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$intNonMilitaryHour"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="concat($strHour, ':', $intMinute, ' p.m')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>


</xsl:stylesheet>