cvs2cl.pl - XML output

Martyn J. Pearce fluffy at sixears.co.uk
Sun Aug 24 10:44:37 PDT 2003


Greetings Jeroen,

On Wed, Aug 06, 2003 at 12:01:41AM +0200, Jeroen Coumans wrote:
> I have two questions though:
> However, I'd like to get daily CVS commit output sorted by person. 
> Currently, when a person commits multiple changes in a day, they appear 
> one by one, like this:
>
> [snip]
> 
> Instead, I'd like them all grouped together like this:
> 
> [snip]
> 
> Is this possible with cvs2cl.pl?

Currently, no.  It may be in the future, but I'm afraid the cvs2cl is
currently in maintenance mode, and it'll likely be a little while before real
development is done on it again :-(  I have logged this as a bug (#53).

> Secondly, I should probably use XSLT stylesheets to transform the XML 
> into XHTML. However, I'm a complete newbe regarding XML and XSLT, can 
> anybody help me with this? I need to extract the following information 
> in this format:
> 
> <li>
> <h4>Date - Author</h4>
> <p>File(s): commit log</p>
> </li>

I'm no expert in XSLT, however, I have knocked up a starting example, which I
attach, which gives the above format.  I've also posted it on the red-bean
site.  If you enhance/improve this, and don't mind sharing, please copy me ---
I'll post the improved version, too!  The attached worked with:

xsltproc examples/cl2html.xslt [xml-cl-file]

Cheers,
Mx.
-------------- next part --------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 version="1.0"  xmlns:cvs2cl="http://www.red-bean.com/xmlns/cvs2cl/">
  <xsl:output method="html" encoding="UTF-8"
              media-type="text/html" indent="yes"
              doctype-public="-//W3C//DTD XHTML 1.1// EN"
  />
  <xsl:template match="/cvs2cl:changelog">
    <html>
      <title>ChangeLog</title>
      <body>
        <ul>
          <xsl:for-each select="cvs2cl:entry">
            <li>
              <h4>
                <xsl:value-of select="concat(cvs2cl:date, ' - ', 
                                             cvs2cl:author)"
                />
              </h4>
              <p>
                <xsl:for-each select="cvs2cl:file">
                  <xsl:value-of select="cvs2cl:name"/>
                  <xsl:if test="position() != last()">, </xsl:if>
                </xsl:for-each>
                <xsl:text>: </xsl:text>
                <xsl:value-of select="cvs2cl:msg"/>
              </p>
            </li>
          </xsl:for-each>
        </ul>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>


More information about the website mailing list