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

  <!-- xsl:function-library wird von Saxon-EE 11.4 noch nicht unterstützt. -->

  <xsl:function-library>
    <xsl:function-namespace prefix="fn" uri="http://www.w3.org/2005/xpath-functions"/> <!-- exclude(fnmane)" möglich, z. B exclude="count" -->
    <xsl:function-namespace prefix="math" uri="http://www.w3.org/2005/xpath-functions/math"/> <!-- exclude="sin cos" -->
    <xsl:function-namespace prefix="map" uri="http://www.w3.org/2005/xpath-functions/map"/>
    <xsl:function-namespace prefix="array" uri="http://www.w3.org/2005/xpath-functions/array"/>
    <xsl:function-namespace prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
    <xsl:function-namespace prefix="tm" uri="http://www.datenverdrahten.de/tm"/>
  </xsl:function-library>

  <xsl:function name="tm:pythagoras" as="xs:double">
    <xsl:param name="a" as="xs:double"/>
    <xsl:param name="b" as="xs:double"/>
    <xsl:sequence select="math:sqrt(math.pow($a, 2) + math.pow($b, 2)"/>
  </xsl:function>

</xsl:stylesheet>