You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2009/04/16 14:24:44 UTC

svn commit: r765599 - in /lenya/branches/BRANCH_2_0_X/src: modules/cforms/xslt/cforms2xhtml.xsl modules/links/xslt/links2xhtml.xsl modules/opendocument/xslt/opendocument2xhtml.xsl modules/xhtml/xslt/xhtml2xhtml.xsl pubs/default/xslt/page2xhtml.xsl

Author: andreas
Date: Thu Apr 16 12:24:43 2009
New Revision: 765599

URL: http://svn.apache.org/viewvc?rev=765599&view=rev
Log:
Cleaning up contract for xhtml resource type format.

Modified:
    lenya/branches/BRANCH_2_0_X/src/modules/cforms/xslt/cforms2xhtml.xsl
    lenya/branches/BRANCH_2_0_X/src/modules/links/xslt/links2xhtml.xsl
    lenya/branches/BRANCH_2_0_X/src/modules/opendocument/xslt/opendocument2xhtml.xsl
    lenya/branches/BRANCH_2_0_X/src/modules/xhtml/xslt/xhtml2xhtml.xsl
    lenya/branches/BRANCH_2_0_X/src/pubs/default/xslt/page2xhtml.xsl

Modified: lenya/branches/BRANCH_2_0_X/src/modules/cforms/xslt/cforms2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/modules/cforms/xslt/cforms2xhtml.xsl?rev=765599&r1=765598&r2=765599&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/modules/cforms/xslt/cforms2xhtml.xsl (original)
+++ lenya/branches/BRANCH_2_0_X/src/modules/cforms/xslt/cforms2xhtml.xsl Thu Apr 16 12:24:43 2009
@@ -28,7 +28,7 @@
     >
 
   <xsl:template match="/">
-    <div id="body">
+    <html>
       <body>
         <h1>CForms/Ajax Example</h1>
         <p>
@@ -37,7 +37,7 @@
         </p>
         <xsl:apply-templates select="data"/>
       </body>
-    </div>
+    </html>
 
  </xsl:template>
 
@@ -46,20 +46,18 @@
   </xsl:template>
 
   <xsl:template match="contacts">
+    <h3>Contacts:</h3>
     <p>
-      <strong>Contacts:</strong>
-      <p>
-        <xsl:choose>
-          <xsl:when test="contact">
-            <ul>
-              <xsl:apply-templates/>
-            </ul>
-           </xsl:when>
-          <xsl:otherwise>
-            <i>No contacts to display.</i>
-          </xsl:otherwise>
-        </xsl:choose>
-      </p>
+      <xsl:choose>
+        <xsl:when test="contact">
+          <ul>
+            <xsl:apply-templates/>
+          </ul>
+         </xsl:when>
+        <xsl:otherwise>
+          <i>No contacts to display.</i>
+        </xsl:otherwise>
+      </xsl:choose>
     </p>
   </xsl:template>
 

Modified: lenya/branches/BRANCH_2_0_X/src/modules/links/xslt/links2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/modules/links/xslt/links2xhtml.xsl?rev=765599&r1=765598&r2=765599&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/modules/links/xslt/links2xhtml.xsl (original)
+++ lenya/branches/BRANCH_2_0_X/src/modules/links/xslt/links2xhtml.xsl Thu Apr 16 12:24:43 2009
@@ -10,12 +10,14 @@
   <xsl:param name="rendertype" select="''"/>
 
   <xsl:template match="default:links">
-    <div id="body">
-      <h1><xsl:value-of select="default:title"/></h1>
-      <ul>
-        <xsl:apply-templates select="default:link"/>
-      </ul>
-    </div>
+    <html>
+      <body>
+        <h1><xsl:value-of select="default:title"/></h1>
+        <ul>
+          <xsl:apply-templates select="default:link"/>
+        </ul>
+      </body>
+    </html>
   </xsl:template>
 
   <xsl:template match="default:link">

Modified: lenya/branches/BRANCH_2_0_X/src/modules/opendocument/xslt/opendocument2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/modules/opendocument/xslt/opendocument2xhtml.xsl?rev=765599&r1=765598&r2=765599&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/modules/opendocument/xslt/opendocument2xhtml.xsl (original)
+++ lenya/branches/BRANCH_2_0_X/src/modules/opendocument/xslt/opendocument2xhtml.xsl Thu Apr 16 12:24:43 2009
@@ -6,23 +6,22 @@
   xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
   xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
   xmlns:xlink="http://www.w3.org/1999/xlink"
->
-<xsl:import href="fallback://lenya/modules/opendocument/xslt/common/odt_to_xhtml.xsl"/>
-
-<!-- default parameter value -->
-<xsl:param name="rendertype" select="'null'"/>
-<xsl:param name="language" select="'none'"/>
-<xsl:param name="nodeid" select="'null'"/>
-
-<xsl:template match="office:document-content">
-  <div id="body">
-<!--
-Language: <xsl:value-of select="$language"/>
--->
-    <h1>OpenDocument Content (<a href="{$nodeid}.odt">ODT</a>)</h1>
-    <xsl:apply-templates select="office:body/office:text"/>
-  </div>
-</xsl:template>
-
-
+  >
+  <xsl:import href="fallback://lenya/modules/opendocument/xslt/common/odt_to_xhtml.xsl"/>
+  
+  <!-- default parameter value -->
+  <xsl:param name="rendertype" select="'null'"/>
+  <xsl:param name="language" select="'none'"/>
+  <xsl:param name="nodeid" select="'null'"/>
+  
+  <xsl:template match="office:document-content">
+    <html>
+      <body>
+        <h1>OpenDocument Content (<a href="{$nodeid}.odt">ODT</a>)</h1>
+        <xsl:apply-templates select="office:body/office:text"/>
+      </body>
+    </html>
+  </xsl:template>
+  
+  
 </xsl:stylesheet>

Modified: lenya/branches/BRANCH_2_0_X/src/modules/xhtml/xslt/xhtml2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/modules/xhtml/xslt/xhtml2xhtml.xsl?rev=765599&r1=765598&r2=765599&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/modules/xhtml/xslt/xhtml2xhtml.xsl (original)
+++ lenya/branches/BRANCH_2_0_X/src/modules/xhtml/xslt/xhtml2xhtml.xsl Thu Apr 16 12:24:43 2009
@@ -6,9 +6,9 @@
   The ASF licenses this file to You 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
-
+  
+  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.
@@ -19,36 +19,29 @@
 <!-- $Id: xhtml2xhtml.xsl 201776 2005-06-25 18:25:26Z gregor $ -->
 
 <xsl:stylesheet version="1.0"
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:xhtml="http://www.w3.org/1999/xhtml"
-    xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
-    xmlns="http://www.w3.org/1999/xhtml"
-    xmlns:ci="http://apache.org/cocoon/include/1.0" 
-    exclude-result-prefixes="xhtml lenya"
-    >
-    
-<xsl:include href="fallback://lenya/modules/xhtml/xslt/helper-object.xsl"/>
-<xsl:param name="rendertype" select="''"/>
-<xsl:param name="nodeid"/>
-
-<xsl:template match="/xhtml:html">
-  <html>
-    <body>
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:xhtml="http://www.w3.org/1999/xhtml"
+  xmlns:lenya="http://apache.org/cocoon/lenya/page-envelope/1.0" 
+  xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:ci="http://apache.org/cocoon/include/1.0" 
+  exclude-result-prefixes="xhtml lenya"
+  >
+  
+  <xsl:include href="fallback://lenya/modules/xhtml/xslt/helper-object.xsl"/>
+  <xsl:param name="rendertype" select="''"/>
+  <xsl:param name="nodeid"/>
+  
+  <xsl:template match="xhtml:body">
+    <xsl:copy>
       <div id="body">
         <xsl:if test="$rendertype = 'edit'">
           <xsl:attribute name="bxe_xpath">/xhtml:html/xhtml:body</xsl:attribute>
         </xsl:if>
-        <xsl:apply-templates select="xhtml:body/node()"/>
+        <xsl:apply-templates select="node()"/>
       </div>
-    </body>
-  </html>
-</xsl:template>
-
-<xsl:template match="@*|node()">
-  <xsl:copy>
-    <xsl:apply-templates select="@*|node()"/>
-  </xsl:copy>
-</xsl:template>
+    </xsl:copy>
+  </xsl:template>
+  
 
   <xsl:template name="substring-after-last">
     <xsl:param name="input"/>
@@ -66,9 +59,17 @@
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
-
+  
+  
   <xsl:template match="xhtml:a[@class = 'lenya.asset']">
     <ci:include src="{@href}?format=downloadLink"/>
   </xsl:template>
   
+  
+  <xsl:template match="@*|node()" priority="-1">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+  
 </xsl:stylesheet> 

Modified: lenya/branches/BRANCH_2_0_X/src/pubs/default/xslt/page2xhtml.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/pubs/default/xslt/page2xhtml.xsl?rev=765599&r1=765598&r2=765599&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/pubs/default/xslt/page2xhtml.xsl (original)
+++ lenya/branches/BRANCH_2_0_X/src/pubs/default/xslt/page2xhtml.xsl Thu Apr 16 12:24:43 2009
@@ -99,10 +99,7 @@
                 <div id="main">
                   <xsl:apply-templates select="xhtml:div[@id = 'breadcrumb']"/>
                   <xsl:apply-templates select="xhtml:div[@id = 'search']"/>
-                  <xsl:apply-templates select="xhtml:div[@id = 'body']"/>
-                  <xsl:if test="xhtml:html">
-                    <xsl:apply-templates select="xhtml:html/xhtml:body/*"/>
-                  </xsl:if>
+                  <xsl:apply-templates select="xhtml:html/xhtml:body"/>
                   <xsl:call-template name="footer"/>
                 </div>
               </td>
@@ -114,6 +111,20 @@
   </xsl:template>
   
   
+  <xsl:template match="xhtml:body">
+    <xsl:choose>
+      <xsl:when test="xhtml:div[@id = 'body']">
+        <xsl:apply-templates select="node()"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <div id="body">
+          <xsl:apply-templates select="node()"/>
+        </div>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  
   <xsl:template match="xhtml:div[@id = 'breadcrumb']">
     <xsl:if test="*">
       <xsl:copy>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org