<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:template name="script">
    <xsl:value-of select="//SCRIPT"/>
  </xsl:template>
  <xsl:template name="BannerTextApplication">
    <xsl:value-of select="//SPAN[@CLASS='BannerTextApplication']"/>
  </xsl:template>
  <xsl:template name="BannerTextCompany">
    <xsl:value-of select="//SPAN[@CLASS='BannerTextCompany']"/>
  </xsl:template>
  <xsl:template name="ApplicationName">
    <xsl:value-of select="//TABLE/TR[TD/B='Name:']/TD[position()=3]"/>
  </xsl:template>
  <xsl:template name="ApplicationVersion">
    <xsl:value-of select="//TABLE/TR[TD/B='Version:']/TD[position()=3]"/>
  </xsl:template>
  <xsl:template name="ApplicationPublisher">
    <xsl:value-of select="//TABLE/TR[TD/B='Publisher:']/TD[position()=3]"/>
  </xsl:template>
  <xsl:template name="Prerequisites">
    <xsl:copy-of select="//TABLE[position()=2]//UL"></xsl:copy-of>
  </xsl:template>
  
  
<xsl:template match="/">
  
  <html>    
      <head>
        <title>
          <xsl:call-template name="BannerTextCompany"/> :: <xsl:call-template name="BannerTextApplication"/>
        </title>
        <script language="JavaScript">
          <![CDATA[ 
          <!--
runtimeVersion = "2.0.0";
directLink = "ClickOnceDemo.application";


function Initialize()
{
  if (HasRuntimeVersion(runtimeVersion))
  {
    InstallButton.href = directLink;
    BootstrapperSection.style.display = "none";
  }
}
function HasRuntimeVersion(v)
{
  var va = GetVersion(v);
  var i;
  var a = navigator.userAgent.match(/\.NET CLR [0-9.]+/g);
  if (a != null)
    for (i = 0; i < a.length; ++i)
      if (CompareVersions(va, GetVersion(a[i])) <= 0)
		return true;
  return false;
}
function GetVersion(v)
{
  var a = v.match(/([0-9]+)\.([0-9]+)\.([0-9]+)/i);
    return a.slice(1);
}
function CompareVersions(v1, v2)
{
  for (i = 0; i < v1.length; ++i)
  {
    var n1 = new Number(v1[i]);
    var n2 = new Number(v2[i]);
    if (n1 < n2)
      return -1;
    if (n1 > n2)
      return 1;
  }
  return 0;
}
-->

]]>
          
        </script>
      </head>
    <body onload="Initialize();">

      <table>
        <tr>
          <td>Naam:</td>
          <td>
            <xsl:call-template name="ApplicationName"/>
          </td>
        </tr>
        <tr>
          <td>Versie:</td>
          <td>
            <xsl:call-template name="ApplicationVersion"/>
          </td>
        </tr>
        <tr>
          <td>Uitgever:</td>
          <td>
            <xsl:call-template name="ApplicationPublisher"/>
          </td>
        </tr>
      </table>
      
      
      <!-- Begin Prerequisites -->
      <TABLE ID="BootstrapperSection" BORDER="0">
        <TR>
          <TD COLSPAN="2">De volgende componenten zijn verplicht.</TD>
        </TR>
        <TR>
          <TD WIDTH="10"></TD>
          <TD>            
            <xsl:call-template name="Prerequisites" />            
          </TD>
        </TR>
        <TR>
          <TD COLSPAN="2">
            Als deze componenten al geïnstalleerd zijn kunt u de applicatie <SPAN CLASS="JustThisApp">
              <A HREF="ClickOnceDemo.application">starten</A>
            </SPAN>, anders klikt u op de installatieknop hieronder om de componenten te installeren en de applicatie uit te voeren.
          </TD>
        </TR>
        <TR>
          <TD COLSPAN="2"></TD>
        </TR>
      </TABLE>
      <!-- End Prerequisites -->
      
      <!-- Begin Buttons -->      
          <TABLE CELLPADDING="2" CELLSPACING="0" BORDER="0" WIDTH="540" STYLE="cursor:hand" ONCLICK="window.navigate(InstallButton.href)">
            <TR>
              <TD ALIGN="LEFT">
                <TABLE CELLPADDING="1" BGCOLOR="#333333" CELLSPACING="0" BORDER="0">
                  <TR>
                    <TD>
                      <TABLE CELLPADDING="1" BGCOLOR="#cecece" CELLSPACING="0" BORDER="0">
                        <TR>
                          <TD>
                            <TABLE CELLPADDING="1" BGCOLOR="#efefef" CELLSPACING="0" BORDER="0">
                              <TR>
                                <TD WIDTH="20">
                                  <SPACER TYPE="block" WIDTH="20" HEIGHT="1" />
                                </TD>
                                <TD>
                                  <A ID="InstallButton" HREF="setup.exe">Installeer</A>
                                </TD>
                                <TD width="20">
                                  <SPACER TYPE="block" WIDTH="20" HEIGHT="1" />
                                </TD>
                              </TR>
                            </TABLE>
                          </TD>
                        </TR>
                      </TABLE>
                    </TD>
                  </TR>
                </TABLE>
              </TD>
              <TD WIDTH="15%" ALIGN="right" />
            </TR>
          </TABLE>
        
      <!-- End Buttons -->
    </body>
    </html>
</xsl:template>

</xsl:stylesheet> 

