forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ferdin...@apache.org
Subject svn commit: r306554 - in /forrest/branches/forrest_07_branch/main/webapp: resources/stylesheets/html2document.xsl skins/common/xslt/html/document2html.xsl skins/pelt/xslt/html/document2html.xsl
Date Thu, 06 Oct 2005 08:45:59 GMT
Author: ferdinand
Date: Thu Oct  6 01:45:42 2005
New Revision: 306554

URL: http://svn.apache.org/viewcvs?rev=306554&view=rev
Log:
Applied all fixes to these files in 0.8dev to 0.7 (mainly improving class and id handling)

Modified:
    forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl
    forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
    forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl

Modified: forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl
URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl?rev=306554&r1=306553&r2=306554&view=diff
==============================================================================
--- forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl
(original)
+++ forrest/branches/forrest_07_branch/main/webapp/resources/stylesheets/html2document.xsl
Thu Oct  6 01:45:42 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2004 The Apache Software Foundation or its licensors,
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -56,31 +56,16 @@
     </xsl:template>
         
     <xsl:template match="meta">
-      <xsl:text disable-output-escaping = "yes"><![CDATA[ <!-- ]]></xsl:text>
         <xsl:copy>
             <xsl:apply-templates select="node()|@*"/>
         </xsl:copy>
-      <xsl:text disable-output-escaping = "yes"><![CDATA[ --> ]]></xsl:text>

     </xsl:template>  
     
     <!--infer structure from sibling headings-->
     <xsl:template match="body">
        <body>
-         <xsl:choose>
-           <xsl:when test="h1">
-             <xsl:call-template name="process_h1"/>
-           </xsl:when>
-           <xsl:otherwise>
-             <section>
-               <xsl:if test="a/@name">
-                 <xsl:attribute name="id"><xsl:value-of select="a/@name"/></xsl:attribute>
-               </xsl:if>
-               <title/>
-               <xsl:apply-templates/>
-               <xsl:call-template name="process_h1"/>
-             </section>
-           </xsl:otherwise>
-         </xsl:choose>
+          <xsl:apply-templates select="*[1]" mode="next"/>
+          <xsl:call-template name="process_h1"/>
        </body>
     </xsl:template>
     
@@ -128,7 +113,7 @@
          </section>
        </xsl:for-each>
     </xsl:template>
-
+    
     <!--process each sibling in order until the next heading level-->
 
     <xsl:template match="*" mode="next">
@@ -258,9 +243,10 @@
     </xsl:template>
     
     <xsl:template match="table">
-      <table>
-            <xsl:apply-templates select="node()"/>
-      </table>
+      <xsl:copy>
+        <xsl:copy-of select="@*"/>
+        <xsl:apply-templates/>
+      </xsl:copy>    
     </xsl:template>
     
             

Modified: forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl?rev=306554&r1=306553&r2=306554&view=diff
==============================================================================
--- forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
(original)
+++ forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
Thu Oct  6 01:45:42 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2004 The Apache Software Foundation or its licensors,
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -137,7 +137,7 @@
 
   <xsl:template match="note | warning | fixme">
     <xsl:apply-templates select="@id"/>
-    <div class="frame {local-name()}">
+    <div class="{local-name()}">
       <div class="label">
         <xsl:choose>
           <!-- FIXME: i18n Transformer here -->
@@ -192,6 +192,7 @@
   <xsl:template match="p[@xml:space='preserve']">
     <xsl:apply-templates select="@id"/>
     <div class="pre">
+      <xsl:copy-of select="@id"/>
       <xsl:apply-templates/>
     </div>
   </xsl:template>
@@ -200,6 +201,7 @@
     <xsl:apply-templates select="@id"/>
     <pre class="code">
 <!-- Temporarily removed long-line-splitter ... gives out-of-memory problems -->
+      <xsl:copy-of select="@id"/>
       <xsl:apply-templates/>
 <!--
     <xsl:call-template name="format">
@@ -211,36 +213,59 @@
   </xsl:template>
 
   <xsl:template match="anchor">
-    <a name="{@id}"/>
+    <a name="{@id}">
+      <xsl:copy-of select="@id"/>
+    </a>
   </xsl:template>
 
   <xsl:template match="icon">
     <xsl:apply-templates select="@id"/>
     <img class="icon">
-        <xsl:copy-of select="@height | @width | @src | @alt"/>
+      <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
     </img>
   </xsl:template>
 
   <xsl:template match="code">
     <xsl:apply-templates select="@id"/>
-    <span class="codefrag"><xsl:value-of select="."/></span>
+    <span class="codefrag">
+      <xsl:copy-of select="@id"/>
+      <xsl:value-of select="."/>
+    </span>
   </xsl:template>
 
   <xsl:template match="figure">
     <xsl:apply-templates select="@id"/>
+    
     <div align="center">
+      <xsl:copy-of select="@id"/>
       <img class="figure">
-        <xsl:copy-of select="@height | @width | @src | @alt"/>
+        <xsl:copy-of select="@height | @width | @src | @alt | @id"/>
       </img>
     </div>
   </xsl:template>
 
   <xsl:template match="table">
     <xsl:apply-templates select="@id"/>
-    <table cellpadding="4" cellspacing="1" class="ForrestTable">
-      <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor"/>
-      <xsl:apply-templates/>
-    </table>
+    <xsl:choose>
+      <!-- Limit Forrest specific processing to tables without class -->
+      <xsl:when test="not(@class) or @class=''">
+        <table cellpadding="4" cellspacing="1" class="ForrestTable">
+          <xsl:copy-of select="@cellspacing | @cellpadding | @border | @class | @bgcolor
|@id"/>
+          <xsl:apply-templates/>
+        </table>    
+      </xsl:when>
+      <xsl:otherwise>
+        <!-- Tables with class are passed without change -->
+        <xsl:copy>
+          <xsl:copy-of select="@*"/>
+          <xsl:apply-templates/>
+        </xsl:copy>    
+        
+      </xsl:otherwise>
+    </xsl:choose>
+    <xsl:if test="@class = ''">
+      
+    </xsl:if>
   </xsl:template>
 
   <xsl:template match="acronym/@title">
@@ -359,8 +384,13 @@
   <!-- End of "toc" mode templates -->
 
   <xsl:template match="node()|@*" priority="-1">
+    <!-- id processing will create its own a-element so processing has to 
+         happen outside the copied element 
+    -->
+    <xsl:apply-templates select="@id"/>
     <xsl:copy>
-      <xsl:apply-templates select="@*"/>
+      <xsl:apply-templates select="@*[name(.) != 'id']"/>
+      <xsl:copy-of select="@id"/>
       <xsl:apply-templates/>
     </xsl:copy>
   </xsl:template>

Modified: forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl
URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl?rev=306554&r1=306553&r2=306554&view=diff
==============================================================================
--- forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl
(original)
+++ forrest/branches/forrest_07_branch/main/webapp/skins/pelt/xslt/html/document2html.xsl
Thu Oct  6 01:45:42 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
-  Copyright 2002-2004 The Apache Software Foundation or its licensors,
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
   as applicable.
 
   Licensed under the Apache License, Version 2.0 (the "License");
@@ -136,8 +136,8 @@
   
   <xsl:template match="figure">
     <xsl:apply-templates select="@id"/>
-    <div style="text-align: center;">
-      <img src="{@src}" alt="{@alt}" class="figure">
+    <div style="text-align: center;" id="{@id}">
+      <img src="{@src}" alt="{@alt}" class="figure"  id="{@id}">
         <xsl:if test="@height">
           <xsl:attribute name="height"><xsl:value-of select="@height"/></xsl:attribute>
         </xsl:if>



Mime
View raw message