App-Changelog2x

 view release on metacpan or  search on metacpan

lib/App/changelog2x/common.xslt  view on Meta::CPAN

<?xml version="1.0" encoding="UTF-8"?>
<!--
    :tabSize=2:indentSize=2:wrap=hard:
    $Id: common.xslt 4 2009-01-07 13:02:06Z rjray $

    This XSLT stylesheet contains all the operations/templates that are
    common to both XHTML and plain-text stylesheets. Mostly this is
    focused on date-formatting and the "credits" string (the list of
    software components responsible for the XSLT processing).
-->
<xsl:stylesheet version="1.0"
                xmlns:cl="http://www.blackperl.com/2009/01/ChangeLogML"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:date="http://exslt.org/dates-and-times"
                xmlns:xhtml="http://www.w3.org/1999/xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                extension-element-prefixes="date">

  <!-- Tab character, used in some places (mainly in text-oriented styles) -->
  <xsl:variable name="tab"><xsl:text>&#x9;</xsl:text></xsl:variable>

  <!-- Platform-agnostic newline character -->
  <xsl:variable name="newline">
<xsl:text>
</xsl:text>
  </xsl:variable>

  <!--
    The source-control identifying string for this component, used in some
    credits-comments.
  -->
  <xsl:variable name="common-id">
    <xsl:text><![CDATA[$Id: common.xslt 4 2009-01-07 13:02:06Z rjray $]]></xsl:text>
  </xsl:variable>

  <!--
    Variables and system-properties that make up the "generated by" comment.
    If the formatting application has registered a function called "credits"
    in the ChangeLogML namespace (cl:), that is called to get the string that
    identifies the processor application. Otherwise, the 'xsl:vendor' and
    'xsl:vendor-url' system-properties are used.
  -->
  <xsl:variable name="now">
    <xsl:call-template name="format-date">
      <xsl:with-param name="date" select="date:date-time()" />
    </xsl:call-template>
  </xsl:variable>
  <xsl:variable name="credits">
    <xsl:choose>
      <xsl:when test="function-available('cl:credits')">
        <xsl:value-of select="cl:credits()" />
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="concat(system-property('xsl:vendor'), ' (', system-property('xsl:vendor-url'), ')')" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>

  <!--
    These variables are used for the project name and title, which depending
    on the sort of output being produced might need to be subtly distinct.
  -->
  <xsl:variable name="name" select="cl:changelog/cl:project" />
  <xsl:variable name="title">
    <!-- A little more complex, as the title element is optional -->
    <xsl:choose>
      <xsl:when test="cl:changelog/cl:title">



( run in 1.735 second using v1.01-cache-2.11-cpan-39bf76dae61 )