pull out svn revisions from log xml using xslt

/ Published in: SVN
Save to your folder(s)

I use this to scan an entire repository for an issue number and print out all of the revisions that reference it.

XSLT is far faster now then it was in the old days. Xalan (not known as the fastest engine) can run this on my 10mb log file in under 2 seconds.

Copy this code and paste it in your HTML
  1. <?xml version="1.0"?>
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  4. <xsl:param name="issue" select="'valuenotentered'"/>
  5. <xsl:output method="text"/>
  6. <xsl:strip-space elements="*"/>
  8. <xsl:template match="log/logentry">
  9. </xsl:template>
  11. <xsl:template match="log/logentry[contains(msg, $issue)]">
  12. <xsl:value-of select="@revision"/>
  13. <xsl:text> </xsl:text>
  14. </xsl:template>
  16. </xsl:stylesheet>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.