You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by rg...@apache.org on 2007/08/18 22:50:17 UTC

svn commit: r567328 - /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-indexByCategory.xsl

Author: rgardler
Date: Sat Aug 18 13:50:16 2007
New Revision: 567328

URL: http://svn.apache.org/viewvc?view=rev&rev=567328
Log:
Only create category section if there is a project in that category.

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-indexByCategory.xsl

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-indexByCategory.xsl
URL: http://svn.apache.org/viewvc/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-indexByCategory.xsl?view=diff&rev=567328&r1=567327&r2=567328
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-indexByCategory.xsl (original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.input.doap/resources/stylesheets/descriptorIndex-to-indexByCategory.xsl Sat Aug 18 13:50:16 2007
@@ -42,26 +42,28 @@
             <xsl:for-each select="//doap:category[generate-id() = generate-id(key('kDistinctCategory', @rdf:resource))]">
               <xsl:sort select="@rdf:resource"/>
               <xsl:variable name="category" select="@rdf:resource"/>
-              <section>
-                <title>
-                    <xsl:choose>
-                      <xsl:when test="//projectDetails/categories/doap:category[@rdf:resource = $category]/@dc:title">
-                        <xsl:value-of select="//projectDetails/categories/doap:category[@rdf:resource = $category]/@dc:title"/>
-                      </xsl:when>
-                      <xsl:otherwise>
+              <xsl:if test="//descriptor[descendant::doap:category[@rdf:resource = $category]]">
+                  <section>
+                    <title>
                         <xsl:choose>
-                          <xsl:when test="@dc:title">
-                            <xsl:value-of select="@dc:title"/>
+                          <xsl:when test="//projectDetails/categories/doap:category[@rdf:resource = $category]/@dc:title">
+                            <xsl:value-of select="//projectDetails/categories/doap:category[@rdf:resource = $category]/@dc:title"/>
                           </xsl:when>
                           <xsl:otherwise>
-                            <xsl:value-of select="@rdf:resource"/>
+                            <xsl:choose>
+                              <xsl:when test="@dc:title">
+                                <xsl:value-of select="@dc:title"/>
+                              </xsl:when>
+                              <xsl:otherwise>
+                                <xsl:value-of select="@rdf:resource"/>
+                              </xsl:otherwise>
+                            </xsl:choose>
                           </xsl:otherwise>
                         </xsl:choose>
-                      </xsl:otherwise>
-                    </xsl:choose>
-                </title>
-                <xsl:apply-templates select="//descriptor[descendant::doap:category[@rdf:resource = $category]]"/>
-              </section>
+                    </title>
+                    <xsl:apply-templates select="//descriptor[descendant::doap:category[@rdf:resource = $category]]"/>
+                  </section>
+              </xsl:if>
             </xsl:for-each>
           </xsl:otherwise>
         </xsl:choose>