<?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:v = "http://herbaer.de/xmlns/20170605/visits/"
  xmlns:ht = "http://www.w3.org/1999/xhtml"
  xmlns:d = "http://herbaer.de/xmlns/20051201/doc"
  xmlns:xl = "http://www.w3.org/1999/xlink"
  version = "1.0"
  exclude-result-prefixes = "xl"
>
<d:info xmlns="http://herbaer.de/xmlns/20051201/doc">
  <title>visits_num.xslt</title>
  <subtitle>Besuchszahlen zur Eingabe an Perl-Skript</subtitle>
  <date>2017-06-07</date>
  <author>
    <personname>
      <firstname>Herbert</firstname>
      <surname>Schiemann</surname>
    </personname>
    <email>h.schiemann@herbaer.de</email>
  </author>
</d:info>

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

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

<d:para>
Wurzel
</d:para>
<xsl:template match="/">
  <xsl:apply-templates select="v:visits"/>
</xsl:template>

<d:para>
Wurzelelement
</d:para>
<xsl:template match="v:visits">
  <xsl:apply-templates select="v:last_time | v:numvisits | v:numstories | v:numimages"/>
</xsl:template>

<d:para>
Besuchszahlen
</d:para>
<xsl:template match="v:numvisits">
  <xsl:value-of select="concat ('VISITS', $txt.break)"/>
  <xsl:apply-templates select="v:num"/>
</xsl:template>

<d:para>
Besuche der Bildergeschichten
</d:para>
<xsl:template match="v:numstories">
  <xsl:value-of select="concat ('STORIES', $txt.break)"/>
  <xsl:apply-templates select="v:num"/>
</xsl:template>

<d:para>
Anfragen der Bilder
</d:para>
<xsl:template match="v:numimages">
  <xsl:value-of select="concat ('IMAGES', $txt.break)"/>
  <xsl:apply-templates select="v:num"/>
</xsl:template>

<d:para>
Eine Zahl
</d:para>
<xsl:template match="v:num">
  <xsl:choose>
    <xsl:when test="@story">
      <xsl:value-of select="concat ('STO ', @story, ' ')"/>
    </xsl:when>
    <xsl:when test="@image">
      <xsl:value-of select="concat ('IMG ', @image, ' ')"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>LANG </xsl:text>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:value-of select="concat (@lang, ' ', ., $txt.break)"/>
</xsl:template>

<d:para>
Die Zeit des letzten Zugriffs
</d:para>
<xsl:template match="v:last_time">
  <xsl:value-of select="concat ('LAST ', ., $txt.break)"/>
</xsl:template>

</xsl:stylesheet>
