Created
October 6, 2011 21:18
-
-
Save apbarrero/1268703 to your computer and use it in GitHub Desktop.
First XSLT using the Muenchian method for SVN log
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
| <xsl:param name="ticket" select="__none__" /> | |
| <xsl:output encoding="utf-8" method="xml" indent="yes" /> | |
| <xsl:key use="text()" name="path-key" | |
| match="path" /> | |
| <xsl:template match="log"> | |
| <xsl:copy> | |
| <xsl:element name="ticket"> | |
| <xsl:value-of select="$ticket" /> | |
| </xsl:element> | |
| <xsl:apply-templates select="logentry[msg[contains(text(), $ticket)]]" /> | |
| </xsl:copy> | |
| </xsl:template> | |
| <xsl:template match="logentry"> | |
| <xsl:apply-templates select="paths/path" /> | |
| </xsl:template> | |
| <xsl:template match="path"> | |
| <xsl:if | |
| test="generate-id() = generate-id(key('path-key', text())[1])"> | |
| <xsl:copy-of select="."/> | |
| </xsl:if> | |
| </xsl:template> | |
| </xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment