md5sum.xsl 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <!-- Create a md5 list for packages and pathces used. -->
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4. version="1.0">
  5. <xsl:output method="text"/>
  6. <xsl:template match="/">
  7. <xsl:apply-templates select="//ulink"/>
  8. </xsl:template>
  9. <xsl:template match="ulink">
  10. <!-- If some package don't have the predefined strings in their
  11. name, the next test must be fixed to match it also. Skip possible
  12. duplicated URLs that may be split for PDF output -->
  13. <xsl:if test="(contains( @url, '.tar.' ) or
  14. contains( @url, '.tgz' ) or
  15. contains( @url, '.patch') ) and
  16. not( ancestor-or-self::*/@condition = 'pdf' )" >
  17. <!-- Get the md5sum -->
  18. <xsl:value-of select="../../para/literal"/>
  19. <!-- Add two spaces -->
  20. <xsl:text> </xsl:text>
  21. <!-- Get the basename -->
  22. <xsl:call-template name="basename">
  23. <xsl:with-param name="pathname" select="@url"/>
  24. </xsl:call-template>
  25. <!-- Add a newline -->
  26. <xsl:text>&#x0a;</xsl:text>
  27. </xsl:if>
  28. </xsl:template>
  29. <xsl:template name="basename">
  30. <xsl:param name="pathname"/>
  31. <xsl:choose>
  32. <xsl:when test="contains( $pathname, '/' )" >
  33. <xsl:call-template name="basename">
  34. <xsl:with-param name="pathname" select="substring-after( $pathname, '/' )" />
  35. </xsl:call-template>
  36. </xsl:when>
  37. <xsl:otherwise>
  38. <xsl:value-of select="$pathname"/>
  39. </xsl:otherwise>
  40. </xsl:choose>
  41. </xsl:template>
  42. </xsl:stylesheet>