cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morr...@apache.org
Subject cvs commit: xml-cocoon2/tools/src check-jars.xsl
Date Wed, 29 May 2002 20:50:59 GMT
morrijr     02/05/29 13:50:59

  Modified:    lib      jars.xml
               tools/src check-jars.xsl
  Log:
  Get the functionality *right* this time...
  
  Revision  Changes    Path
  1.6       +1 -1      xml-cocoon2/lib/jars.xml
  
  Index: jars.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/lib/jars.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- jars.xml	28 May 2002 06:38:41 -0000	1.5
  +++ jars.xml	29 May 2002 20:50:59 -0000	1.6
  @@ -58,7 +58,7 @@
   	<description>jakarta-avalon-logkit is a logging toolkit designed for secure
          performance orientated logging in applications.</description>
   	<used-by>Cocoon logging</used-by>
  -	<lib>core/logkit-1.0.1.jar</lib>
  +	<lib>core/logkit-20020529.jar</lib>
   	<homepage>http://jakarta.apache.org/avalon/logkit/</homepage>
    </file>
    <file>
  
  
  
  1.4       +28 -32    xml-cocoon2/tools/src/check-jars.xsl
  
  Index: check-jars.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/tools/src/check-jars.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- check-jars.xsl	25 May 2002 15:32:00 -0000	1.3
  +++ check-jars.xsl	29 May 2002 20:50:59 -0000	1.4
  @@ -23,17 +23,15 @@
     <xsl:variable name="jars.xml" select="/"/>
   
     <xsl:template match="/">
  -    <xsl:variable name="declared" select="jars/*"/>
  + 	<!-- Validate lib/jars.xml prior to checking files -->
   
  -	<!-- Validate lib/jars.xml prior to checking files -->
  -
  -    <!-- Verify that all the entries in lib/jars.xml have appropriate tags -->
  + 	<!-- Verify that all the entries in lib/jars.xml have appropriate tags -->
       <xsl:apply-templates select="//file" mode="no-tag"/>
   
       <!-- Verify that all the file entries are unique -->
  -    <xsl:for-each select="$jars.xml/jars/file">
  -      <xsl:variable name="this" select="normalize-space(lib/text())"/>
  -      <xsl:if test="count($jars.xml/jars/file[normalize-space(lib/text()) = $this])
> 1">
  +    <xsl:for-each select="$jars.xml/jars/file/lib">
  +      <xsl:variable name="this" select="normalize-space(text())"/>
  +      <xsl:if test="count($jars.xml/jars/file/lib[normalize-space(text()) = $this])
> 1">
           <xsl:message terminate="yes">
     Duplicate entry for file <xsl:value-of select="$this"/>.
           </xsl:message>
  @@ -41,15 +39,11 @@
       </xsl:for-each>
   
       <!-- Verify if files declared in jars.xml appear in the lib/ directory -->
  -    <xsl:for-each select="$declared">
  -      <xsl:apply-templates select="." mode="declared-but-doesnt-appear"/>
  -    </xsl:for-each>
  +    <xsl:apply-templates select="jars//lib" mode="declared-but-doesnt-appear"/>
   
       <!-- Verify that files that appear in lib/ are declared in jars.xml -->
  -    <xsl:for-each select="$directory/jars/*">
  -      <xsl:apply-templates select="." mode="appears-but-not-declared"/>
  -    </xsl:for-each>
  -
  +    <xsl:apply-templates select="$directory/jars" mode="appears-but-not-declared"/>
  +    
   	<!-- create the documentation -->
   	<!-- FIXME: how can I get the doctype into the output? -->
   	<!-- DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.0//EN" "../dtd/document-v10.dtd"
-->
  @@ -81,9 +75,9 @@
     <!-- Template to verify if files declared in jars.xml appear in the
          lib/ directory
     -->
  -  <xsl:template match="file/lib" mode="declared-but-doesnt-appear">
  -    <xsl:variable name="this" select="normalize-space(lib/text())"/>
  -    <xsl:if test="count($directory/jars/jar[normalize-space(lib/text()) = $this]) =
0">
  +  <xsl:template match="lib" mode="declared-but-doesnt-appear">
  +    <xsl:variable name="this" select="normalize-space(text())"/>
  +    <xsl:if test="count($directory/jars/jar[normalize-space(text()) = $this]) = 0">
         <xsl:message terminate="yes">
     File <xsl:value-of select="$this"/> is declared in lib/jars.xml, but doesn't appear
in the lib/ directory.
   
  @@ -94,9 +88,9 @@
     <!-- Template to verify that files that appear in lib/ are declared
          in jars.xml
     -->
  -  <xsl:template match="file/lib" mode="appears-but-not-declared">
  -    <xsl:variable name="this" select="normalize-space(lib/text())"/>
  -    <xsl:if test="count($jars.xml/jars/file[normalize-space(lib/text()) = $this]) =
0">
  +  <xsl:template match="jar" mode="appears-but-not-declared">
  +    <xsl:variable name="this" select="normalize-space(text())"/>
  +    <xsl:if test="count($jars.xml/jars/file/lib[normalize-space(text()) = $this]) =
0">
         <xsl:choose>
           <xsl:when test="starts-with($this, 'local/')">
             <xsl:message>
  @@ -134,7 +128,15 @@
       <xsl:message terminate="yes">
     Entry for file <xsl:value-of select="normalize-space(lib/text())"/> in the lib/jars.xml
does not have a "used-by" tag.
   
  -  Please add an "used-by" tag before continuing.</xsl:message>
  +  Please add a used-by tag before continuing.</xsl:message>
  +  </xsl:template>
  +
  +  <!-- Verify if a file element has an "lib" tag -->
  +  <xsl:template match="file[not(lib)]" mode="no-tag">
  +    <xsl:message terminate="yes">
  +  Entry for file <xsl:value-of select="normalize-space(title/text())"/> in the lib/jars.xml
does not have a "lib" tag.
  +
  +  Please add a lib tag before continuing.</xsl:message>
     </xsl:template>
   
     <!-- Verify if a file element has an "url" tag -->
  @@ -142,18 +144,9 @@
       <xsl:message terminate="yes">
     Entry for file <xsl:value-of select="normalize-space(lib/text())"/> in the lib/jars.xml
does not have a "homepage" tag.
   
  -  Please add an "homepage" tag before continuing.</xsl:message>
  +  Please add a homepage tag before continuing.</xsl:message>
     </xsl:template>
   
  -  <!-- Dont output anything if entry has all the required tags -->
  -  <xsl:template match="*" mode="no-tag" priority="-1"/>
  -
  -  <!-- Dont output anything if declared entries appear -->
  -  <xsl:template match="*" mode="declared-but-doesnt-appear" priority="-1"/>
  -
  -  <!-- Dont output anything if jar files are declared -->
  -  <xsl:template match="*" mode="appears-but-not-declared" priority="-1"/>
  -
     <!-- Format for documentation -->
     <xsl:template match="file" mode="documentation">
   	<tr>
  @@ -164,5 +157,8 @@
   	</tr>
     </xsl:template>
   
  -</xsl:stylesheet>
  +  <xsl:template match="file" mode="no-tag" priority="-1"/>
  +  <xsl:template match="file" mode="declared-but-doesnt-appear" priority="-1"/>
  +  <xsl:template match="file" mode="appears-but-not-declared" priority="-1"/>    
   
  +</xsl:stylesheet>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message