<?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:ht = "http://www.w3.org/1999/xhtml"
  xmlns:sk = "http://herbaer.de/xmlns/20150106/skeleton"
  xmlns:ti = "http://herbaer.de/xmlns/201500703/transinfo/"
  xmlns:d = "http://herbaer.de/xmlns/20051201/doc"
  xmlns = "http://www.w3.org/1999/xhtml"
  exclude-result-prefixes = "d ht sk"
  version = "1.0"
>
<d:info xmlns="http://herbaer.de/xmlns/20051201/doc">
  <title>desktop_help_post.xslt</title>
  <subtitle>Hilfe zur Darstellung "desktop" nach der Übersetzung aufbereiten</subtitle>
  <date>2015-08-12</date>
  <author>
    <personname>
      <firstname>Herbert</firstname>
      <surname>Schiemann</surname>
    </personname>
    <email>h.schiemann@herbaer.de</email>
  </author>
</d:info>

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

<xsl:template match="/">
  <xsl:apply-templates select="text() | processing-instruction() | comment() | *"/>
</xsl:template>

<d:para>
Elemente werden "hohl" kopiert.
Verschobene Elemente werden entfernt,
nur verschobene Verweise werden am Ende angefügt.
</d:para>
<xsl:template match="*">
  <xsl:copy>
    <xsl:apply-templates select="@* | * | text()"/>
  </xsl:copy>
</xsl:template>

<d:para>
Verarbeitungsanweisungen und Attribute werden kopiert
</d:para>
<xsl:template match="processing-instruction() | @*">
  <xsl:copy-of select="."/>
</xsl:template>

<d:para>
Verschobene Bildverweise werden mit Inhalt gefüllt
</d:para>
<xsl:template match="ht:span [@class = 'ximglink']">
  <xsl:text> </xsl:text>
  <xsl:copy>
    <xsl:apply-templates select="@*" mode="ximglink"/>
    <xsl:value-of select="concat ('[', count (preceding::ht:span [@class = 'ximglink']) + 1, ']')"
    />
  </xsl:copy>
</xsl:template>

<d:para>
Attribute verschobener Bildverweise werden kopiert.
</d:para>
<xsl:template match="@*" mode="ximglink">
  <xsl:copy/>
</xsl:template>

<d:para>
Nur das Attribut
<d:tag class="attribute">class</d:tag>
bekommt seinen alten Wert
<d:tag class="attvalue">imglink</d:tag>
</d:para>
<xsl:template match="@class" mode="ximglink">
  <xsl:attribute name="class">imglink</xsl:attribute>
</xsl:template>

</xsl:stylesheet>
