使用xslt从日志xml中提取svn修订

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用xslt从日志xml中提取svn修订相关的知识,希望对你有一定的参考价值。

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.
  1. <?xml version="1.0"?>
  2.  
  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="*"/>
  7.  
  8. <xsl:template match="log/logentry">
  9. </xsl:template>
  10.  
  11. <xsl:template match="log/logentry[contains(msg, $issue)]">
  12. <xsl:value-of select="@revision"/>
  13. <xsl:text> </xsl:text>
  14. </xsl:template>
  15.  
  16. </xsl:stylesheet>

以上是关于使用xslt从日志xml中提取svn修订的主要内容,如果未能解决你的问题,请参考以下文章