<?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="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="#all"
  expand-text="yes">

  <!-- 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>Enum Type</title>
        <style>* {{ font-family: sans-serif; }}</style>
      </head>
      <body>
        <h1>Enum Type</h1>

        <xsl:variable name="tech" select="'SVG'" as="xs:string"/>
       
        <p>Technologie-Skills von {$tech} sind 
          <xsl:choose>
            <xsl:when test="$tech instance of enum('CSS', 'HTML', 'JS', 'MathML', 'SVG', 'XML', 'XPath', 'XSLT')" select="'vorhanden'"/>
            <xsl:otherwise select="'nicht vorhanden'"/>
          </xsl:choose>.
        </p> <!-- vorhanden -->

        <p>Kommt C vor? {tm:enum_test("C")}</p> <!-- ja -->
        <p>Kommt X vor? {tm:enum_test("X")}</p> <!-- nein -->
      </body>
    </html>

  </xsl:template>

  <xsl:function name="tm:enum_test" as="xs:string">
    <xsl:param name="s" as="xs:string"/>
    <xsl:if test="$s instance of enum('A', 'B', 'C', 'D')" then="'ja'" else="'nein'"/>
  </xsl:function>

</xsl:stylesheet>