<?xml version="1.0" encoding="UTF-8"?>

<!--  XSL transformation to create a text version from gimp.appdata.xml.in  -->

<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text"/>

<xsl:template match="/">
    <xsl:text>
-- This file is generated from gimp.appdata.xml.in, do not edit it directly. --

                   ------------------------------
                   </xsl:text><xsl:value-of select="component/_name"/><xsl:text>
                          Development Branch
                   ------------------------------

This is the unstable development branch of GIMP. Here we are working
towards the next stable release, which will be GIMP 2.10.

Generally, all bug fixes that are applied on the stable GIMP 2.8
branch are also applied here, but they are usually not mentioned
in NEWS.
      </xsl:text>
      <xsl:for-each select="component/releases/release">
        <xsl:text>
Overview of Changes in GIMP </xsl:text><xsl:value-of select="@version"/><xsl:text>
=================================</xsl:text>
        <xsl:for-each select="description">
<xsl:apply-templates  select="."/>
        </xsl:for-each>
      </xsl:for-each>
</xsl:template>

<!-- https://stackoverflow.com/questions/1468984/xslt-remove-whitespace-from-template -->
<xsl:template match="text()" />

<!-- https://stackoverflow.com/questions/3767452/xquery-word-wrap -->
<xsl:template match="p">
<xsl:variable name="pText" select="."/>
&#160;
<xsl:sequence select=
   "replace(concat(normalize-space($pText),' '),
            '(.{0,69}) ',
            '$1&#xA;')
"/>&#160;
</xsl:template>

<xsl:template match="ul">
  <xsl:apply-templates select="li"/>
</xsl:template>

<xsl:template match="li">
  <xsl:variable name="liText" select="."/>
  <xsl:text>  - </xsl:text><xsl:sequence select=
   "substring(replace(concat(normalize-space($liText),' '),
            '(.{0,65}) ',
            '&#xA0;&#xA0;&#xA0;&#xA0;$1&#xA;'), 5)
"/>
</xsl:template>

</xsl:stylesheet>
