]> granicus.if.org Git - docbook-dsssl/commitdiff
Generalized the mechanism for grabbing values from content that
authorMichael Smith <xmldoc@users.sourceforge.net>
Thu, 28 Jun 2007 19:20:45 +0000 (19:20 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Thu, 28 Jun 2007 19:20:45 +0000 (19:20 +0000)
contains RCS keywords.

releasetools/get-param.xsl

index 8984108e1d72cfc1ccc76c6c5612bc8fe406b2ed..ab96eec1ac04f21b66a9f5ea8656da74a0eaf3e1 100644 (file)
   <xsl:template match="/">
     <xsl:param name="target" select="//*[@*[local-name() = 'name'] = $param]"/>
     <xsl:choose>
-      <xsl:when test="contains($target, 'Revision')">
-        <xsl:value-of select="substring-before(substring-after($target, 'Revision: '), ' ')"/>
+      <!-- * if param contains ': ', it's an RCS keyword like -->
+      <!-- * '$Revision$', we want to get the part after the -->
+      <!-- * opening ': ' and before the closing ' $' delimiters -->
+      <xsl:when test="contains($target, ': ')">
+        <xsl:value-of select="substring-before(substring-after($target, ': '), ' $')"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:value-of select="$target"/>
@@ -20,4 +23,4 @@
     </xsl:choose>
   </xsl:template>
   
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>