<?xml version="1.0" ?>
<!DOCTYPE stylesheet 
[
<!ENTITY nbsp    "&amp;#160;">

]><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		  version="1.0"
                  xmlns:vmp="http://www.hoise.com/vmp/1.0"
                  xmlns:xt="http://www.jclark.com/xt"
                  extension-element-prefixes="xt">
                  
                  
<xsl:include href="../set-up/settings.xsl"/>
<xsl:include href=".../../../set-up/format-basis.xsl"/>
<xsl:variable name="CMTSetUp" select="document('../set-up/cmt.xml')/vmp:cmt" />


<xsl:variable name="ArticleId" />
<xsl:variable name="SelectAuthor" />
<xsl:variable name="SelectName" />
<xsl:variable name="SelectGroup" />
<xsl:variable name="SelectMagazine" />
<xsl:variable name="SelectIssue" />

<xsl:variable  name="Prefix"><xsl:value-of select="translate(substring($SelectGroup,1,$PrefixLength),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/></xsl:variable>

           <xsl:variable name="resetForms"/>
   




 

<xsl:template match="vmp:article-database" >              
<xt:document method="html" href="temp/publish.txt">
<xsl:call-template name="format-basis">
<xsl:with-param name="Title">List results</xsl:with-param>
<xsl:with-param name="Contents">


<table height="600"
       cellspacing="0" 
       width="100%" 
       cellpadding="0">
<tr>
<td width="25">
<img src="{$IconDirectory}/spacer.gif" 
     width="25" 
     border="0" />

</td>
<td>

<table bgcolor="black" 
       border="1"
       width="100%" 
       cellpadding="0"
       cellspacing="0">
<tr>
<td>
       
<table bgcolor="{$BaseColour}" 
       cellspacing="1" 
       cellpadding="0"
       width="100%" >

<tr bgcolor="{$SupportColour}">
<td colspan="2" height="20" style="{$CMTSetUp/vmp:layout/vmp:table/@title-style}">
<div style="color: {$BaseColour};" >VMP List results</div>

</td>
</tr>
<tr><td>

<table cellspacing="1" 
       cellpaddding="0"
       width="100%">

<tr height="40">
<!-- <td style="{$CMTSetUp/vmp:layout/vmp:table/@header-style}">Number</td>-->
	<td style="{$CMTSetUp/vmp:layout/vmp:table/@header-style}" >Autho</td>
	<td style="{$CMTSetUp/vmp:layout/vmp:table/@header-style}">Articleid</td>
	<td style="{$CMTSetUp/vmp:layout/vmp:table/@header-style}" >Title</td>
	<td style="{$CMTSetUp/vmp:layout/vmp:table/@header-style}" >Part</td>
    <td style="{$CMTSetUp/vmp:layout/vmp:table/@header-style}" >Status</td>
<!--	<td style="{$CMTSetUp/vmp:layout/vmp:table/@header-style}" >Attachments</td> -->

</tr>

<xsl:apply-templates select="vmp:article[starts-with(@id,$Prefix) 
                            and contains(@id,$ArticleId) 
                            and (contains(vmp:head/vmp:author/@name,$SelectAuthor)  
                                       or vmp:head/vmp:author/@name = '')
                           ]">
                            
<xsl:sort select="@id" />
</xsl:apply-templates >

</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

</td>
</tr>
<tr>
<td height="100%" 
    colspan="2">
<img src="{$IconDirectory}/spacer.gif" 
     width="25" 
     border="0" />
</td></tr>
</table>


</xsl:with-param>

</xsl:call-template>
</xt:document>  

</xsl:template>


<xsl:template match="vmp:article">

<xsl:variable name="bgcolor">
<xsl:choose>
<xsl:when test="position() mod 2 = 1 ">
<xsl:value-of select="$BackgroundColour" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$BaseColour" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>


<xsl:variable name="id"><xsl:value-of select="@id" /></xsl:variable>
<xsl:for-each select="vmp:head/vmp:part">

<xsl:if test="not(@name =preceding-sibling::vmp:part/@name)">

<xsl:if test="contains(@name,$SelectMagazine) 
         and (contains(@issue,$SelectIssue)  or 
              (@issue = '') )">
<tr bgcolor="{$bgcolor}">
<!-- <td style="{$CMTSetUp/vmp:layout/vmp:table/@text-style}" ><xsl:number/></td> -->
	<td><xsl:value-of select="../vmp:author/@name" /></td>
<td style="{$CMTSetUp/vmp:layout/vmp:table/@text-style}" >
<a href="{$EditorServlet}?action=restore&amp;userid={$SelectName}&amp;articleid={substring($id,string-length($Prefix)+2)}&amp;groupname={$SelectGroup}&amp;selectmagazine={../vmp:part/@name}">
<xsl:value-of select="$id" /></a>
</td>
	<td style="{$CMTSetUp/vmp:layout/vmp:table/@text-style}" ><xsl:value-of select="../vmp:title" /></td>
	<td style="{$CMTSetUp/vmp:layout/vmp:table/@text-style}" ><xsl:value-of select="../vmp:part/@name" /></td>	
	<td style="{$CMTSetUp/vmp:layout/vmp:table/@text-style}" ><xsl:value-of select="../vmp:part/@status" /></td>
</tr>

</xsl:if>
</xsl:if>
</xsl:for-each>


</xsl:template>



<xsl:template match="*|@*">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>
    <xsl:apply-templates select="node()"/>
  </xsl:copy>

</xsl:template>

</xsl:stylesheet>

