View stylesheet

XML schemas http://biodiversity.eionet.europa.eu/schemas/barcelona_convention/dumping.xsd
Output type HTML
Description This transformation contains common functions used in Barcelona Convention 7 Protocols. Schema URL is dummy pointing to barcelona.xsd
XSL file common.xslt (Last modified: 27 May 2008 12:25 )
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#160;"> ]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns="http://www.w3.org/1999/xhtml" 
                version="1.0">
	<xsl:output method="xml" indent="yes"
              doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
              doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
              omit-xml-declaration="yes"/>
  <xsl:preserve-space elements="difficulty-type"/>
  
  <!-- METADATA INFORMATION -->
  <xsl:template match="reporting-party">
    <h2>
      <xsl:value-of select="$labels/label[@id='rp-title']"/>
    </h2>
    <table border="1" cellpadding="0" cellspacing="0" class="datatable">
        <tr>
          <td><xsl:value-of select="$labels/label[@id='rp-cp']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="contracting-party" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra1">
          <td><xsl:value-of select="$labels/label[@id='rp-rp']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="reporting-period-start" />
            </xsl:call-template>
            -
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="reporting-period-end" />
            </xsl:call-template>
          </td>
        </tr>
        <tr>
          <td><xsl:value-of select="$labels/label[@id='rp-inf']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="institution-name-full" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra1">
          <td><xsl:value-of select="$labels/label[@id='rp-onf']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="officer-name-focalpoint" />
            </xsl:call-template>
          </td>
        </tr>
        <tr>
          <td><xsl:value-of select="$labels/label[@id='mail']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="mailing-address" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra1">
          <td><xsl:value-of select="$labels/label[@id='tel']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="telephone" />
            </xsl:call-template>
          </td>
        </tr>
        <tr>
          <td><xsl:value-of select="$labels/label[@id='fax']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="fax" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra1">
          <td><xsl:value-of select="$labels/label[@id='email']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="email" />
            </xsl:call-template>
          </td>
        </tr>
        <tr>
          <td><xsl:value-of select="$labels/label[@id='rp-signature']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="signature" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra1">
          <td><xsl:value-of select="$labels/label[@id='rp-sd']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="submission-date" />
            </xsl:call-template>
          </td>
        </tr>
        <tr>
          <td>
            <em><xsl:value-of select="$labels/label[@id='rp-cpn-title']"/></em>
          </td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="contact-point-national/contact-point" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra0">
          <td><xsl:value-of select="$labels/label[@id='rp-cpn-inf']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="contact-point-national/institution-full-name" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra1">
          <td><xsl:value-of select="$labels/label[@id='mail']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="contact-point-national/mailing-address" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra0">
          <td><xsl:value-of select="$labels/label[@id='tel']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="contact-point-national/telephone" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra1">
          <td><xsl:value-of select="$labels/label[@id='fax']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="contact-point-national/fax" />
            </xsl:call-template>
          </td>
        </tr>
        <tr class="zebra0">
          <td><xsl:value-of select="$labels/label[@id='email']"/></td>
          <td>
            <xsl:call-template name="toHtmlString">
              <xsl:with-param name="text" select="contact-point-national/email" />
            </xsl:call-template>
          </td>
        </tr>
    </table>
    <p>
      <xsl:value-of select="$labels/label[@id='rp-p-title']"/>
    </p>
    <p>
      <em>
        <xsl:value-of select="$labels/label[@id='rp-p-desc']"/>
      </em>
    </p>
    <xsl:for-each select="providers/*">
      <table border="1" cellpadding="0" cellspacing="0" width="50%" class="datatable">
          <tr class="zebra0">
            <td><xsl:value-of select="$labels/label[@id='rp-p-inf']" /></td>
            <td>
              <xsl:call-template name="toHtmlString">
                <xsl:with-param name="text" select="institution-full-name" />
              </xsl:call-template>
            </td>
          </tr>
          <tr class="zebra1">
            <td><xsl:value-of select="$labels/label[@id='rp-p-cpn']" /></td>
            <td>
              <xsl:call-template name="toHtmlString">
                <xsl:with-param name="text" select="contact-point-name" />
              </xsl:call-template>
            </td>
          </tr>
          <tr class="zebra0">
            <td><xsl:value-of select="$labels/label[@id='mail']" /></td>
            <td>
              <xsl:call-template name="toHtmlString">
                <xsl:with-param name="text" select="mailing-address" />
              </xsl:call-template>
            </td>
          </tr>
          <tr class="zebra1">
            <td><xsl:value-of select="$labels/label[@id='tel']" /></td>
            <td>
              <xsl:call-template name="toHtmlString">
                <xsl:with-param name="text" select="telephone" />
              </xsl:call-template>
            </td>
          </tr>
          <tr class="zebra0">
            <td><xsl:value-of select="$labels/label[@id='fax']" /></td>
            <td>
              <xsl:call-template name="toHtmlString">
                <xsl:with-param name="text" select="fax" />
              </xsl:call-template>
            </td>
          </tr>
          <tr class="zebra1">
            <td><xsl:value-of select="$labels/label[@id='email']" /></td>
            <td>
              <xsl:call-template name="toHtmlString">
                <xsl:with-param name="text" select="email" />
              </xsl:call-template>
            </td>
          </tr>
      </table>
      <br />
    </xsl:for-each>
  </xsl:template>  
  
  <xsl:template name="decode-difficulty">
    <xsl:param name="text" select="."/>
    <xsl:param name="pattern"/>
     <xsl:if test="string-length($text) != 0">
       <xsl:choose>
         <xsl:when test="contains($text, $pattern)">
           X
          </xsl:when>
          <xsl:otherwise>
            &nbsp;
          </xsl:otherwise>
        </xsl:choose>
     </xsl:if>
  </xsl:template>  

  <xsl:template name="toHtmlString">
    <xsl:param name="text" select="."/>
    <xsl:choose>
      <xsl:when test="$text != ''"><xsl:value-of select="$text"/></xsl:when>
      <xsl:otherwise>&nbsp;</xsl:otherwise>
    </xsl:choose>
  </xsl:template>
</xsl:stylesheet>