<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <!-- Styles -->
  <xsl:template name="StyleBody">font-family:Arial;font-size:20pt;color:#494949;margin:0;background-color:#f3f3f3</xsl:template>
  <xsl:template name="StyleHeaderTitleNormal">font-family:Arial;font-size:25pt;color:#FFFFFF;</xsl:template>
  <xsl:template name="StyleHeaderDescription">font-family:Arial;font-size:12pt;color:#494949;</xsl:template>
  <xsl:template name="StyleHeaderDescriptionTop">font-family:Arial;font-size:12pt;color:#FFFFFF;</xsl:template>
  <xsl:template name="StyleHeaderInfo">font-family:Arial;font-size:10pt;color:#494949;padding-top:12pt;</xsl:template>
  <xsl:template name="StyleHeaderIconTableData">padding-right:20pt;padding-top:20pt;padding-bottom:20pt;</xsl:template>
  <xsl:template name="StyleRemarkContentTable">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="cellSpacing">0</xsl:attribute>
    <xsl:attribute name="cellPadding">0</xsl:attribute>
    <xsl:attribute name="border">0</xsl:attribute>
    <xsl:attribute name="style">width:100%;</xsl:attribute>
  </xsl:template>
  <xsl:template name="StyleRemarkContentCaption">font-family:Arial;font-size:12pt;padding-bottom:4pt;color:#494949;</xsl:template>
  <xsl:template name="StyleRemarkContentText">font-family:Arial;font-size:14pt;color:#494949;</xsl:template>
  <xsl:template name="StyleRemarkMessageContentText">font-family:Arial;font-size:14pt;color:#494949;</xsl:template>
  <xsl:template name="StyleRemarkContentFirstRowTable">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="cellSpacing">0</xsl:attribute>
    <xsl:attribute name="cellPadding">0</xsl:attribute>
    <xsl:attribute name="border">0</xsl:attribute>
  </xsl:template>
  <xsl:template name="StyleRemarkContentFirstRowTableRow">vertical-align:top;</xsl:template>
  <xsl:template name="StyleRemarkContentFirstRowTableThreeColumns">width:33%;</xsl:template>
  <xsl:template name="StyleRemarkContentFirstRowTableTwoColumns">width:50%;</xsl:template>
  <xsl:template name="StyleRemarkContentFirstRowTableOneColumn">width:100%;</xsl:template>
  <xsl:template name="StyleFooter">font-family:Arial;font-size:9pt;padding-top:5pt;padding-bottom:5pt;color:#aaaaaa;text-align:center;line-height:12pt;</xsl:template>
  <xsl:template name="StyleFooterAnchor">color:#aaaaaa;text-decoration:none;</xsl:template>
  <xsl:template name="StyleFooterApplication">padding-left:5pt;padding-right:5pt;</xsl:template>
  <xsl:template name="StyleFooterCopyright">padding-left:5pt;padding-right:5pt;</xsl:template>
  <xsl:template name="StyleFooterRegisteredName">padding-left:5pt;padding-right:5pt;</xsl:template>
  <xsl:template name="StyleFooterTableColumn">padding-top:5pt;padding-bottom:20pt;</xsl:template>

  <xsl:template name="BackgroundColorWarning">#dbb000</xsl:template>
  <xsl:template name="IconWarning">img/Warning.png</xsl:template>
  <xsl:template name="BackgroundColorUpdate">#ff954f</xsl:template>
  <xsl:template name="IconUpdate">img/Update.png</xsl:template>

  <xsl:template name="getColorForContentType">
    <xsl:param name="ContentType" />
    <xsl:choose>
      <xsl:when test="$ContentType = 'default'">#4798d8</xsl:when>
      <xsl:when test="$ContentType = 'information'">#4798d8</xsl:when>
      <xsl:when test="$ContentType = 'incident'">#ff6b6b</xsl:when>
      <xsl:when test="$ContentType = 'change'">#008080</xsl:when>
      <xsl:when test="$ContentType = 'alarm'">#a82920</xsl:when>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="getIconForContentType">
    <xsl:param name="ContentType" />
    <xsl:choose>
      <xsl:when test="$ContentType = 'default'">img/Information.png</xsl:when>
      <xsl:when test="$ContentType = 'information'">img/Information.png</xsl:when>
      <xsl:when test="$ContentType = 'incident'">img/Blocked.png</xsl:when>
      <xsl:when test="$ContentType = 'change'">img/Change.png</xsl:when>
      <xsl:when test="$ContentType = 'alarm'">img/Alarm.png</xsl:when>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="getColorForResolveContentType">
    <xsl:param name="ContentType" />
    <xsl:choose>
      <xsl:when test="$ContentType = 'default'">#37c870</xsl:when>
      <xsl:when test="$ContentType = 'cancellation'">#b23588</xsl:when>
    </xsl:choose>
  </xsl:template>

  <xsl:template name="getIconForResolveContentType">
    <xsl:param name="ContentType" />
    <xsl:choose>
      <xsl:when test="$ContentType = 'default'">img/Resolve.png</xsl:when>
      <xsl:when test="$ContentType = 'cancellation'">img/Cancellation.png</xsl:when>
    </xsl:choose>
  </xsl:template>

  <!-- Horizontales Padding -->
  <xsl:template name="WidthHorizontalPadding">20</xsl:template>

  <xsl:template name="HeadAndStyles">
    <head>
      <meta content="text/html;charset=UTF-8" http-equiv="Content-Type" />
      <title>IBI-aws</title>
    </head>
  </xsl:template>

  <xsl:template name="AttributesFrameOuterTable">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="align">center</xsl:attribute>
    <xsl:attribute name="cellSpacing">0</xsl:attribute>
    <xsl:attribute name="cellPadding">0</xsl:attribute>
    <xsl:attribute name="border">0</xsl:attribute>
  </xsl:template>

  <xsl:template name="AttributesFrameOuterTableColumn">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="style">background-color:rgb(243, 243, 243);padding-top:20pt;padding-right:20pt;padding-left:20pt;</xsl:attribute>
    <xsl:attribute name="bgColor">#f3f3f3</xsl:attribute>
  </xsl:template>

  <xsl:template name="AttributesFrameInnerTable">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="align">center</xsl:attribute>
    <xsl:attribute name="bgColor">#ffffff</xsl:attribute>
    <xsl:attribute name="border">0</xsl:attribute>
    <xsl:attribute name="cellSpacing">0</xsl:attribute>
    <xsl:attribute name="cellPadding">0</xsl:attribute>
    <xsl:attribute name="style">border: 1pt solid #cccccc; max-width: 750pt;border-collapse:collapse;</xsl:attribute>
  </xsl:template>

  <xsl:template name="AttributesFrameInnerTableColumn">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="style">background-color: rgb(255, 255, 255);</xsl:attribute>
    <xsl:attribute name="bgColor">#ffffff</xsl:attribute>
  </xsl:template>

  <xsl:template name="HeaderTable">
    <xsl:attribute name="border">0</xsl:attribute>
    <xsl:attribute name="cellSpacing">0</xsl:attribute>
    <xsl:attribute name="cellPadding">0</xsl:attribute>    
    <xsl:attribute name="style">width:100%;</xsl:attribute>
  </xsl:template>

  <xsl:template name="AttributesHeaderColumn">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="style">padding-right:20pt;padding-left:20pt;padding-top:20pt;padding-bottom:20pt;</xsl:attribute>
  </xsl:template>

  <xsl:template name="AttributesContentColumn">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="style">padding-right:20pt;padding-left:20pt;padding-top:20pt;</xsl:attribute>
  </xsl:template>

  <xsl:template name="AttributesContentColumnWithSubtitle">
    <xsl:attribute name="width">100%</xsl:attribute>
    <xsl:attribute name="style">padding-right:20pt;padding-left:20pt;padding-top:15pt;</xsl:attribute>
  </xsl:template>

  <xsl:template name="Outlook2019EndOfLineFix">
    <br />
    <xsl:value-of disable-output-escaping="yes" select="string(' ')" />
  </xsl:template>

  <xsl:template name="Footer">
    <div>

      <xsl:attribute name="style">
        <xsl:call-template name="StyleFooter" />
      </xsl:attribute>

      <span>

        <xsl:attribute name="style">
          <xsl:call-template name="StyleFooterApplication" />
        </xsl:attribute>

        <a href="https://www.ibi-aws.net" target="_blank">
          <xsl:attribute name="style">
            <xsl:call-template name="StyleFooterAnchor" />
          </xsl:attribute> IBI-aws Admin </a>
        <xsl:value-of select="appVersion" />
      </span> - <span>
        <xsl:attribute name="style">
          <xsl:call-template name="StyleFooterCopyright" />
        </xsl:attribute> © <a
          href="https://www.ibitech.com" target="_blank">
          <xsl:attribute name="style">
            <xsl:call-template name="StyleFooterAnchor" />
          </xsl:attribute> IBITECH AG </a>
      </span>
      <br />
      <span>

        <xsl:attribute name="style">
          <xsl:call-template name="StyleFooterRegisteredName" />
        </xsl:attribute>

        <xsl:value-of select="registeredName" />
      </span>
    </div>
    <input>
      <xsl:attribute name="type">hidden</xsl:attribute>
      <xsl:attribute name="name">language</xsl:attribute>
      <xsl:attribute name="value">default</xsl:attribute>
    </input>
  </xsl:template>

  <xsl:template match="General">

    <!-- Allgemeiner Hinweis -->

    <html>

      <xsl:call-template name="HeadAndStyles" />

      <body>

        <xsl:attribute name="style">
          <xsl:call-template name="StyleBody" />
        </xsl:attribute>

        <table>

          <xsl:call-template name="AttributesFrameOuterTable" />

            <tr>
              <td>

                <xsl:call-template name="AttributesFrameOuterTableColumn" />

                <table>

                  <xsl:call-template name="AttributesFrameInnerTable" />

                    <tr>
                      <td>

                        <xsl:call-template name="AttributesFrameInnerTableColumn" />

                        <!-- Header -->

                        <table>

                            <xsl:call-template name="HeaderTable" />

                            <xsl:attribute name="bgColor">
                                <xsl:call-template name="getColorForContentType">
                                  <xsl:with-param name="ContentType" select="remark/contenttype" />
                                </xsl:call-template>
                            </xsl:attribute>

                            <tr>
                              <td>
                                <xsl:call-template name="AttributesHeaderColumn" />

                                <!-- Grund -->

                                <div>
                                  <xsl:attribute name="style">
                                    <xsl:call-template name="StyleHeaderTitleNormal" />
                                  </xsl:attribute>

                                  <xsl:attribute name="data-accessibility-id">remarkReason</xsl:attribute>

                                  <xsl:value-of select="remark/reason" disable-output-escaping="yes" />
                                </div>

                              </td>

                              <td>
                                <xsl:attribute name="style">
                                  <xsl:call-template name="StyleHeaderIconTableData" />
                                </xsl:attribute>

                                <!-- Icon -->

                                <img width="100" height="100" align="right">
                                  <xsl:attribute name="src">
                                    <xsl:call-template name="getIconForContentType">
                                      <xsl:with-param name="ContentType" select="remark/contenttype" />
                                    </xsl:call-template>
                                  </xsl:attribute>
                                </img>
                              </td>
                            </tr>

                        </table>

                        <!-- Inhalt -->

                        <table>

                            <xsl:call-template name="StyleRemarkContentTable" />

                            <xsl:choose>
                              <xsl:when test="remark/start or remark/end">
                                <tr>
                                  <td>

                                    <xsl:call-template name="AttributesContentColumn" />

                                    <div>
                                      <table>

                                        <xsl:call-template name="StyleRemarkContentFirstRowTable" />

                                          <tr>

                                            <xsl:attribute name="style">
                                              <xsl:call-template name="StyleRemarkContentFirstRowTableRow" />
                                            </xsl:attribute>

                                            <td>

                                              <xsl:attribute name="style">
                                                <xsl:call-template name="StyleRemarkContentFirstRowTableOneColumn" />
                                              </xsl:attribute>

                                              <!-- Zeitraum -->

                                              <xsl:choose>
                                                <xsl:when test="remark/start and remark/end">

                                                  <div>
                                                    <xsl:attribute name="style">
                                                      <xsl:call-template name="StyleRemarkContentCaption" />
                                                    </xsl:attribute>

                                                    <xsl:call-template name="Common_Period_Caption" />
                                                  </div>

                                                  <div>
                                                    <xsl:attribute name="style">
                                                      <xsl:call-template name="StyleRemarkContentText" />
                                                    </xsl:attribute>

                                                    <xsl:value-of
                                                      select="remark/start" /> - <xsl:value-of
                                                      select="remark/end" />
                                                  </div>
                                                </xsl:when>
                                                <xsl:when test="remark/start">
                                                  <div>

                                                    <xsl:attribute name="style">
                                                      <xsl:call-template name="StyleRemarkContentCaption" />
                                                    </xsl:attribute>

                                                    <xsl:call-template name="Common_Period_Caption_StartTimeOnly" />
                                                  </div>
                                                  <div>

                                                    <xsl:attribute name="style">
                                                      <xsl:call-template name="StyleRemarkContentText" />
                                                    </xsl:attribute>

                                                    <xsl:value-of select="remark/start" />
                                                  </div>
                                                </xsl:when>
                                                <xsl:when test="remark/end">
                                                  <div>

                                                    <xsl:attribute name="style">
                                                      <xsl:call-template name="StyleRemarkContentCaption" />
                                                    </xsl:attribute>

                                                    <xsl:call-template name="Common_Period_Caption_EndTimeOnly" />
                                                  </div>
                                                  <div>

                                                    <xsl:attribute name="style">
                                                      <xsl:call-template name="StyleRemarkContentText" />
                                                    </xsl:attribute>

                                                    <xsl:value-of select="remark/end" />
                                                  </div>
                                                </xsl:when>
                                              </xsl:choose>
                                            </td>

                                          </tr>

                                      </table>
                                    </div>
                                 </td>
                                </tr>
                              </xsl:when>
                            </xsl:choose>

                            <tr>

                              <td>

                                <xsl:call-template name="AttributesContentColumn" />

                                <div>
                                  <xsl:attribute name="style">
                                    <xsl:call-template name="StyleRemarkMessageContentText" />
                                  </xsl:attribute>

                                  <xsl:attribute name="data-accessibility-id">remarkMessage</xsl:attribute>

                                  <xsl:value-of select="remark/message" disable-output-escaping="yes" />

                                  <xsl:call-template name="Outlook2019EndOfLineFix" />

                                </div>
                              </td>

                            </tr>

                            <tr>
                              <td>
                                <xsl:call-template name="AttributesContentColumn" />
                              </td>
                            </tr>

                        </table>

                      </td>
                    </tr>

                </table>

              </td>
            </tr>
            <tr>
              <td>
                <xsl:attribute name="style">
                  <xsl:call-template name="StyleFooterTableColumn" />
                </xsl:attribute>

                <xsl:call-template name="Footer" />
              </td>
            </tr>

        </table>

      </body>

    </html>

  </xsl:template>

  <xsl:template match="GeneralWarning">

    <!-- Allgemeiner Hinweis - Vorwarnung -->

    <html>

      <xsl:call-template name="HeadAndStyles" />

      <body>

        <xsl:attribute name="style">
          <xsl:call-template name="StyleBody" />
        </xsl:attribute>

        <table>

          <xsl:call-template name="AttributesFrameOuterTable" />

          <tr>
            <td>

              <xsl:call-template name="AttributesFrameOuterTableColumn" />

              <table>

                <xsl:call-template name="AttributesFrameInnerTable" />

                <tr>
                  <td>

                    <xsl:call-template name="AttributesFrameInnerTableColumn" />

                    <!-- Header -->

                    <table>

                        <xsl:call-template name="HeaderTable" />

                        <xsl:attribute name="bgColor">
                          <xsl:call-template name="BackgroundColorWarning" />
                        </xsl:attribute>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesHeaderColumn" />

                            <!-- Grund -->

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleHeaderTitleNormal" />
                              </xsl:attribute>

                              <xsl:attribute name="data-accessibility-id">remarkReason</xsl:attribute>

                              <xsl:value-of select="remark/reason" disable-output-escaping="yes" />
                            </div>

                          </td>

                          <td>
                            <xsl:attribute name="style">
                              <xsl:call-template name="StyleHeaderIconTableData" />
                            </xsl:attribute>

                            <!-- Icon -->

                            <img width="100" height="100" align="right">
                              <xsl:attribute name="src">
                                <xsl:call-template name="IconWarning" />
                              </xsl:attribute>
                            </img>
                          </td>
                        </tr>

                    </table>

                    <!-- Inhalt -->

                    <table>

                      <xsl:call-template name="StyleRemarkContentTable" />

                        <xsl:choose>
                          <xsl:when test="remark/start or remark/end">
                            <tr>
                              <td>

                                <xsl:call-template name="AttributesContentColumn" />

                                <div>
                                  <table>

                                    <xsl:call-template name="StyleRemarkContentFirstRowTable" />

                                      <tr>

                                        <xsl:attribute name="style">
                                          <xsl:call-template name="StyleRemarkContentFirstRowTableRow" />
                                        </xsl:attribute>

                                        <td>

                                          <xsl:attribute name="style">
                                            <xsl:call-template name="StyleRemarkContentFirstRowTableOneColumn" />
                                          </xsl:attribute>

                                          <!-- Zeitraum -->

                                          <xsl:choose>
                                            <xsl:when test="remark/start and remark/end">

                                              <div>
                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption" />
                                              </div>

                                              <div>
                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of
                                                  select="remark/start" /> - <xsl:value-of
                                                  select="remark/end" />
                                              </div>
                                            </xsl:when>
                                            <xsl:when test="remark/start">
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption_StartTimeOnly" />
                                              </div>
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of select="remark/start" />
                                              </div>
                                            </xsl:when>
                                            <xsl:when test="remark/end">
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption_EndTimeOnly" />
                                              </div>
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of select="remark/end" />
                                              </div>
                                            </xsl:when>
                                          </xsl:choose>
                                        </td>

                                      </tr>

                                  </table>

                                </div>

                              </td>

                            </tr>
                          </xsl:when>
                        </xsl:choose>

                        <tr>

                          <td>

                            <xsl:call-template name="AttributesContentColumn" />

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleRemarkMessageContentText" />
                              </xsl:attribute>

                              <xsl:attribute name="data-accessibility-id">remarkMessage</xsl:attribute>

                              <xsl:value-of select="remark/message" disable-output-escaping="yes" />

                              <xsl:call-template name="Outlook2019EndOfLineFix" />

                            </div>
                          </td>

                        </tr>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesContentColumn" />
                          </td>
                        </tr>

                    </table>

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

            </td>
          </tr>
          <tr>
            <td>
              <xsl:attribute name="style">
                <xsl:call-template name="StyleFooterTableColumn" />
              </xsl:attribute>

              <xsl:call-template name="Footer" />
            </td>
          </tr>
        </table>

      </body>

    </html>

  </xsl:template>

  <xsl:template match="GeneralUpdate" name="GeneralUpdate">

    <!-- Allgemeiner Hinweis - Statusmeldung -->

    <html>

      <xsl:call-template name="HeadAndStyles" />

      <body>

        <xsl:attribute name="style">
          <xsl:call-template name="StyleBody" />
        </xsl:attribute>

        <table>

          <xsl:call-template name="AttributesFrameOuterTable" />

          <tr>
            <td>

              <xsl:call-template name="AttributesFrameOuterTableColumn" />

              <table>

                <xsl:call-template name="AttributesFrameInnerTable" />

                <tr>
                  <td>

                    <xsl:call-template name="AttributesFrameInnerTableColumn" />

                    <!-- Header -->

                    <table>

                        <xsl:call-template name="HeaderTable" />

                        <xsl:attribute name="bgColor">
                          <xsl:call-template name="BackgroundColorUpdate" />
                        </xsl:attribute>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesHeaderColumn" />

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleHeaderDescriptionTop" />
                              </xsl:attribute>
                              <xsl:attribute name="data-accessibility-id">remarkReason</xsl:attribute>
                              <xsl:value-of select="remark/reason" disable-output-escaping="yes" />
                            </div>

                            <!-- Grund -->

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleHeaderTitleNormal" />
                              </xsl:attribute>

                              <xsl:call-template name="Common_Update_Title" />
                            </div>
                          </td>

                          <td>
                            <xsl:attribute name="style">
                              <xsl:call-template name="StyleHeaderIconTableData" />
                            </xsl:attribute>

                            <!-- Icon -->

                            <img width="100" height="100" align="right">
                              <xsl:attribute name="src">
                                <xsl:call-template name="IconUpdate" />
                              </xsl:attribute>
                            </img>
                          </td>
                        </tr>

                    </table>

                    <!-- Inhalt -->

                    <table>

                      <xsl:call-template name="StyleRemarkContentTable" />

                        <tr>
                          <td>

                            <xsl:call-template name="AttributesContentColumn" />

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleRemarkMessageContentText" />
                              </xsl:attribute>

                              <xsl:attribute name="data-accessibility-id">remarkMessage</xsl:attribute>

                              <xsl:value-of select="remark/message" disable-output-escaping="yes" />

                              <xsl:call-template name="Outlook2019EndOfLineFix" />

                            </div>
                          </td>

                        </tr>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesContentColumn" />
                          </td>
                        </tr>

                    </table>

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

            </td>
          </tr>
          <tr>
            <td>
              <xsl:attribute name="style">
                <xsl:call-template name="StyleFooterTableColumn" />
              </xsl:attribute>

              <xsl:call-template name="Footer" />
            </td>
          </tr>
        </table>

      </body>

    </html>

  </xsl:template>

  <xsl:template match="GeneralResolve" name="GeneralResolve">

    <!-- Allgemeiner Hinweis - Abschlussmeldung -->

    <html>

      <xsl:call-template name="HeadAndStyles" />

      <body>

        <xsl:attribute name="style">
          <xsl:call-template name="StyleBody" />
        </xsl:attribute>

        <table>

          <xsl:call-template name="AttributesFrameOuterTable" />

          <tr>
            <td>

              <xsl:call-template name="AttributesFrameOuterTableColumn" />

              <table>

                <xsl:call-template name="AttributesFrameInnerTable" />

                <tr>
                  <td>

                    <xsl:call-template name="AttributesFrameInnerTableColumn" />

                    <!-- Header -->

                    <table>

                        <xsl:call-template name="HeaderTable" />

                        <xsl:attribute name="bgColor">
                          <xsl:call-template name="getColorForResolveContentType">
                            <xsl:with-param name="ContentType" select="remark/contenttype" />
                          </xsl:call-template>
                        </xsl:attribute>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesHeaderColumn" />

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleHeaderDescriptionTop" />
                              </xsl:attribute>
                              <xsl:attribute name="data-accessibility-id">remarkReason</xsl:attribute>
                              <xsl:value-of select="remark/reason" disable-output-escaping="yes" />
                            </div>

                            <!-- Grund -->

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleHeaderTitleNormal" />
                              </xsl:attribute>


                              <xsl:choose>
                                <xsl:when test="remark/contenttype = 'cancellation'">

                                  <xsl:call-template name="Common_Cancellation_Title" />

                                </xsl:when>
                                <xsl:otherwise>

                                  <xsl:call-template name="Common_Resolve_Title" />

                                </xsl:otherwise>
                              </xsl:choose>
                            </div>
                          </td>

                          <td>
                            <xsl:attribute name="style">
                              <xsl:call-template name="StyleHeaderIconTableData" />
                            </xsl:attribute>

                            <!-- Icon -->

                            <img width="100" height="100" align="right">
                              <xsl:attribute name="src">
                                <xsl:call-template name="getIconForResolveContentType">
                                  <xsl:with-param name="ContentType" select="remark/contenttype" />
                                </xsl:call-template>
                              </xsl:attribute>
                            </img>
                          </td>
                        </tr>

                    </table>

                    <!-- Inhalt -->

                    <table>

                        <xsl:call-template name="StyleRemarkContentTable" />

                        <tr>
                          <td>

                            <xsl:call-template name="AttributesContentColumn" />

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleHeaderDescription" />
                              </xsl:attribute>

                              <xsl:choose>
                                <xsl:when test="remark/contenttype = 'cancellation'">

                                  <xsl:call-template name="Common_Cancellation_Info" />

                                </xsl:when>
                                <xsl:otherwise>

                                  <xsl:call-template name="Common_Resolve_Info" />

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

                          </td>

                        </tr>

                        <tr>
                          <td>

                            <xsl:call-template name="AttributesContentColumnWithSubtitle" />

                            <xsl:choose>
                              <xsl:when test="remark/message != ''">

                                <div>
                                  <xsl:attribute name="style">
                                    <xsl:call-template name="StyleRemarkMessageContentText" />
                                  </xsl:attribute>

                                  <xsl:attribute name="data-accessibility-id">remarkMessage</xsl:attribute>

                                  <xsl:value-of select="remark/message" disable-output-escaping="yes" />

                                  <xsl:call-template name="Outlook2019EndOfLineFix" />

                                </div>

                              </xsl:when>
                            </xsl:choose>
                          </td>

                        </tr>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesContentColumn" />
                          </td>
                        </tr>

                    </table>

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

            </td>
          </tr>
          <tr>
            <td>
              <xsl:attribute name="style">
                <xsl:call-template name="StyleFooterTableColumn" />
              </xsl:attribute>

              <xsl:call-template name="Footer" />
            </td>
          </tr>
        </table>

      </body>

    </html>

  </xsl:template>

  <xsl:template match="ApplicationSpecific">

    <!-- Anwendungsspezifischer Hinweis -->

    <html>

      <xsl:call-template name="HeadAndStyles" />

      <body>

        <xsl:attribute name="style">
          <xsl:call-template name="StyleBody" />
        </xsl:attribute>

        <table>

          <xsl:call-template name="AttributesFrameOuterTable" />

          <tr>
            <td>

              <xsl:call-template name="AttributesFrameOuterTableColumn" />

              <table>

                <xsl:call-template name="AttributesFrameInnerTable" />

                <tr>
                  <td>

                    <xsl:call-template name="AttributesFrameInnerTableColumn" />

                    <!-- Header -->

                    <table>

                        <xsl:call-template name="HeaderTable" />

                        <xsl:attribute name="bgColor">
                          <xsl:call-template name="getColorForContentType">
                            <xsl:with-param name="ContentType" select="remark/contenttype" />
                          </xsl:call-template>
                        </xsl:attribute>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesHeaderColumn" />

                            <!-- Grund -->

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleHeaderTitleNormal" />
                              </xsl:attribute>

                              <xsl:attribute name="data-accessibility-id">remarkReason</xsl:attribute>

                              <xsl:value-of select="remark/reason" disable-output-escaping="yes" />
                            </div>

                          </td>

                          <td>
                            <xsl:attribute name="style">
                              <xsl:call-template name="StyleHeaderIconTableData" />
                            </xsl:attribute>

                            <img width="100" height="100" align="right">
                              <xsl:attribute name="src">
                                <xsl:call-template name="getIconForContentType">
                                  <xsl:with-param name="ContentType" select="remark/contenttype" />
                                </xsl:call-template>
                              </xsl:attribute>
                            </img>
                          </td>
                        </tr>

                    </table>

                    <!-- Inhalt -->

                    <table>

                      <xsl:call-template name="StyleRemarkContentTable" />


                        <xsl:choose>
                          <xsl:when test="remark/start or remark/end">
                            <tr>
                              <td>

                                <xsl:call-template name="AttributesContentColumn" />

                                <div>

                                  <table>

                                    <xsl:call-template name="StyleRemarkContentFirstRowTable" />


                                      <tr>

                                        <xsl:attribute name="style">
                                          <xsl:call-template name="StyleRemarkContentFirstRowTableRow" />
                                        </xsl:attribute>

                                        <td>

                                          <xsl:attribute name="style">
                                            <xsl:call-template name="StyleRemarkContentFirstRowTableOneColumn" />
                                          </xsl:attribute>

                                          <!-- Zeitraum -->

                                          <xsl:choose>
                                            <xsl:when test="remark/start and remark/end">

                                              <div>
                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption" />
                                              </div>

                                              <div>
                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of
                                                  select="remark/start" /> - <xsl:value-of
                                                  select="remark/end" />
                                              </div>
                                            </xsl:when>
                                            <xsl:when test="remark/start">
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption_StartTimeOnly" />
                                              </div>
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of select="remark/start" />
                                              </div>
                                            </xsl:when>
                                            <xsl:when test="remark/end">
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption_EndTimeOnly" />
                                              </div>
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of select="remark/end" />
                                              </div>
                                            </xsl:when>
                                          </xsl:choose>
                                        </td>

                                      </tr>

                                  </table>

                                </div>

                              </td>

                            </tr>
                          </xsl:when>
                        </xsl:choose>

                        <tr>
                          <td>

                            <xsl:call-template name="AttributesContentColumn" />

                            <div>

                              <table>

                                  <xsl:call-template name="StyleRemarkContentFirstRowTable" />

                                  <tr>

                                    <xsl:attribute name="style">
                                      <xsl:call-template name="StyleRemarkContentFirstRowTableRow" />
                                    </xsl:attribute>

                                    <td>

                                      <xsl:attribute name="style">
                                        <xsl:call-template name="StyleRemarkContentFirstRowTableOneColumn" />
                                      </xsl:attribute>

                                      <!-- Betroffene Anwendungen -->

                                      <div>
                                        <xsl:attribute name="style">
                                          <xsl:call-template name="StyleRemarkContentCaption" />
                                        </xsl:attribute>

                                        <xsl:call-template name="Common_Caption_Applications" />
                                      </div>

                                      <div>
                                        <xsl:attribute name="style">
                                          <xsl:call-template name="StyleRemarkContentText" />
                                        </xsl:attribute>

                                        <xsl:value-of select="remark/applications" />
                                      </div>

                                    </td>

                                  </tr>

                              </table>

                            </div>

                          </td>

                        </tr>

                        <tr>

                          <td>

                            <xsl:call-template name="AttributesContentColumn" />

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleRemarkMessageContentText" />
                              </xsl:attribute>

                              <xsl:attribute name="data-accessibility-id">remarkMessage</xsl:attribute>

                              <xsl:value-of select="remark/message" disable-output-escaping="yes" />

                              <xsl:call-template name="Outlook2019EndOfLineFix" />

                            </div>
                          </td>

                        </tr>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesContentColumn" />
                          </td>
                        </tr>

                    </table>

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

            </td>
          </tr>
          <tr>
            <td>
              <xsl:attribute name="style">
                <xsl:call-template name="StyleFooterTableColumn" />
              </xsl:attribute>

              <xsl:call-template name="Footer" />
            </td>
          </tr>
        </table>

      </body>

    </html>

  </xsl:template>

  <xsl:template match="ApplicationSpecificWarning">

    <!-- Anwendungsspezifischer Hinweis - Vorwarnung -->

    <html>

      <xsl:call-template name="HeadAndStyles" />

      <body>

        <xsl:attribute name="style">
          <xsl:call-template name="StyleBody" />
        </xsl:attribute>

        <table>

          <xsl:call-template name="AttributesFrameOuterTable" />

          <tr>
            <td>

              <xsl:call-template name="AttributesFrameOuterTableColumn" />

              <table>

                <xsl:call-template name="AttributesFrameInnerTable" />

                <tr>
                  <td>

                    <xsl:call-template name="AttributesFrameInnerTableColumn" />

                    <!-- Header -->

                    <table>

                        <xsl:call-template name="HeaderTable" />

                        <xsl:attribute name="bgColor">
                          <xsl:call-template name="BackgroundColorWarning" />
                        </xsl:attribute>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesHeaderColumn" />

                            <!-- Grund -->

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleHeaderTitleNormal" />
                              </xsl:attribute>

                              <xsl:attribute name="data-accessibility-id">remarkReason</xsl:attribute>

                              <xsl:value-of select="remark/reason" disable-output-escaping="yes" />
                            </div>

                          </td>

                          <td>
                            <xsl:attribute name="style">
                              <xsl:call-template name="StyleHeaderIconTableData" />
                            </xsl:attribute>

                            <!-- Icon -->

                            <img width="100" height="100" align="right">
                              <xsl:attribute name="src">
                                <xsl:call-template name="IconWarning" />
                              </xsl:attribute>
                            </img>
                          </td>
                        </tr>

                    </table>

                    <!-- Inhalt -->

                    <table>

                        <xsl:call-template name="StyleRemarkContentTable" />

                        <xsl:choose>
                          <xsl:when test="remark/start or remark/end">
                            <tr>
                              <td>

                                <xsl:call-template name="AttributesContentColumn" />

                                <div>

                                  <table>

                                    <xsl:call-template name="StyleRemarkContentFirstRowTable" />

                                      <tr>

                                        <xsl:attribute name="style">
                                          <xsl:call-template name="StyleRemarkContentFirstRowTableRow" />
                                        </xsl:attribute>

                                        <td>

                                          <xsl:attribute name="style">
                                            <xsl:call-template name="StyleRemarkContentFirstRowTableOneColumn" />
                                          </xsl:attribute>

                                          <!-- Zeitraum -->

                                          <xsl:choose>
                                            <xsl:when test="remark/start and remark/end">

                                              <div>
                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption" />
                                              </div>

                                              <div>
                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of
                                                  select="remark/start" /> - <xsl:value-of
                                                  select="remark/end" />
                                              </div>
                                            </xsl:when>
                                            <xsl:when test="remark/start">
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption_StartTimeOnly" />
                                              </div>
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of select="remark/start" />
                                              </div>
                                            </xsl:when>
                                            <xsl:when test="remark/end">
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentCaption" />
                                                </xsl:attribute>

                                                <xsl:call-template name="Common_Period_Caption_EndTimeOnly" />
                                              </div>
                                              <div>

                                                <xsl:attribute name="style">
                                                  <xsl:call-template name="StyleRemarkContentText" />
                                                </xsl:attribute>

                                                <xsl:value-of select="remark/end" />
                                              </div>
                                            </xsl:when>
                                          </xsl:choose>
                                        </td>

                                      </tr>

                                  </table>

                                </div>

                              </td>

                            </tr>
                          </xsl:when>
                        </xsl:choose>

                        <tr>
                          <td>

                            <xsl:call-template name="AttributesContentColumn" />

                            <div>

                              <table>

                                <xsl:call-template name="StyleRemarkContentFirstRowTable" />


                                  <tr>

                                    <xsl:attribute name="style">
                                      <xsl:call-template name="StyleRemarkContentFirstRowTableRow" />
                                    </xsl:attribute>

                                    <td>

                                      <xsl:attribute name="style">
                                        <xsl:call-template name="StyleRemarkContentFirstRowTableOneColumn" />
                                      </xsl:attribute>

                                      <!-- Betroffene Anwendungen -->

                                      <div>
                                        <xsl:attribute name="style">
                                          <xsl:call-template name="StyleRemarkContentCaption" />
                                        </xsl:attribute>

                                        <xsl:call-template name="Common_Caption_Applications" />
                                      </div>

                                      <div>
                                        <xsl:attribute name="style">
                                          <xsl:call-template name="StyleRemarkContentText" />
                                        </xsl:attribute>

                                        <xsl:value-of select="remark/applications" />
                                      </div>

                                    </td>

                                  </tr>

                              </table>

                            </div>

                          </td>

                        </tr>

                        <tr>

                          <td>

                            <xsl:call-template name="AttributesContentColumn" />

                            <div>
                              <xsl:attribute name="style">
                                <xsl:call-template name="StyleRemarkMessageContentText" />
                              </xsl:attribute>

                              <xsl:attribute name="data-accessibility-id">remarkMessage</xsl:attribute>

                              <xsl:value-of select="remark/message" disable-output-escaping="yes" />

                              <xsl:call-template name="Outlook2019EndOfLineFix" />

                            </div>
                          </td>

                        </tr>

                        <tr>
                          <td>
                            <xsl:call-template name="AttributesContentColumn" />
                          </td>
                        </tr>

                    </table>

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

            </td>
          </tr>
          <tr>
            <td>
              <xsl:attribute name="style">
                <xsl:call-template name="StyleFooterTableColumn" />
              </xsl:attribute>

              <xsl:call-template name="Footer" />
            </td>
          </tr>
        </table>

      </body>

    </html>

  </xsl:template>

  <xsl:template match="ApplicationSpecificUpdate">

    <!-- Anwendungsspezifischer Hinweis - Statusmeldung -->
    <xsl:call-template name="GeneralUpdate" />

  </xsl:template>

  <xsl:template match="ApplicationSpecificResolve">

    <!-- Anwendungsspezifischer Hinweis - Abschlussmeldung -->
    <xsl:call-template name="GeneralResolve" />

  </xsl:template>

</xsl:stylesheet>