<?xml version="1.0"?>
<?xml-stylesheet href="/pool/xslt_ht.xslt" type="application/xml"?>
<xsl:stylesheet
  xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
  xmlns:d = "http://herbaer.de/xmlns/20051201/doc"
  version = "1.0"
>
<d:info xmlns="http://herbaer.de/xmlns/20051201/doc">
  <title>xmlns.xslt</title>
  <subtitle>XML-Namensraum des Wurzelelements und XML-Stylesheet-Basisname</subtitle>
  <date>2015-07-11</date>
  <author>
    <personname>
      <firstname>Herbert</firstname>
      <surname>Schiemann</surname>
    </personname>
    <email>h.schiemann@herbaer.de</email>
  </author>
</d:info>

<xsl:include href="/pool/txt.xslt"/>

<xsl:output method="text" encoding="utf-8"/>

<xsl:template match="/">
  <xsl:value-of select="namespace-uri(*)"/>
  <xsl:text>|</xsl:text>
  <xsl:apply-templates select="processing-instruction()[name(.) = 'xml-stylesheet']"/>
</xsl:template>

<d:para>
Basis-Name der XSLT-Transformation
</d:para>
<xsl:template match="/processing-instruction()[name(.) = 'xml-stylesheet']">
  <xsl:variable name="n">
    <xsl:call-template name="txt.substring_afterlast">
      <xsl:with-param
        name = "txt"
        select = "
          substring-before ( substring-after (
          substring-after (., 'href'), '&quot;'), '&quot;')
        "
      />
      <xsl:with-param name="what" select="'/'"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:choose>
    <xsl:when test="contains ($n, '.xslt')">
      <xsl:value-of select="substring-before ($n, '.xslt')"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$n"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

</xsl:stylesheet>
