<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--
******************************************************************
*
* File: prdf2html.xsl
*
* Copyright 2009 Programming Research Ltd
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet for generating an HTML report.
*
* Usage: Use as input to xsltproc, e.g.:
*        xsltproc prdf2html.xsl pass1.xml >report.xhtml
*
******************************************************************
-->

<!DOCTYPE section [
  <!ENTITY nbsp '&#160;'>
]>

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:svg="http://www.w3.org/2000/svg" 
                xmlns:v="urn:schemas-microsoft-com:vml" 
                xmlns:prdf="http://www.programmingresearch.com/todo" >

  <!-- Settings file -->
  <xsl:include href="html_settings.xsl"/>

  <!-- set $html_format true => Generate HTML
                        false => Generate XHTML -->
  <xsl:param name="html_format" select="true()" />
  <xsl:param name="logo_file" />

<!-- HTML: -->
  <xsl:output method="html"
            indent="yes" /> 
  
<!-- XHTML:
  <xsl:output method="xml"
            doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
            doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
            indent="yes" /> 
-->

<!-- Following commented out as cannot find a way to specify the
     location of these files at run-time:
  <xsl:include href='headings_xhtml.xsl'/>
  <xsl:include href='textual_xhtml.xsl'/>
  <xsl:include href='file_list_xhtml.xsl'/>
  <xsl:include href='table_xhtml.xsl'/>
  <xsl:include href='svg_xhtml.xsl'/>
  <xsl:include href='verbatim_xhtml.xsl'/>
  <xsl:include href='hierarchy_graphic_xhtml.xsl'/>
  <xsl:include href='function_structure_diagram_xhtml.xsl'/>
  <xsl:include href='eoln_xhtml.xsl'/>
  <xsl:include href='separator_xhtml.xsl'/>
  <xsl:include href='nbsp_xhtml.xsl'/>
-->

  <xsl:variable name="empty_string" />

  <xsl:template match="/">
    <html>
      <head>
        <title>
          <xsl:value-of select="/prdf:report/prdf:title" />
          <xsl:text> : </xsl:text>
          <xsl:value-of select="/prdf:report/prdf:project_name" />
        </title>
        <style type="text/css">
          h1 { font-size: 24pt; color: black }
          h2 { font-size: 20pt; color: black }
          h3 { font-size: 17pt; color: black }
          h4 { font-size: 16pt; color: black }
          h5 { font-size: 15pt; color: black }
          h6 { font-size: 13pt; color: black }

          .zh2 { font-size: 20pt; color: black; font-weight: boldl }
          .zh3 { font-size: 17pt; color: black; font-weight: bold }
          .zh4 { font-size: 15pt; color: black; font-weight: bold }
          .zh5 { font-size: 13pt; color: black; font-weight: bold }

          .lightheader { background-color: <xsl:value-of select="$prdf_table_head1" />; }
          .boldheader  { background-color: <xsl:value-of select="$prdf_table_head2" />; }

          .center { text-align: center; margin: 0 auto; }
          .left   { text-align: left; margin: 0 auto; }
          .rotate { direction: ltr; writing-mode: tb-rl; }

          v\:* { behavior: url(#default#VML); }

          .prdftable,table,td,th
          {
            border-style:    <xsl:value-of select="$prdf_table_border_style" />;
            border-color:    <xsl:value-of select="$prdf_table_border_colour" />;
            border-collapse: <xsl:value-of select="$prdf_table_border_collapse" />;
            border-width:    <xsl:value-of select="$prdf_table_border_width" />px;
          }

          .box
          {
            border-style:    <xsl:value-of select="$prdf_box_border_style" />;
            border-color:    <xsl:value-of select="$prdf_box_border_colour" />;
            border-collapse: <xsl:value-of select="$prdf_box_border_collapse" />;
            border-width:    <xsl:value-of select="$prdf_box_border_width" />px;
          }

          body { font-family: <xsl:value-of select="$prdf_body_font" />; }
        </style>
      </head>
      <body>
        <div>
          <div class="center">
            <xsl:if test="$logo_file">
              <img>
                <xsl:attribute name="src">
                  <xsl:value-of select="$logo_file" />
                </xsl:attribute>
                <xsl:attribute name="alt">
                  <xsl:text>logo</xsl:text>
                </xsl:attribute>
              </img>
            </xsl:if>
            <p/>
            <xsl:if test="/prdf:report/prdf:title != $empty_string">
              <h1>
                <xsl:value-of select="/prdf:report/prdf:title" />
              </h1>
            </xsl:if>
            <p/>
            <xsl:if test="/prdf:report/prdf:project_name != $empty_string">
              <h2><xsl:value-of select="/prdf:report/prdf:project_name" /></h2>
            </xsl:if>
            <p/>
            <xsl:if test="/prdf:report/prdf:date != $empty_string">
              <h2><xsl:value-of select="/prdf:report/prdf:date" /></h2>
            </xsl:if>
            <xsl:apply-templates mode="doc" select="/prdf:report/prdf:front_page" />
            <p/>
            <hr/>
          </div>

<!-- add a target for the link for each title -->
          <h2>Contents</h2>
          <table>
            <tr>
              <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
              <td>
                <xsl:apply-templates mode="toc" select="/prdf:report/prdf:main" />
                <xsl:apply-templates mode="toc_app" select="/prdf:report/prdf:appendices" />
              </td>
            </tr>
          </table>
          <hr/>   

          <xsl:apply-templates mode="doc" select="/prdf:report/prdf:main" />
          <xsl:apply-templates mode="doc_app" select="/prdf:report/prdf:appendices" />

        </div>
      </body>
    </html>
  </xsl:template>

  <xsl:template mode="doc" match="prdf:section" >
    <xsl:apply-templates mode="doc" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:section" >
    <xsl:apply-templates mode="doc_app" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:section">
    <xsl:apply-templates mode="toc" select="prdf:h2|prdf:h3|prdf:h4|prdf:h5" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:section">
    <xsl:apply-templates mode="toc_app" select="prdf:h2|prdf:h3|prdf:h4|prdf:h5" />
  </xsl:template>

<!--
</xsl:stylesheet>
-->

<!--
******************************************************************
*
* File: headings_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<!DOCTYPE section [
  <!ENTITY nbsp '&#160;'>
]>

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:divider">
    <xsl:comment>DIVIDER_MARKER:</xsl:comment>
    <xsl:apply-templates mode="doc" />
    <xsl:comment>END_DIVIDER_MARKER</xsl:comment>
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:divider">
    <xsl:comment>DIVIDER_MARKER:</xsl:comment>
    <xsl:apply-templates mode="doc_app" />
    <xsl:comment>END_DIVIDER_MARKER</xsl:comment>
  </xsl:template>

  <xsl:template mode="toc" match="prdf:divider">
    <xsl:comment>DIVIDER_MARKER:</xsl:comment>
    <xsl:value-of select="." />
    <xsl:comment>END_DIVIDER_MARKER</xsl:comment>
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:divider">
    <xsl:comment>DIVIDER_MARKER:</xsl:comment>
    <xsl:value-of select="." />
    <xsl:comment>END_DIVIDER_MARKER</xsl:comment>
  </xsl:template>

  <xsl:template mode="doc" match="prdf:h2">
    <h2>
      <a name="{generate-id(.)}">
        <xsl:number from="/" level="any" count="prdf:h2" />
        <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
        <xsl:value-of select="." />
      </a>
    </h2>
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:h2">
    <h2>
      <a name="{generate-id(.)}">
        <xsl:number from="/prdf:report/prdf:appendices" level="any" count="prdf:h2" format="A" />
        <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
        <xsl:value-of select="." />
      </a>
    </h2>
  </xsl:template>

  <xsl:template mode="toc" match="prdf:h2">
    <p>
      <xsl:number from="/" level="any" count="prdf:h2" />
      <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
      <a href="#{generate-id(.)}">
        <xsl:value-of select="." />
      </a>
    </p>
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:h2">
    <p>
      <xsl:number from="/prdf:report/prdf:appendices" level="any" count="prdf:h2" format="A" />
      <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
      <a href="#{generate-id(.)}">
        <xsl:value-of select="." />
      </a>
    </p>
  </xsl:template>

  <xsl:template mode="doc" match="prdf:h3">
    <h3>
      <a name="{generate-id(.)}">
        <xsl:number from="/" level="any" count="prdf:h2" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
        <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
        <xsl:value-of select="." />
      </a>
    </h3>
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:h3">
    <h3>
      <a name="{generate-id(.)}">
        <xsl:number from="/prdf:report/prdf:appendices" level="any" count="prdf:h2" format="A" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
        <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
        <xsl:value-of select="." />
      </a>
    </h3>
  </xsl:template>

  <xsl:template mode="toc" match="prdf:h3">
    <p>
      <xsl:number from="/" level="any" count="prdf:h2" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
      <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
      <a href="#{generate-id(.)}">
        <xsl:value-of select="." />
      </a>
    </p>
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:h3">
    <p>
      <xsl:number from="/prdf:report/prdf:appendices" level="any" count="prdf:h2" format="A" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
      <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
      <a href="#{generate-id(.)}">
        <xsl:value-of select="." />
      </a>
    </p>
  </xsl:template>

  <xsl:template mode="doc" match="prdf:h4">
    <h4>
      <a name="{generate-id(.)}">
        <xsl:number from="/" level="any" count="prdf:h2" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h3" level="any" count="prdf:h4" />
        <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
        <xsl:value-of select="." />
      </a>
    </h4>
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:h4">
    <h4>
      <a name="{generate-id(.)}">
        <xsl:number from="/prdf:report/prdf:appendices" level="any" count="prdf:h2" format="A" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h3" level="any" count="prdf:h4" />
        <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
        <xsl:value-of select="." />
      </a>
    </h4>
  </xsl:template>

  <xsl:template mode="toc" match="prdf:h4">
    <p>
      <xsl:number from="/" level="any" count="prdf:h2" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h3" level="any" count="prdf:h4" />
      <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
      <a href="#{generate-id(.)}">
<!--
        <xsl:number from="/" level="any" count="prdf:h2|prdf:h3|prdf:h4" format="1.1.1. " />
-->
        <xsl:value-of select="." />
      </a>
    </p>
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:h4">
    <p>
      <xsl:number from="/prdf:report/prdf:appendices" level="any" count="prdf:h2" format="A" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h3" level="any" count="prdf:h4" />
      <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
      <a href="#{generate-id(.)}">
        <xsl:value-of select="." />
      </a>
    </p>
  </xsl:template>

  <xsl:template mode="doc" match="prdf:h5">
    <h5>
      <a name="{generate-id(.)}">
        <xsl:number from="/" level="any" count="prdf:h2" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h3" level="any" count="prdf:h4" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h4" level="any" count="prdf:h5" />
        <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
        <xsl:value-of select="." />
      </a>
    </h5>
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:h5">
    <h5>
      <a name="{generate-id(.)}">
        <xsl:number from="/prdf:report/prdf:appendices" level="any" count="prdf:h2" format="A" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h3" level="any" count="prdf:h4" />
        <xsl:text>.</xsl:text>
        <xsl:number from="prdf:h4" level="any" count="prdf:h5" />
        <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
        <xsl:value-of select="." />
      </a>
    </h5>
  </xsl:template>

  <xsl:template mode="toc" match="prdf:h5">
    <p>
      <xsl:number from="/" level="any" count="prdf:h2" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h3" level="any" count="prdf:h4" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h4" level="any" count="prdf:h5" />
      <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
      <a href="#{generate-id(.)}">
<!--
        <xsl:number from="/" level="any" count="prdf:h2|prdf:h3|prdf:h4:prdf:h5" format="1.1.1.1. " />
-->
        <xsl:value-of select="." />
      </a>
    </p>
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:h5">
    <p>
      <xsl:number from="/prdf:report/prdf:appendices" level="any" count="prdf:h2" format="A" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h2" level="any" count="prdf:h3" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h3" level="any" count="prdf:h4" />
      <xsl:text>.</xsl:text>
      <xsl:number from="prdf:h4" level="any" count="prdf:h5" />
      <xsl:text>&nbsp;&nbsp;&nbsp;&nbsp;</xsl:text>
      <a href="#{generate-id(.)}">
        <xsl:value-of select="." />
      </a>
    </p>
  </xsl:template>

<!--
******************************************************************
*
* File: textual_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:text">
    <xsl:call-template name="prdf_text" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:text">
    <xsl:call-template name="prdf_text" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:text">
    <xsl:call-template name="prdf_text" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:text">
    <xsl:call-template name="prdf_text" />
  </xsl:template>

  <xsl:template name="prdf_text">
    <xsl:choose>
      <xsl:when test="@bold='1'">
        <b>
          <xsl:apply-templates mode="doc" />
        </b>
      </xsl:when>
      <xsl:otherwise> 
        <xsl:apply-templates mode="doc" />
      </xsl:otherwise> 
    </xsl:choose>
  </xsl:template>

  <!-- -->

  <xsl:template mode="doc" match="prdf:subscript">
    <xsl:call-template name="prdf_subscript" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:subscript">
    <xsl:call-template name="prdf_subscript" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:subscript">
    <xsl:call-template name="prdf_subscript" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:subscript">
    <xsl:call-template name="prdf_subscript" />
  </xsl:template>

  <xsl:template name="prdf_subscript">
    <sub><xsl:apply-templates mode="doc" /></sub>
  </xsl:template>

  <!-- -->

  <xsl:template mode="doc" match="prdf:italic">
    <xsl:call-template name="prdf_italic" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:italic">
    <xsl:call-template name="prdf_italic" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:italic">
    <xsl:call-template name="prdf_italic" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:italic">
    <xsl:call-template name="prdf_italic" />
  </xsl:template>

  <xsl:template name="prdf_italic">
    <i>
      <xsl:apply-templates mode="doc" />
    </i>
  </xsl:template>

<!--
******************************************************************
*
* File: file_list_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:file_list">
    <xsl:call-template name="prdf_file_list" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:file_list">
    <xsl:call-template name="prdf_file_list" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:file_list">
    <xsl:call-template name="prdf_file_list" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:file_list">
    <xsl:call-template name="prdf_file_list" />
  </xsl:template>

  <xsl:template name="prdf_file_list">
    <ul>
      <xsl:apply-templates select="prdf:filename" />
    </ul>
  </xsl:template>

  <!-- -->

  <xsl:template match="prdf:filename">
    <li><xsl:apply-templates/></li>
  </xsl:template>

<!--
******************************************************************
*
* File: table_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0" 
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:table">
    <xsl:call-template name="prdf_table" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:table">
    <xsl:call-template name="prdf_table" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:table">
    <xsl:call-template name="prdf_table" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:table">
    <xsl:call-template name="prdf_table" />
  </xsl:template>

  <xsl:template name="prdf_table">
    <xsl:if test="@formating='1'">
      <hr/>
    </xsl:if>
    <xsl:if test="@formating='2'">
      <hr/>
    </xsl:if>
    <table class="prdftable">
      <xsl:if test="@width">
        <xsl:attribute name="width">
          <xsl:value-of select="@width" />
        </xsl:attribute>
      </xsl:if>
      <xsl:if test="@class">
        <xsl:attribute name="class">
          <xsl:value-of select="@class" />
        </xsl:attribute>
      </xsl:if>
      <xsl:for-each select="prdf:col_width">
        <col>
          <xsl:attribute name="width">
            <xsl:value-of select="@width" />
          </xsl:attribute>
        </col>
      </xsl:for-each>
      <xsl:for-each select="prdf:row">
        <tr>
        <xsl:if test="@valign='1'">
          <xsl:attribute name="valign">
            <xsl:value-of select="'top'" />
          </xsl:attribute>
        </xsl:if>

        <xsl:for-each select="prdf:cell">
          <td>
  
          <xsl:if test="@heading">
            <xsl:choose>
              <xsl:when test="@heading='1'">
                <xsl:attribute name="class">lightheader</xsl:attribute>
              </xsl:when>
              <xsl:when test="@heading='2'">
                <xsl:attribute name="class">boldheader</xsl:attribute>
              </xsl:when>
            </xsl:choose>
          </xsl:if>
  
          <xsl:if test="string-length(@bgcolor)">
            <xsl:attribute name="bgcolor">
              <xsl:value-of select="@bgcolor" />
            </xsl:attribute>
          </xsl:if>
  
          <xsl:if test="string-length(@colspan)">
            <xsl:attribute name="colspan">
              <xsl:value-of select="@colspan" />
            </xsl:attribute>
          </xsl:if>
  
          <xsl:if test="string-length(@align)">
            <xsl:attribute name="align">
              <xsl:value-of select="@align" />
            </xsl:attribute>
          </xsl:if>
  
          <xsl:if test="string-length(@angle)">
            <xsl:attribute name="class">
              <xsl:text>rotate</xsl:text>
            </xsl:attribute>
          </xsl:if>

          <xsl:apply-templates/>
 
          </td>
        </xsl:for-each>
      </tr>
      </xsl:for-each>
    </table>
    <xsl:if test="@formating='2'">
      <hr/>
    </xsl:if>
  </xsl:template>

<!--
******************************************************************
*
* File: svg_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:svg="http://www.w3.org/2000/svg" 
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="svg:svg">
    <xsl:call-template name="svg_svg" />
  </xsl:template>

  <xsl:template mode="doc_app" match="svg:svg">
    <xsl:call-template name="svg_svg" />
  </xsl:template>

  <xsl:template mode="toc" match="svg:svg">
    <xsl:call-template name="svg_svg" />
  </xsl:template>

  <xsl:template mode="toc_app" match="svg:svg">
    <xsl:call-template name="svg_svg" />
  </xsl:template>

  <xsl:template name="svg_svg">
    <xsl:if test="not(boolean($html_format))">
      <xsl:copy-of select="." />
    </xsl:if>
  </xsl:template>

<!--
******************************************************************
*
* File: vml_xhtml.xsl
*
* Written: C.Waddingham, 24-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:v="urn:schemas-microsoft-com:vml" 
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="v:group">
    <xsl:call-template name="v_group" />
  </xsl:template>

  <xsl:template mode="doc_app" match="v:group">
    <xsl:call-template name="v_group" />
  </xsl:template>

  <xsl:template mode="toc" match="v:group">
    <xsl:call-template name="v_group" />
  </xsl:template>

  <xsl:template mode="toc_app" match="v:group">
    <xsl:call-template name="v_group" />
  </xsl:template>

  <xsl:template name="v_group">
    <xsl:if test="boolean($html_format)">
      <xsl:copy-of select="." />
    </xsl:if>
  </xsl:template>

<!--
******************************************************************
*
* File: verbatim_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

   <xsl:template mode="doc" match="prdf:verbatim">
     <xsl:call-template name="prdf_verbatim" />
   </xsl:template>

   <xsl:template mode="doc_app" match="prdf:verbatim">
     <xsl:call-template name="prdf_verbatim" />
   </xsl:template>

   <xsl:template mode="toc" match="prdf:verbatim">
     <xsl:call-template name="prdf_verbatim" />
   </xsl:template>

   <xsl:template mode="toc_app" match="prdf:verbatim">
     <xsl:call-template name="prdf_verbatim" />
   </xsl:template>

   <xsl:template match="prdf:verbatim">
     <xsl:call-template name="prdf_verbatim" />
   </xsl:template>

  <xsl:template name="prdf_verbatim">
    <pre><xsl:value-of select="." /></pre>
  </xsl:template>

<!--
******************************************************************
*
* File: hierarchy_graphic_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:svg="http://www.w3.org/2000/svg" 
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:hierarchy_graphic">
    <xsl:call-template name="prdf_hierarchy_graphic" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:hierarchy_graphic">
    <xsl:call-template name="prdf_hierarchy_graphic" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:hierarchy_graphic">
    <xsl:call-template name="prdf_hierarchy_graphic" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:hierarchy_graphic">
    <xsl:call-template name="prdf_hierarchy_graphic" />
  </xsl:template>

  <xsl:template name="prdf_hierarchy_graphic">
    <xsl:if test="@kind">
      <hr/>
      <h4>
      <xsl:value-of select="@kind" />
      </h4>
    </xsl:if>
    <xsl:apply-templates mode="doc" />
  </xsl:template>

<!--
******************************************************************
*
* File: function_structure_diagram_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:function_structure_diagram">
    <xsl:call-template name="prdf_function_structure_diagram" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:function_structure_diagram">
    <xsl:call-template name="prdf_function_structure_diagram" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:function_structure_diagram">
    <xsl:call-template name="prdf_function_structure_diagram" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:function_structure_diagram">
    <xsl:call-template name="prdf_function_structure_diagram" />
  </xsl:template>

  <xsl:template name="prdf_function_structure_diagram">
    <hr/>
    <h4>function structure diagram</h4>
    <xsl:apply-templates mode="doc" />
  </xsl:template>

<!--
******************************************************************
*
* File: eoln_xhtml.xsl
*
* Written: C.Waddingham, 6-August-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:eoln">
    <xsl:call-template name="prdf_eoln" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:eoln">
    <xsl:call-template name="prdf_eoln" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:eoln">
    <xsl:call-template name="prdf_eoln" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:eoln">
    <xsl:call-template name="prdf_eoln" />
  </xsl:template>

  <xsl:template name="prdf_eoln">
    <br/>
  </xsl:template>

<!--
******************************************************************
*
* File: nbsp_xhtml.xsl
*
* Written: C.Waddingham, 26-November-2009
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:nbsp">
    <xsl:call-template name="prdf_nbsp" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:nbsp">
    <xsl:call-template name="prdf_nbsp" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:nbsp">
    <xsl:call-template name="prdf_nbsp" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:nbsp">
    <xsl:call-template name="prdf_nbsp" />
  </xsl:template>

  <xsl:template name="prdf_nbsp">
    &nbsp;
  </xsl:template>

<!--
******************************************************************
*
* Written: C.Waddingham, 27-July-2012
*
* Purpose: XSL Stylesheet included by prdf2html.xsl.
*
******************************************************************

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:prdf="http://www.programmingresearch.com/todo">
-->

  <xsl:template mode="doc" match="prdf:filelink">
    <xsl:call-template name="prdf_filelink" />
  </xsl:template>

  <xsl:template mode="doc_app" match="prdf:filelink">
    <xsl:call-template name="prdf_filelink" />
  </xsl:template>

  <xsl:template mode="toc" match="prdf:filelink">
    <xsl:call-template name="prdf_filelink" />
  </xsl:template>

  <xsl:template mode="toc_app" match="prdf:filelink">
    <xsl:call-template name="prdf_filelink" />
  </xsl:template>

  <xsl:template name="prdf_filelink">
    <a>
      <xsl:attribute name="href">
        <xsl:value-of select="@href" />
      </xsl:attribute>
      <xsl:apply-templates />
    </a>
  </xsl:template>

</xsl:stylesheet>

<!-- 
** eof prdf2html.xsl ******************************************
-->