forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r358159 - in /forrest/trunk/main/template-sites/v3/src/documentation: content/xdocs/ content/xdocs/samples/ resources/themes/common/html/ resources/themes/common/xhtml2/
Date Wed, 21 Dec 2005 00:24:03 GMT
Author: thorsten
Date: Tue Dec 20 16:23:42 2005
New Revision: 358159

URL: http://svn.apache.org/viewcvs?rev=358159&view=rev
Log:
Finished first version of xhtml2 support in v3. You can use now the xdocs/samples dir to store
more xhtml2 samples. The given common.fv in this directory uses a couple of new contracts
and is capable to render xhtml2 input in general.

Added:
    forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/body-to-xhtml2.fv
    forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/toc-to-xhtml2.fv
      - copied, changed from r357581, forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/abstract-to-xhtml2.fv
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-body.ft
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-toc.ft
      - copied, changed from r357581, forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/body.ft
      - copied, changed from r357566, forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/toc.ft
      - copied, changed from r357581, forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft
Modified:
    forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/common.fv
    forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/xhtml2_subset.xml
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-title.ft
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/title.ft

Added: forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/body-to-xhtml2.fv
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/body-to-xhtml2.fv?rev=358159&view=auto
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/body-to-xhtml2.fv
(added)
+++ forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/body-to-xhtml2.fv
Tue Dec 20 16:23:42 2005
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2002-2005 The Apache Software Foundation or its licensors,
+as applicable.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+  
+<forrest:views 
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"
+  xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+  <!-- The following variables are used to contact data models and/or contracts. -->
+  <jx:set var="getRequest" value="#{$cocoon/parameters/getRequest}"/>
+  <jx:set var="getRequestExstension" value="#{$cocoon/parameters/getRequestExstension}"
/>
+    <forrest:view type="xhtml2" hooksXpath="/">
+      <forrest:contract name="body" 
+        dataURI="cocoon://#{$getRequest}.source.rewritten.xml"/>
+    </forrest:view>
+</forrest:views>

Modified: forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/common.fv
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/common.fv?rev=358159&r1=358158&r2=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/common.fv
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/common.fv
Tue Dec 20 16:23:42 2005
@@ -91,14 +91,14 @@
           <forrest:contract name="xhtml2-content-title" 
             dataURI="cocoon://internal.#{$getRequest}.title"/>
           <forrest:contract name="xhtml2-content-abstract" 
-            dataURI="cocoon://internal.#{$getRequest}.abstract"/><!--
-          <forrest:contract name="content-minitoc" 
-            dataURI="cocoon://#{$getRequest}.toc.xml">
-            <forrest:property name="content-minitoc-conf" max-depth="2" 
-              min-sections="1" location="page"/>
+            dataURI="cocoon://internal.#{$getRequest}.abstract"/>
+          <forrest:contract name="xhtml2-content-toc" 
+            dataURI="cocoon://internal.#{$getRequest}.toc">
+            <forrest:property name="xhtml2-content-toc-conf" max-depth="5" 
+              min-sections="1" />
           </forrest:contract>
-          <forrest:contract name="content-main" 
-              dataURI="cocoon://#{$getRequest}.body.xml"/>-->
+          <forrest:contract name="xhtml2-content-body" 
+              dataURI="cocoon://internal.#{$getRequest}.body"/>
         </forrest:hook>
     </forrest:hook>
     <forrest:hook name="footer">

Modified: forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/xhtml2_subset.xml
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/xhtml2_subset.xml?rev=358159&r1=358158&r2=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/xhtml2_subset.xml
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/samples/xhtml2_subset.xml
Tue Dec 20 16:23:42 2005
@@ -39,8 +39,8 @@
 <h5><l>Quite a few examples given are taken directly from the <abbr>W3C</abbr>
site and possibly</l>
        <l> to the needs of Forrest. Examples should be tailored for our needs.</l></h5>
        <h6>We need a 'h6' element , need to apply 'FIXME' or  'ToDo' labels where suitable.</h6>
-<section><h>8 XHTML Structural Module</h>
-<section><h>8.1 Address Element</h>
+<section title="first section" class="xxx"><h>8 XHTML Structural Module</h>
+<section id="test" title="second section"><h>8.1 Address Element</h>
 <address href="mailto:webmaster@apache.org">Webmaster</address>
 </section>
 <separator />

Copied: forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/toc-to-xhtml2.fv
(from r357581, forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/abstract-to-xhtml2.fv)
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/toc-to-xhtml2.fv?p2=forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/toc-to-xhtml2.fv&p1=forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/abstract-to-xhtml2.fv&r1=357581&r2=358159&rev=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/abstract-to-xhtml2.fv
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/content/xdocs/toc-to-xhtml2.fv
Tue Dec 20 16:23:42 2005
@@ -23,7 +23,7 @@
   <jx:set var="getRequest" value="#{$cocoon/parameters/getRequest}"/>
   <jx:set var="getRequestExstension" value="#{$cocoon/parameters/getRequestExstension}"
/>
     <forrest:view type="xhtml2" hooksXpath="/">
-      <forrest:contract name="abstract" 
+      <forrest:contract name="toc" 
         dataURI="cocoon://#{$getRequest}.xml"/>
     </forrest:view>
 </forrest:views>

Modified: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft?rev=358159&r1=358158&r2=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft
Tue Dec 20 16:23:42 2005
@@ -22,7 +22,7 @@
   <description>
     xhtml2-content-abstract - Template will output the abstract of the document. 
   </description>
-  <usage><![CDATA[<forrest:contract name="siteinfo-meta" dataURI="cocoon://#{$getRequest}.abstract.xml"/>
+  <usage><![CDATA[<forrest:contract name="xhtml2-content-abstract" dataURI="cocoon://internal.#{$getRequest}.abstract"/>
 ]]></usage>
   <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
     name="xhtml2-content-abstract" inputFormat="xsl">

Added: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-body.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-body.ft?rev=358159&view=auto
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-body.ft
(added)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-body.ft
Tue Dec 20 16:23:42 2005
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Copyright 2002-2005 The Apache Software Foundation or its licensors,
+  as applicable.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<forrest:contract 
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+  xmlns:forrest="http://apache.org/forrest/templates/1.0"
+  xmlns:html="http://www.w3.org/2002/06/xhtml2"
+  name="xhtml2-content-body">
+  <description>
+    xhtml2-content-body - Template will output the xhtml2-content-body.
+  </description>
+  <usage><![CDATA[<forrest:contract name="xhtml2-content-body" 
+            dataURI="cocoon://#{$getRequest}.body.xml"/>]]></usage>
+  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="xhtml2-content-body" inputFormat="xsl">
+     <xsl:stylesheet version="1.1" 
+      xmlns:html="http://www.w3.org/2002/06/xhtml2"
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+      exclude-result-prefixes="html xsl">
+      <!--<xsl:include href="lm://transform.xhtml2.html.structurer"/>-->
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part xpath="/html/head">
+            <xsl:comment>+ |start xhtml2-content-body head +</xsl:comment>
+            <xsl:copy-of select="html/head/*" />
+            <xsl:comment>+ |end xhtml2-content-body head +</xsl:comment>
+          </forrest:part>
+          <forrest:part>
+            <xsl:comment>+ |start xhtml2-content-body body +</xsl:comment>
+            <xsl:copy-of select="html/body/*" />
+            <xsl:comment>+ |end xhtml2-content-body body +</xsl:comment>
+          </forrest:part>
+        </forrest:content>
+      </xsl:template>
+	  </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>
\ No newline at end of file

Modified: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-title.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-title.ft?rev=358159&r1=358158&r2=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-title.ft
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-title.ft
Tue Dec 20 16:23:42 2005
@@ -22,7 +22,7 @@
   <description>
     xhtml2-content-title - Template will output the title of the document. 
   </description>
-  <usage><![CDATA[<forrest:contract name="siteinfo-meta" dataURI="cocoon://#{$getRequest}.title.xml"/>
+  <usage><![CDATA[<forrest:contract name="xhtml2-content-title" dataURI="cocoon://internal.#{$getRequest}.title"/>
 ]]></usage>
   <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
     name="xhtml2-content-title" inputFormat="xsl">

Copied: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-toc.ft
(from r357581, forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft)
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-toc.ft?p2=forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-toc.ft&p1=forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft&r1=357581&r2=358159&rev=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-abstract.ft
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/xhtml2-content-toc.ft
Tue Dec 20 16:23:42 2005
@@ -18,26 +18,58 @@
 <forrest:contract 
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
   xmlns:forrest="http://apache.org/forrest/templates/1.0"
-  name="xhtml2-content-abstract">
+  name="xhtml2-content-toc">
   <description>
-    xhtml2-content-abstract - Template will output the abstract of the document. 
+    xhtml2-content-toc - Template will output the abstract of the document. 
   </description>
-  <usage><![CDATA[<forrest:contract name="siteinfo-meta" dataURI="cocoon://#{$getRequest}.abstract.xml"/>
+  <usage><![CDATA[<forrest:contract name="xhtml2-content-toc" dataURI="cocoon://internal.#{$getRequest}.toc">
+  <forrest:property name="xhtml2-content-toc-conf" max-depth="2" min-sections="1" />
+</forrest:contract>
 ]]></usage>
   <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
-    name="xhtml2-content-abstract" inputFormat="xsl">
+    name="xhtml2-content-toc" inputFormat="xsl">
      <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-       <xsl:param name="xhtml2-content-abstract" select="/"/>
+      <xsl:param name="xhtml2-content-toc" select="/"/>
+      <xsl:param name="xhtml2-content-toc-conf"/>
       <xsl:template match="/">
         <forrest:content>
           <forrest:part>
-            <xsl:comment>+ |start xhtml2-content-abstract +</xsl:comment>
-            <div class="abstract">
-              <xsl:value-of select="$xhtml2-content-abstract"/>
-            </div>
-            <xsl:comment>+ |end xhtml2-content-abstract +</xsl:comment>
+            <xsl:comment>+ |start xhtml2-content-toc +</xsl:comment>
+            <xsl:if 
+              test="count(*[@id='tocitems']/*) >= $xhtml2-content-toc-conf/@min-sections">
+              <div id="xhtml2-content-toc-area">
+                <xsl:call-template name="xhtml2-content-toc-processing">
+                  <xsl:with-param name="tocroot" select="*[@id='tocitems']"/>
+                </xsl:call-template>
+              </div>
+            </xsl:if>
+            <xsl:comment>+ |end xhtml2-content-toc +</xsl:comment>
           </forrest:part>
         </forrest:content>
+      </xsl:template>
+      <xsl:template name="xhtml2-content-toc-processing">
+        <xsl:param name="tocroot"/>
+        <xsl:if 
+          test="count($tocroot/*) >= $xhtml2-content-toc-conf/@min-sections">
+            <ul class="minitoc">
+              <xsl:for-each select="$tocroot/*">
+                <li>
+                  <a href="{@href}">
+                    <xsl:if test="not(@title='')">
+                      <xsl:value-of select="@title"/>
+                    </xsl:if>
+                    <xsl:if test="@title=''"> No title </xsl:if>
+                  </a>
+                  <xsl:if 
+                    test="@class&lt;$xhtml2-content-toc-conf/@max-depth+1">
+                    <xsl:call-template name="xhtml2-content-toc-processing">
+                      <xsl:with-param name="tocroot" select="."/>
+                    </xsl:call-template>
+                  </xsl:if>
+                </li>
+              </xsl:for-each>
+            </ul>
+        </xsl:if>
       </xsl:template>
     </xsl:stylesheet>
   </forrest:template>

Modified: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft?rev=358159&r1=358158&r2=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft
Tue Dec 20 16:23:42 2005
@@ -18,7 +18,7 @@
 <forrest:contract 
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
   xmlns:forrest="http://apache.org/forrest/templates/1.0"
-  xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
+  xmlns:html="http://www.w3.org/2002/06/xhtml2"
   name="abstract">
   
   <description>
@@ -28,22 +28,22 @@
   <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
     name="abstract" inputFormat="xsl">
     <xsl:stylesheet version="1.1" 
-      xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
+      xmlns:html="http://www.w3.org/2002/06/xhtml2"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       <!--<xsl:param name="defaultVariables" select="'test.html'"/>-->
       <!--<xsl:variable name="skin-img-dir" select="$defaultVariables/*/*[@name='skin-img-dir']/@value"/>-->
       <xsl:template match="/">
         <forrest:content>
           <forrest:part>
-            <xsl:apply-templates select="xhtml2:html/xhtml2:head"/>
+            <xsl:apply-templates select="html:html/html:head"/>
           </forrest:part>
         </forrest:content>
       </xsl:template>
-      <xsl:template match="xhtml2:head">
-          <xsl:if test="xhtml2:meta [@property='abstract']">
-            <xsl:copy-of select="xhtml2:meta[@property='abstract']"/>
+      <xsl:template match="html:head">
+          <xsl:if test="html:meta [@property='abstract']">
+            <xsl:copy-of select="html:meta[@property='abstract']"/>
           </xsl:if>
-          <xsl:if test="not(xhtml2:meta[@property='abstract'])">
+          <xsl:if test="not(html:meta[@property='abstract'])">
             <meta property="abstract"/>
           </xsl:if>
         </xsl:template>

Modified: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft?rev=358159&r1=358158&r2=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft
Tue Dec 20 16:23:42 2005
@@ -18,7 +18,7 @@
 <forrest:contract 
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
   xmlns:forrest="http://apache.org/forrest/templates/1.0"
-  xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
+  xmlns:html="http://www.w3.org/2002/06/xhtml2"
   name="blank">
   
   <!--NOTE: 
@@ -31,7 +31,7 @@
   <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
     name="blank" inputFormat="xsl">
     <xsl:stylesheet version="1.1" 
-      xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
+      xmlns:html="http://www.w3.org/2002/06/xhtml2"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       <!--<xsl:param name="defaultVariables" select="'test.html'"/>-->
       <!--<xsl:variable name="skin-img-dir" select="$defaultVariables/*/*[@name='skin-img-dir']/@value"/>-->

Copied: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/body.ft
(from r357566, forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft)
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/body.ft?p2=forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/body.ft&p1=forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft&r1=357566&r2=358159&rev=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/blank.ft
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/body.ft
Tue Dec 20 16:23:42 2005
@@ -18,27 +18,34 @@
 <forrest:contract 
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
   xmlns:forrest="http://apache.org/forrest/templates/1.0"
-  xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
-  name="blank">
+  xmlns:html="http://www.w3.org/2002/06/xhtml2"
+  name="body">
   
   <!--NOTE: 
-    When using the blank template as c'n p master just search and replace 'blank' by the
{contract-name}!-->
+    When using the body template as c'n p master just search and replace 'body' by the {contract-name}!-->
   
   <description>
-    blank will output {contract-funtion}. This is just a blank contract, it will output *nothing*.
+    body will output {contract-funtion}. This is just a body contract, it will output *nothing*.
   </description>
-  <usage><![CDATA[<forrest:contract name="blank"/>]]></usage>
-  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
-    name="blank" inputFormat="xsl">
-    <xsl:stylesheet version="1.1" 
-      xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
-      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-      <!--<xsl:param name="defaultVariables" select="'test.html'"/>-->
-      <!--<xsl:variable name="skin-img-dir" select="$defaultVariables/*/*[@name='skin-img-dir']/@value"/>-->
+  <usage><![CDATA[<forrest:contract name="body"/>]]></usage>
+  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0" 
+    name="body" inputFormat="xsl">
+    <xsl:stylesheet version="1.1" xmlns:html="http://www.w3.org/2002/06/xhtml2" 
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+      exclude-result-prefixes="html xsl">
+      <xsl:include href="lm://transform.xhtml2.html.structurer"/>
       <xsl:template match="/">
         <forrest:content>
-          <!--<forrest:part/>-->
-          <!--<forrest:part xpath="/html/head"/>-->
+          <forrest:part xpath="/html/head">
+            <xsl:comment>+ |start xhtml2-content-body head +</xsl:comment>
+            <xsl:apply-templates select="html:html/html:head/*" />
+            <xsl:comment>+ |end xhtml2-content-body head +</xsl:comment>
+          </forrest:part>
+          <forrest:part xpath="/html/body">
+            <xsl:comment>+ |start xhtml2-content-body body +</xsl:comment>
+            <xsl:apply-templates select="html:html/html:body/*" />
+            <xsl:comment>+ |end xhtml2-content-body body +</xsl:comment>
+          </forrest:part>
         </forrest:content>
       </xsl:template>
     </xsl:stylesheet>

Modified: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/title.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/title.ft?rev=358159&r1=358158&r2=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/title.ft
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/title.ft
Tue Dec 20 16:23:42 2005
@@ -18,7 +18,7 @@
 <forrest:contract 
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
   xmlns:forrest="http://apache.org/forrest/templates/1.0"
-   xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
+   xmlns:html="http://www.w3.org/2002/06/xhtml2"
   name="title">
   <description>
     title - Templates for "title" mode.  
@@ -30,19 +30,19 @@
     name="title" inputFormat="xsl">
       <xsl:stylesheet version="1.1" 
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-        xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2">
+        xmlns:html="http://www.w3.org/2002/06/xhtml2">
         <xsl:param name="title" select="/"/>
         <xsl:template match="/">
           <forrest:content>
             <forrest:part>
-              <xsl:apply-templates select="xhtml2:html/xhtml2:head"/>
+              <xsl:apply-templates select="html:html/html:head"/>
             </forrest:part>
           </forrest:content>
         </xsl:template>
-        <xsl:template match="xhtml2:head">
+        <xsl:template match="html:head">
           <xsl:choose>
-            <xsl:when test="xhtml2:title">
-              <xsl:copy-of select="xhtml2:title"/>
+            <xsl:when test="html:title">
+              <xsl:copy-of select="html:title"/>
             </xsl:when>
             <xsl:otherwise>
               <title>*No* title found</title>

Copied: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/toc.ft
(from r357581, forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft)
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/toc.ft?p2=forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/toc.ft&p1=forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft&r1=357581&r2=358159&rev=358159&view=diff
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/abstract.ft
(original)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/xhtml2/toc.ft
Tue Dec 20 16:23:42 2005
@@ -18,35 +18,47 @@
 <forrest:contract 
   xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
   xmlns:forrest="http://apache.org/forrest/templates/1.0"
-  xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
-  name="abstract">
+  xmlns:html="http://www.w3.org/2002/06/xhtml2"
+  name="toc">
   
   <description>
-    abstract will output the documtent abstract.
+    toc will output the documtent toc.
   </description>
-  <usage><![CDATA[<forrest:contract name="abstract"/>]]></usage>
+  <usage><![CDATA[<forrest:contract name="toc" dataURI="cocoon://#{$getRequest}.xml"/>]]></usage>
   <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
-    name="abstract" inputFormat="xsl">
+    name="toc" inputFormat="xsl">
     <xsl:stylesheet version="1.1" 
-      xmlns:xhtml2="http://www.w3.org/2002/06/xhtml2"
+      xmlns:html="http://www.w3.org/2002/06/xhtml2" 
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-      <!--<xsl:param name="defaultVariables" select="'test.html'"/>-->
-      <!--<xsl:variable name="skin-img-dir" select="$defaultVariables/*/*[@name='skin-img-dir']/@value"/>-->
+      <xsl:include href="lm://transform.xml.generateId"/>
       <xsl:template match="/">
         <forrest:content>
           <forrest:part>
-            <xsl:apply-templates select="xhtml2:html/xhtml2:head"/>
+            <xsl:apply-templates select="html:html/html:body" mode="toc"/>
           </forrest:part>
         </forrest:content>
       </xsl:template>
-      <xsl:template match="xhtml2:head">
-          <xsl:if test="xhtml2:meta [@property='abstract']">
-            <xsl:copy-of select="xhtml2:meta[@property='abstract']"/>
-          </xsl:if>
-          <xsl:if test="not(xhtml2:meta[@property='abstract'])">
-            <meta property="abstract"/>
-          </xsl:if>
-        </xsl:template>
+      <xsl:template match="html:body" mode="toc">
+        <div id="tocitems">
+          <xsl:apply-templates select="html:section" mode="toc">
+            <xsl:with-param name="level" select="1"/>
+          </xsl:apply-templates>
+        </div>
+      </xsl:template>
+      <xsl:template match="html:section" mode="toc">
+        <xsl:param name="level"/>
+        <div class="{$level}">
+          <xsl:attribute name="href">#<xsl:call-template 
+            name="generate-id"/></xsl:attribute>
+          <xsl:attribute name="title">
+            <xsl:value-of select="@title"/>
+          </xsl:attribute>
+          <xsl:apply-templates mode="toc">
+            <xsl:with-param name="level" select="$level+1"/>
+          </xsl:apply-templates>
+        </div>
+      </xsl:template>
+      <xsl:template match="node()|@*" mode="toc"/>
     </xsl:stylesheet>
   </forrest:template>
 </forrest:contract>



Mime
View raw message