view release on metacpan or search on metacpan
lib/App/changelog2x/changelog2text.xslt view on Meta::CPAN
first version seen (sensitive to sorting order).
order
Determines the sorting-order for the release blocks. Must be one of
"ascending" (in which the oldest release is processed first) or
"descending" (the default, in which the newest release is processed
first).
-->
<xsl:stylesheet version="1.0"
xmlns:cl="http://www.blackperl.com/2009/01/ChangeLogML"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://www.ora.com/XSLTCookbook/namespaces/strings"
xmlns:text="http://www.ora.com/XSLTCookbook/namespaces/text">
<!--
This snippet contains most of the core text-generation templates. It will
also be used by the stylesheets that generate only partial content. Some
may use xsl:import rather than xsl:include so as to override some
functionality, but for this stylesheet everything is needed as-is.
-->
<xsl:include href="common-text.xslt" />
<!--
lib/App/changelog2x/changelog2textnewest.xslt view on Meta::CPAN
fragment whose content is the newest release, as sorted by the @date
attributes. None of the extra content for the head or tail-end of the
full plain-text changelog is generated, only one block for the given
release.
The template utilizes no input parameters.
-->
<xsl:stylesheet version="1.0"
xmlns:cl="http://www.blackperl.com/2009/01/ChangeLogML"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://www.ora.com/XSLTCookbook/namespaces/strings"
xmlns:text="http://www.ora.com/XSLTCookbook/namespaces/text">
<!--
This snippet contains most of the core text-generation templates. It will
also be used by the stylesheets that generate only partial content. Some
may use xsl:import rather than xsl:include so as to override some
functionality, but for this stylesheet everything is needed as-is.
-->
<xsl:include href="common-text.xslt" />
<!--
lib/App/changelog2x/changelog2textversion.xslt view on Meta::CPAN
as generated for the full plain-text changelog is included, and the
content does *not* end with a new-line, in case the resulting output is
intended for inclusion in a plain-text file where the extra new-line
might be undesirable.
The template utilizes no input parameters.
-->
<xsl:stylesheet version="1.0"
xmlns:cl="http://www.blackperl.com/2009/01/ChangeLogML"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://www.ora.com/XSLTCookbook/namespaces/strings"
xmlns:text="http://www.ora.com/XSLTCookbook/namespaces/text">
<!--
This snippet contains most of the core text-generation templates. It will
also be used by the stylesheets that generate only partial content. Some
may use xsl:import rather than xsl:include so as to override some
functionality, but for this stylesheet everything is needed as-is.
-->
<xsl:include href="common-text.xslt" />
<!--
lib/App/changelog2x/common-text.xslt view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8"?>
<!--
:tabSize=2:indentSize=2:wrap=hard:
$Id: common-text.xslt 8 2009-01-19 06:46:50Z rjray $
This XSLT stylesheet contains the operations/templates that are common
to all of the text-oriented stylesheets. This includes several recipes
taken from the ORA volume, "XSLT Cookbook".
-->
<xsl:stylesheet version="1.0"
xmlns:cl="http://www.blackperl.com/2009/01/ChangeLogML"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://www.ora.com/XSLTCookbook/namespaces/strings"
xmlns:text="http://www.ora.com/XSLTCookbook/namespaces/text">
<!--
The source-control identifying string for this component, used in some
credits-comments.
-->
<xsl:variable name="common-text-id">
<xsl:text><![CDATA[$Id: common-text.xslt 8 2009-01-19 06:46:50Z rjray $]]></xsl:text>
</xsl:variable>
<xsl:template name="release" match="cl:release">
lib/App/changelog2x/common-text.xslt view on Meta::CPAN
<xsl:when test="@action = 'MOVE'">
<xsl:text>(moved)</xsl:text>
</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:value-of select="$newline" />
</xsl:template>
<!--
The following four template declarations are taken almost verbatim from
O'Reilly & Associates' _XSLT Cookbook_. I've made some changes to the
text:wrap template to make the indention string caller-selectable.
-->
<!-- XSLT Cookbook, recipe 5.6 -->
<xsl:template match="node()|@*" mode="text:wrap" name="text:wrap">
<xsl:param name="input" select="normalize-space()" />
<xsl:param name="width" select="70" />
<xsl:param name="align-width" select="$width" />
<xsl:param name="align" select="'left'"/>
<xsl:param name="indent" select="0" />
<xsl:param name="indent-with" select="' '" />
<xsl:if test="$input">
<xsl:variable name="line">
lib/App/changelog2x/common-text.xslt view on Meta::CPAN
select="substring($input, string-length($line) + 2)" />
<xsl:with-param name="width" select="$width" />
<xsl:with-param name="align-width" select="$align-width" />
<xsl:with-param name="align" select="$align" />
<xsl:with-param name="indent" select="$indent" />
<xsl:with-param name="indent-with" select="$indent-with" />
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- XSLT Cookbook, recipe 5.3 -->
<xsl:template name="text:justify">
<xsl:param name="value" />
<xsl:param name="width" select="10" />
<xsl:param name="align" select="'left'" />
<xsl:param name="pad-with" select="' '" />
<!-- Truncate if too long -->
<xsl:variable name="output" select="substring($value,1,$width)" />
<xsl:choose>
<xsl:when test="$align = 'left'">
<xsl:value-of select="$output"/>
lib/App/changelog2x/common-text.xslt view on Meta::CPAN
<xsl:with-param name="input" select="$pad-with" />
<xsl:with-param name="count"
select=
"ceiling(($width - string-length($output)) div 2)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>INVALID ALIGN</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- XSLT Cookbook, recipe 1.4 -->
<xsl:template name="str:substring-before-last">
<xsl:param name="input" />
<xsl:param name="substr" />
<xsl:if test="$substr and contains($input, $substr)">
<xsl:variable name="temp" select="substring-after($input, $substr)" />
<xsl:value-of select="substring-before($input, $substr)" />
<xsl:if test="contains($temp, $substr)">
<xsl:value-of select="$substr" />
<xsl:call-template name="str:substring-before-last">
<xsl:with-param name="input" select="$temp" />
lib/App/changelog2x/common-text.xslt view on Meta::CPAN
<xsl:with-param name="input" select="$temp" />
<xsl:with-param name="substr" select="$substr" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$temp" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- XSLT Cookbook, recipe 1.5 -->
<xsl:template name="str:dup">
<xsl:param name="input" />
<xsl:param name="count" select="1" />
<xsl:choose>
<xsl:when test="not($count) or not($input)" />
<xsl:when test="$count = 1">
<xsl:value-of select="$input" />
</xsl:when>
<xsl:otherwise>
<!-- If $count is odd append an extra copy of input -->
lib/App/changelog2x/svnxml2changes.xslt view on Meta::CPAN
<?xml version="1.0" encoding="UTF-8"?>
<!--
:tabSize=2:indentSize=2:wrap=hard:
$Id: svnxml2changes.xslt 14 2009-01-23 01:41:18Z rjray $
This XSLT stylesheet transforms the XML-style output from Subversion's
"log" command into ChangeLogML "change" blocks. It uses some
text-formatting recipes from the XSLT Cookbook published by O'Reilly &
Associates.
Suggested usage:
svn log -v -r RANGE - -xml | xsltproc svnxml2changes.xslt -
^^^ delete this space, double-dashes cannot
occur in XML comments
The "-v" option to "svn log" is important, as it causes file information
to be included in the log output.
-->
<xsl:stylesheet version="1.0"
xmlns:cl="http://www.blackperl.com/2009/01/ChangeLogML"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://www.ora.com/XSLTCookbook/namespaces/strings"
xmlns:text="http://www.ora.com/XSLTCookbook/namespaces/text">
<xsl:strip-space elements="*" />
<xsl:output method="xml" indent="no" omit-xml-declaration="yes" />
<!-- Platform-agnostic newline character -->
<xsl:variable name="newline">
<xsl:text>
</xsl:text>
</xsl:variable>
<!-- If the user provides a value for this, remove it from any paths -->
lib/App/changelog2x/svnxml2changes.xslt view on Meta::CPAN
<xsl:sort select="text()" data-type="text" />
<xsl:apply-templates select="." />
</xsl:for-each>
</xsl:element>
<xsl:value-of select="$newline" />
</xsl:otherwise>
</xsl:choose>
<xsl:element name="description">
<xsl:value-of select="$newline" />
<!--
Use the text:wrap recipes from XSLT Cookbook to pretty-print the
log message.
-->
<xsl:call-template name="text:wrap">
<xsl:with-param name="input" select="normalize-space(msg)" />
<xsl:with-param name="width" select="70" />
</xsl:call-template>
</xsl:element>
<xsl:value-of select="$newline" />
</xsl:element>
<xsl:value-of select="$newline" />
lib/App/changelog2x/svnxml2changes.xslt view on Meta::CPAN
<xsl:attribute name="revision">
<xsl:value-of select="$revision" />
</xsl:attribute>
</xsl:if>
</xsl:element>
<xsl:value-of select="$newline" />
</xsl:template>
<!--
The following four template declarations are taken almost verbatim from
O'Reilly & Associates' _XSLT Cookbook_. I've made some changes to the
text:wrap template to make the indention string caller-selectable.
-->
<!-- XSLT Cookbook, recipe 5.6 -->
<xsl:template match="node()|@*" mode="text:wrap" name="text:wrap">
<xsl:param name="input" select="normalize-space()" />
<xsl:param name="width" select="70" />
<xsl:param name="align-width" select="$width" />
<xsl:param name="align" select="'left'"/>
<xsl:param name="indent" select="0" />
<xsl:param name="indent-with" select="' '" />
<xsl:if test="$input">
<xsl:variable name="line">
lib/App/changelog2x/svnxml2changes.xslt view on Meta::CPAN
select="substring($input, string-length($line) + 2)" />
<xsl:with-param name="width" select="$width" />
<xsl:with-param name="align-width" select="$align-width" />
<xsl:with-param name="align" select="$align" />
<xsl:with-param name="indent" select="$indent" />
<xsl:with-param name="indent-with" select="$indent-with" />
</xsl:call-template>
</xsl:if>
</xsl:template>
<!-- XSLT Cookbook, recipe 5.3 -->
<xsl:template name="text:justify">
<xsl:param name="value" />
<xsl:param name="width" select="10" />
<xsl:param name="align" select="'left'" />
<xsl:param name="pad-with" select="' '" />
<!-- Truncate if too long -->
<xsl:variable name="output" select="substring($value,1,$width)" />
<xsl:choose>
<xsl:when test="$align = 'left'">
<xsl:value-of select="$output"/>
lib/App/changelog2x/svnxml2changes.xslt view on Meta::CPAN
<xsl:with-param name="input" select="$pad-with" />
<xsl:with-param name="count"
select=
"ceiling(($width - string-length($output)) div 2)" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>INVALID ALIGN</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- XSLT Cookbook, recipe 1.4 -->
<xsl:template name="str:substring-before-last">
<xsl:param name="input" />
<xsl:param name="substr" />
<xsl:if test="$substr and contains($input, $substr)">
<xsl:variable name="temp" select="substring-after($input, $substr)" />
<xsl:value-of select="substring-before($input, $substr)" />
<xsl:if test="contains($temp, $substr)">
<xsl:value-of select="$substr" />
<xsl:call-template name="str:substring-before-last">
<xsl:with-param name="input" select="$temp" />
lib/App/changelog2x/svnxml2changes.xslt view on Meta::CPAN
<xsl:with-param name="input" select="$temp" />
<xsl:with-param name="substr" select="$substr" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$temp" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- XSLT Cookbook, recipe 1.5 -->
<xsl:template name="str:dup">
<xsl:param name="input" />
<xsl:param name="count" select="1" />
<xsl:choose>
<xsl:when test="not($count) or not($input)" />
<xsl:when test="$count = 1">
<xsl:value-of select="$input" />
</xsl:when>
<xsl:otherwise>
<!-- If $count is odd append an extra copy of input -->