You are viewing a plain text version of this content. The canonical link for it is here.
Posted to svn@forrest.apache.org by fe...@apache.org on 2008/02/15 10:01:32 UTC

svn commit: r627976 - /forrest/branches/UpdateFOPto094/main/webapp/resources/stylesheets/linkmap-to-document.xsl

Author: ferdinand
Date: Fri Feb 15 01:01:30 2008
New Revision: 627976

URL: http://svn.apache.org/viewvc?rev=627976&view=rev
Log:
Fix fop problem with empty <ul></ul> in linkmap. These where created where site has (unlabeled) local references that where processed only halfway. This fix narrows the test for processing child nodes so that child processing only starts if there is at least one labeled child.

Modified:
    forrest/branches/UpdateFOPto094/main/webapp/resources/stylesheets/linkmap-to-document.xsl

Modified: forrest/branches/UpdateFOPto094/main/webapp/resources/stylesheets/linkmap-to-document.xsl
URL: http://svn.apache.org/viewvc/forrest/branches/UpdateFOPto094/main/webapp/resources/stylesheets/linkmap-to-document.xsl?rev=627976&r1=627975&r2=627976&view=diff
==============================================================================
--- forrest/branches/UpdateFOPto094/main/webapp/resources/stylesheets/linkmap-to-document.xsl (original)
+++ forrest/branches/UpdateFOPto094/main/webapp/resources/stylesheets/linkmap-to-document.xsl Fri Feb 15 01:01:30 2008
@@ -15,14 +15,18 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-  <xsl:output method="xml" 
-               version="1.0" 
-               omit-xml-declaration="no" 
-               indent="yes"
-               doctype-public="-//APACHE//DTD Documentation V1.2//EN"
-               doctype-system="http://forrest.apache.org/dtd/document-v12.dtd" />
-  <xsl:template match="/">
+<xsl:stylesheet
+    version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+  <xsl:output
+        method="xml"
+        version="1.0"
+        omit-xml-declaration="no"
+        indent="yes"
+        doctype-public="-//APACHE//DTD Documentation V1.2//EN"
+        doctype-system="http://forrest.apache.org/dtd/document-v12.dtd" />
+  <xsl:template
+        match="/">
     <document>
       <header>
         <title>Site Linkmap Table of Contents</title>
@@ -34,30 +38,41 @@
 <!-- FIXME: FOR-731 workaround for a side-effect of the workaround for FOR-675
          <xsl:apply-templates select="*[not(self::site)]" />        
 -->
-        <xsl:apply-templates select="*" />
+        <xsl:apply-templates
+                    select="*" />
       </body>
     </document>
   </xsl:template>
-  <xsl:template match="*">
-    <xsl:if test="@label">
+  <xsl:template
+        match="*">
+    <xsl:if
+            test="@label">
       <ul>
         <li><a>
-          <xsl:if test="@href!=''">
-            <xsl:attribute name="href">
-              <xsl:value-of select="@href"/>
+          <xsl:if
+                            test="@href!=''">
+            <xsl:attribute
+                                name="href">
+              <xsl:value-of
+                                    select="@href" />
             </xsl:attribute>
           </xsl:if>
-          <xsl:value-of select="@label"/>
+          <xsl:value-of
+                            select="@label" />
 <!-- force site element name to be on same line as label --></a>&#160;&#160;___________________&#160;&#160;<em>
-          <xsl:value-of select="name(.)" /></em>
-          <xsl:if test="@description">
+          <xsl:value-of
+                            select="name(.)" /></em>
+          <xsl:if
+                        test="@description">
 <!-- allow description to flow to next line in a small window -->
 <xsl:text>&#160;: </xsl:text>
-            <xsl:value-of select="normalize-space(@description)"/>
+            <xsl:value-of
+                            select="normalize-space(@description)" />
           </xsl:if></li>
-        <xsl:if test="*">
+        <xsl:if
+                    test="*[@label!='']">
           <ul>
-            <xsl:apply-templates/>
+            <xsl:apply-templates />
           </ul>
         </xsl:if>
       </ul>