You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
187 lines
5.3 KiB
187 lines
5.3 KiB
<?xml version="1.0" encoding="UTF-8"?> |
|
<xsl:stylesheet version="1.0" |
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
|
<xsl:import href="resultset_html.xsl" /> |
|
<xml:output method="text"/> |
|
<xsl:strip-space elements="*" /> |
|
<xsl:template match="/"> |
|
|
|
<xsl:if test="/ergebnisse/makro/@id !=''"> |
|
<xsl:value-of select="/ergebnisse/makro/name" /><xsl:text> |
|
|
|
</xsl:text> |
|
</xsl:if> |
|
|
|
<xsl:for-each select="ergebnisse/ergebnis/ergebniselement"> |
|
<xsl:choose> |
|
<xsl:when test="@typ='tabelle'"> |
|
<xsl:text>'''</xsl:text><xsl:value-of select="../maskenname" /><xsl:text>'''</xsl:text> |
|
<xsl:text> |
|
---- |
|
</xsl:text> |
|
|
|
<xsl:for-each select="../felder/feld"> |
|
<xsl:if test="value !='' and @varname != 'sort' and @varname != 'maxoffset' and @varname != '##line##'"> |
|
<xsl:choose> |
|
<xsl:when test="string-length(caption_short) > 0 and caption_short != 'null'" > |
|
<xsl:value-of select="caption_short" /> |
|
</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:value-of select="@varname" /> |
|
</xsl:otherwise> |
|
</xsl:choose>: <xsl:if test="string-length(value_caption) < 50"> |
|
<xsl:value-of select="value_caption" /> |
|
</xsl:if> |
|
<xsl:if test="string-length(value_caption) > 49"> |
|
<xsl:value-of select="substring(value_caption,0,50)" />... |
|
</xsl:if> |
|
<xsl:text>; </xsl:text> |
|
</xsl:if> |
|
</xsl:for-each> |
|
<xsl:text> |
|
Stand: </xsl:text><xsl:value-of select="../stand" /><xsl:text> |
|
</xsl:text> |
|
|
|
<xsl:text>{| class="wikitable" border="1" |
|
|- |
|
</xsl:text> |
|
<xsl:for-each select="sqlerg/headers/header"> |
|
<xsl:text>! style="font-weight:bolder" | </xsl:text> |
|
<xsl:call-template name="remove_linebreaks"> |
|
<xsl:with-param name="volltext" select="wert" /> |
|
</xsl:call-template><xsl:text> |
|
</xsl:text> |
|
</xsl:for-each><xsl:text> |
|
|- |
|
</xsl:text> |
|
<xsl:for-each select="sqlerg/row"> |
|
<xsl:for-each select="col"> |
|
<xsl:choose> |
|
<xsl:when test="starts-with(f_name,'next')"> |
|
<xsl:text> </xsl:text> |
|
</xsl:when> |
|
|
|
<xsl:otherwise> |
|
<xsl:text>| </xsl:text> |
|
<xsl:choose> |
|
<xsl:when test="@typ='4'"> |
|
<xsl:text> style="text-align:right;" | </xsl:text> |
|
<xsl:value-of select="wert" /> |
|
</xsl:when> |
|
<xsl:when test="@typ='3'"> |
|
<xsl:text> style="text-align:right;" | </xsl:text> |
|
<xsl:value-of select="translate(wert,'.',',')" /> |
|
</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:call-template name="remove_linebreaks"> |
|
<xsl:with-param name="volltext" select="wert" /> |
|
</xsl:call-template> |
|
</xsl:otherwise> |
|
</xsl:choose> |
|
|
|
<xsl:text> |
|
</xsl:text> |
|
|
|
</xsl:otherwise> |
|
</xsl:choose> |
|
</xsl:for-each> |
|
<xsl:if test="position() < last()"> |
|
<xsl:text> |
|
|- |
|
</xsl:text> |
|
</xsl:if> |
|
</xsl:for-each> |
|
<xsl:text> |
|
|} |
|
</xsl:text> |
|
</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:text> |
|
Nicht unterstuetzter Ergebnistyp </xsl:text><xsl:value-of select="@type" /> |
|
</xsl:otherwise> |
|
</xsl:choose> |
|
<xsl:call-template name="datensatzzaehler" /> |
|
|
|
</xsl:for-each> |
|
|
|
</xsl:template> |
|
<xsl:template name="remove_linebreaks"> |
|
<xsl:param name="volltext" /> |
|
<xsl:variable name="volltext_ohne_blanks"> |
|
<xsl:choose> |
|
<xsl:when test="starts-with($volltext,' ')"> |
|
<xsl:value-of select="substring-after($volltext,' ')" /> |
|
</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:value-of select="$volltext" /> |
|
</xsl:otherwise> |
|
</xsl:choose> |
|
</xsl:variable> |
|
<xsl:variable name="volltext_ohne_umbrueche"> |
|
<xsl:choose> |
|
<xsl:when test="contains($volltext_ohne_blanks,' ')"> |
|
<xsl:value-of select="substring-before($volltext_ohne_blanks,' ')"/><xsl:text><![CDATA[<br />]]></xsl:text> |
|
<xsl:call-template name="remove_linebreaks"> |
|
<xsl:with-param name="volltext"><xsl:value-of select="substring-after($volltext_ohne_blanks,' ')" /> |
|
</xsl:with-param> |
|
</xsl:call-template> |
|
</xsl:when> |
|
<xsl:otherwise><xsl:value-of select="$volltext_ohne_blanks" /></xsl:otherwise> |
|
</xsl:choose> |
|
</xsl:variable> |
|
|
|
<xsl:choose> |
|
<xsl:when test="contains($volltext_ohne_umbrueche,'\000')"> |
|
<!--TODO: verknüpfte Spalten--> |
|
<xsl:value-of select="substring-before($volltext_ohne_umbrueche,'\000')"/><xsl:text><![CDATA[<br />]]></xsl:text> |
|
<xsl:call-template name="remove_linebreaks"> |
|
<xsl:with-param name="volltext"><xsl:value-of select="substring-after($volltext_ohne_umbrueche,'\000')" /> |
|
</xsl:with-param> |
|
</xsl:call-template> |
|
</xsl:when> |
|
<xsl:otherwise><xsl:value-of select="$volltext_ohne_umbrueche" /></xsl:otherwise> |
|
</xsl:choose> |
|
</xsl:template> |
|
<xsl:template name="datensatzzaehler"> |
|
<xsl:choose> |
|
<xsl:when test="sqlerg/@max=0"> |
|
Keinen Satz gefunden |
|
</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:text>Datensatz </xsl:text><xsl:choose> |
|
<xsl:when test="sqlerg/@offset=0 and sqlerg/@max=0">0</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:value-of select="sqlerg/@offset+1"/> |
|
</xsl:otherwise> |
|
</xsl:choose><xsl:text> - </xsl:text> |
|
<xsl:choose> |
|
<xsl:when test="(sqlerg/@offset + sqlerg/@maxOffset) < sqlerg/@max"> |
|
<xsl:value-of select="(sqlerg/@offset + sqlerg/@maxOffset)"/><xsl:text> von insgesamt </xsl:text> |
|
<xsl:choose> |
|
<xsl:when test="sqlerg/@max =1 "> |
|
<xsl:value-of select="sqlerg/@max"/><xsl:text> Satz </xsl:text> |
|
</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:value-of select="sqlerg/@max"/><xsl:text> Sätzen</xsl:text> |
|
</xsl:otherwise> |
|
</xsl:choose> |
|
|
|
</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:value-of select="sqlerg/@max"/><xsl:text> von insgesamt </xsl:text> |
|
<xsl:choose> |
|
<xsl:when test="sqlerg/@max =1 "> |
|
<xsl:value-of select="sqlerg/@max"/><xsl:text> Satz. </xsl:text> |
|
</xsl:when> |
|
<xsl:otherwise> |
|
<xsl:value-of select="sqlerg/@max"/><xsl:text> Sätzen.</xsl:text> |
|
</xsl:otherwise> |
|
</xsl:choose> |
|
</xsl:otherwise> |
|
</xsl:choose> |
|
</xsl:otherwise> |
|
</xsl:choose> |
|
<xsl:text> |
|
</xsl:text> |
|
</xsl:template> |
|
</xsl:stylesheet> |