forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r357277 - /forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/master.ft
Date Sat, 17 Dec 2005 02:31:50 GMT
Author: thorsten
Date: Fri Dec 16 18:31:43 2005
New Revision: 357277

URL: http://svn.apache.org/viewcvs?rev=357277&view=rev
Log:
Added a master contract which we can use to explain the contract concept. It will output only
explanation from the contract but not aimed to be usable in production.

Added:
    forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/master.ft

Added: forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/master.ft
URL: http://svn.apache.org/viewcvs/forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/master.ft?rev=357277&view=auto
==============================================================================
--- forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/master.ft
(added)
+++ forrest/trunk/main/template-sites/v3/src/documentation/resources/themes/common/html/master.ft
Fri Dec 16 18:31:43 2005
@@ -0,0 +1,78 @@
+<?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"
+  name="master">
+  
+  <!--NOTE: 
+  THIS IS JUST AN EXPLANATION!!!-->
+  <description>
+    <p> This is just a master contract, it will output something but *nothing* in special.
It should 
+      just serve to explain a wee bit contracts and what you can do with them. 
+      </p>
+  </description>
+  <usage><![CDATA[<forrest:contract name="master"/>]]></usage>
+  <forrest:template xmlns:forrest="http://apache.org/forrest/templates/1.0"
+    name="master" inputFormat="xsl">
+    <xsl:stylesheet version="1.1" 
+      xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+      <!-- If you need default variables: -->
+      <!--<xsl:param name="defaultVariables" select="'test.html'"/>-->
+      <!-- then extract the variable like: -->
+      <!--<xsl:variable name="skin-img-dir" select="$defaultVariables/*/*[@name='skin-img-dir']/@value"/>-->
+      <!-- more information which variables are aviable can be found at lm://transform.xml.variable.helper

+        
+          FIXME: This property xsl is in early stage and aims to be connected to the new
established input module based one.
+          We need to write a custom generator for this. The generator will contact the prop-input
module to get all aviable key/values and
+          outputs them to xml (dtd like forrest.properties.xml). -->
+          
+          <!-- Since contracts are standalone every implementation has to be invoked by
some input.-->
+          
+          <!--  That means for xsl contracts that they are working for any xml input.

+          We need to match the root element to invoke the contract processing!!! 
+          If no data model is requested by the structurer, the dispatcher will use a foo-doc
in the transformation.
+          That means that matching "/" always will work. -->
+      <xsl:template match="/">
+        <!-- The dispatcher needs a well-formed xml document to work with. 
+            The forrest:content element (as root element) can contain as many forrest:part's
as you want. -->
+        <forrest:content>
+          <!-- forrest:part within this element the actual content is going to. 
+            If you use no @xpath then we insert content on the current structurer position.-->
+          <forrest:part>
+            Content going to the location defined by the structurer.
+          </forrest:part>
+          <!--If you want to inject the content into a certain DOM position and
+              *not* the current position in the structurer, you can use the @xpath attribute.
-->
+          <forrest:part xpath="/html/head">
+            Content going to a fixed location defined by the contract (here: /html/head).
+          </forrest:part>
+        </forrest:content>
+      </xsl:template>
+      <!-- copy n paste -->
+      <!--
+      <xsl:template match="/">
+        <forrest:content>
+          <forrest:part/>
+          <forrest:part xpath="/html/head"/>
+        </forrest:content>
+      </xsl:template>
+      -->
+    </xsl:stylesheet>
+  </forrest:template>
+</forrest:contract>
\ No newline at end of file



Mime
View raw message