Gimp/data/tips/fortunes.xsl
Sven Neumann 1c4122c5d0 Switch to a more standard way of treating the translations for the startup
2005-06-10  Sven Neumann  <sven@gimp.org>

	Switch to a more standard way of treating the translations for the
	startup tips (bug #171846):

	* Makefile.am
	* configure.in: removed tips directory; added data/tips and po-tips
	directories instead.

	* data/Makefile.am
	* data/AUTHORS
	* data/ChangeLog
	* data/README: removed these three outdated files.

	* data/tips: gimp.tips.xml and related files live here now.

	* po-tips: translations of the tips are found here now.

	* README.i18n: changed accordingly.
2005-06-10 16:38:36 +00:00

57 lines
1.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- This simple XSL transformation creates a text version from
gimp-tips.xml.in which can then be used to seed
http://wiki.gimp.org/gimp/FortuneCookies in the GIMP Wiki. -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:template match="/">
<xsl:apply-templates select="//_thetip" />
</xsl:template>
<xsl:template match="_thetip">
* <xsl:apply-templates />
</xsl:template>
<xsl:template match="tt">
<xsl:text>{{{</xsl:text>
<xsl:apply-templates />
<xsl:text>}}}</xsl:text>
</xsl:template>
<!-- this sucks
but I don't seem to get xsl:strip-space to work with xsltproc -->
<xsl:template match="text()">
<xsl:call-template name="search-and-replace">
<xsl:with-param name="input" select="." />
<xsl:with-param name="search-string" select="'&#xa; '" />
<xsl:with-param name="replace-string" select="' '" />
</xsl:call-template>
</xsl:template>
<xsl:template name="search-and-replace">
<xsl:param name="input" />
<xsl:param name="search-string" />
<xsl:param name="replace-string" />
<xsl:choose>
<xsl:when test="$search-string and contains($input, $search-string)">
<xsl:value-of select="substring-before($input, $search-string)" />
<xsl:value-of select="$replace-string" />
<xsl:call-template name="search-and-replace">
<xsl:with-param name="input"
select="substring-after($input, $search-string)" />
<xsl:with-param name="search-string" select="$search-string" />
<xsl:with-param name="replace-string" select="$replace-string" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$input" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>