<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="4.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:fn="http://www.w3.org/2005/xpath-functions"
  xmlns:map="http://www.w3.org/2005/xpath-functions/map"
  xmlns:math="http://www.w3.org/2005/xpath-functions/math"
  xmlns:array="http://www.w3.org/2005/xpath-functions/array"
  xmlns:tm="http://www.datenverdrahten.de/tm"
  xmlns:ex="http://example.org/ex"
  xmlns="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="#all"
  expand-text="yes"
  extension-element-prefixes="ex">

  <!-- by T. Meinike 11/22 -->

  <xsl:output method="xml" version="1.0" html-version="5" encoding="UTF-8"
    indent="yes" include-content-type="no" omit-xml-declaration="yes"/>

  <xsl:template name="xsl:initial-template">

    <xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html>&#xA;</xsl:text>
    <html lang="de">
      <head>
        <meta charset="UTF-8"/>
        <title>Extension instructions</title>
        <style>
          * {{ font-family: sans-serif; }}
          p {{ font-weight: bold; color: #090; background-color: #FFF; margin-bottom: 1.5em; }}
          h2 {{ color: #F00; }}
        </style>
      </head>
      <body>
        <h1>Erweiterung benannter Templates</h1>

        <p>Text <ex:plus p="3"/> Text <ex:plus p="4"/> Text <ex:plus p="5"/> Text</p>
        <!-- Text +++ Text ++++ Text +++++ Text -->

        <h2><ex:plus p="3"/> Eilmeldung <ex:plus p="3"/> XSLT 4.0 in Sicht! <ex:plus p="3"/></h2>
      </body>
    </html>

  </xsl:template>

  <xsl:template name="ex:plus">
    <xsl:param name="p" as="xs:integer"/>
    <xsl:value-of select="fn:string-join((1 to $p) ! '+')"/>
  </xsl:template>

</xsl:stylesheet>