Added two summaries of results for instant gratification.  Added two 'callback' functions for handling @pending and separator between scenario texts so can be customised by using a stylesheet that imports this stylesheet, e.g.:
Added two summaries of results for instant gratification.  Added two
'callback' functions for handling @pending and separator between
scenario texts so can be customised by using a stylesheet that imports
this stylesheet, e.g.:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xs="http://www.w3.org/2001/XMLSchema"
                xmlns:x="http://www.jenitennison.com/xslt/xspec"
                exclude-result-prefixes="x xs"
                xmlns="http://www.w3.org/1999/xhtml">

<xsl:import href="format-xspec-report.xsl" />

<xsl:param name="ticket-url" select="'https://example.com/ticket/%d'"/>

<xsl:function name="x:pending-callback" as="node()*">
  <!-- returns formatted output for $pending. -->
  <xsl:param name="pending" as="xs:string?"/>
  <xsl:if test="$pending">
    <xsl:text>(</xsl:text>
    <strong>
      <!-- Turn ticket numbers into links to tickets. -->
      <xsl:analyze-string
        select="$pending"
        regex="#(\d+)">
        <xsl:matching-substring>
          <xsl:variable name="ticket-number"
            select="regex-group(1)"/>
          <a href="{replace($ticket-url, '%d', $ticket-number)}">#<xsl:value-of select="$ticket-number"/></a>
        </xsl:matching-substring>
        <xsl:non-matching-substring>
          <xsl:value-of select="."/>
        </xsl:non-matching-substring>
      </xsl:analyze-string>
    </strong>
    <xsl:text>) </xsl:text>
  </xsl:if>
</xsl:function>

<xsl:function name="x:separator-callback" as="node()*">
  <!-- returns formatted output for separator between scenarios. -->
  <span class="separator"><xsl:text> / </xsl:text></span>
</xsl:function>

</xsl:stylesheet>


git-svn-id: 2dbaadbaf98ca174f7b0d7d7583b0de64790c4d8@52 7466eb41-2b56-0410-9bce-5946398f495e

lovullo/xspec,lovullo/xspec