Update of /var/cvs/applications/richtext/config/xslt
In directory james.mmbase.org:/tmp/cvs-serv10245

Modified Files:
        2xhtml.xslt mmxf2kupu.xslt mmxf2xhtml.xslt 
Log Message:
support for flash. MMB-1720


See also: http://cvs.mmbase.org/viewcvs/applications/richtext/config/xslt
See also: http://www.mmbase.org/jira/browse/MMB-1720


Index: 2xhtml.xslt
===================================================================
RCS file: /var/cvs/applications/richtext/config/xslt/2xhtml.xslt,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- 2xhtml.xslt 24 Jul 2008 10:45:48 -0000      1.29
+++ 2xhtml.xslt 19 Sep 2008 16:04:32 -0000      1.30
@@ -3,7 +3,7 @@
   org.mmbase.bridge.util.Generator, and the XSL is invoked by FormatterTag.
 
   @author:  Michiel Meeuwissen
-  @version: $Id: 2xhtml.xslt,v 1.29 2008/07/24 10:45:48 michiel Exp $
+  @version: $Id: 2xhtml.xslt,v 1.30 2008/09/19 16:04:32 michiel Exp $
   @since:   MMBase-1.6
 -->
 <xsl:stylesheet
@@ -12,6 +12,7 @@
     xmlns:taglib="org.mmbase.bridge.jsp.taglib.functions.Functions"
     xmlns:o="http://www.mmbase.org/xmlns/objects";
     xmlns:mmxf="http://www.mmbase.org/xmlns/mmxf";
+    xmlns="http://www.w3.org/1999/xhtml";
     exclude-result-prefixes="node mmxf o taglib"
     version="1.0" >
 
@@ -124,7 +125,7 @@
       For images, and atachments, the URL is determined a bit differently.
   -->
   <xsl:template match="o:[EMAIL PROTECTED] = 'images']|o:[EMAIL PROTECTED] 
='attachments']|o:[EMAIL PROTECTED]'icaches']" mode="url">
-    <xsl:value-of select="node:saxonFunction($cloud, string(@id), 
'servletpath')" />
+    <xsl:value-of select="node:saxonFunction($cloud, string(@id), 'url')" />
   </xsl:template>
 
   <!--
@@ -167,6 +168,7 @@
     <xsl:param name="relation" />
     <xsl:param name="position" />
     <xsl:param name="last" />
+    INLINE
     <a>
       <xsl:attribute name="href"><xsl:apply-templates select="." mode="url" 
/></xsl:attribute>
       <xsl:attribute name="id"><xsl:value-of select="$relation/o:[EMAIL 
PROTECTED] = 'id']" /></xsl:attribute>
@@ -184,6 +186,7 @@
   <xsl:template match="o:object" mode="inline_body">
     <xsl:param name="relation" />
     <xsl:param name="body" />
+    INLINEBodY
     <a>
       <xsl:attribute name="href"><xsl:apply-templates select="." mode="url" 
/></xsl:attribute>
       <xsl:attribute name="id"><xsl:value-of select="$relation/o:[EMAIL 
PROTECTED] = 'id']" /></xsl:attribute>
@@ -231,7 +234,7 @@
       </xsl:choose>
     </xsl:variable>
     <xsl:variable name="icache" select="node:nodeFunction(., $cloud, 
string(./@id), 'cachednode', $thumb)" />
-    <img src="{node:saxonFunction($cloud, string($icache/@id ), 
'servletpath')}" >
+    <img src="{node:saxonFunction($cloud, string($icache/@id ), 'url')}" >
       <xsl:attribute name="alt"><xsl:apply-templates select="." mode="title" 
/></xsl:attribute>
       <xsl:attribute name="class"><xsl:value-of select="$relation/o:[EMAIL 
PROTECTED]'class']"  /></xsl:attribute>
       <xsl:if test="$icache/o:[EMAIL PROTECTED]'width']">
@@ -247,6 +250,7 @@
   -->
   <xsl:template match="o:object" mode="in_a">
     <xsl:param name="relation" />
+    INA
     <xsl:apply-templates select="." mode="title" />
     <xsl:apply-templates select="." mode="inline">
       <xsl:with-param name="relation" select="$relation" />
@@ -320,7 +324,7 @@
           </xsl:when>
           <xsl:otherwise>
             <xsl:variable name="icache" select="node:nodeFunction(., $cloud, 
string(./@id), 'cachednode', $popupsize)" />
-            <xsl:variable name="href"><xsl:value-of 
select="node:saxonFunction($cloud, string($icache/@id ), 'servletpath')" 
/></xsl:variable>
+            <xsl:variable name="href"><xsl:value-of 
select="node:saxonFunction($cloud, string($icache/@id ), 'url')" 
/></xsl:variable>
             <xsl:variable name="width"><xsl:value-of 
select="node:saxonFunction($cloud, string($icache/@id ), 'width')" 
/></xsl:variable>
             <xsl:variable name="height"><xsl:value-of 
select="node:saxonFunction($cloud, string($icache/@id ), 'height')" 
/></xsl:variable>
             <a href="{$href}"
@@ -373,6 +377,37 @@
     <xsl:if test="$position != $last">,</xsl:if>
   </xsl:template>
 
+  <xsl:template match="o:[EMAIL PROTECTED] = 'flashobjects']" mode="inline">
+    <xsl:param name="relation" />
+    <xsl:param name="position" />
+    <xsl:param name="last" />
+    <object
+            type="application/x-shockwave-flash">
+      <xsl:attribute name="class"><xsl:value-of select="$relation/o:[EMAIL 
PROTECTED]'class']"  /></xsl:attribute>
+      <xsl:attribute name="height">
+        <xsl:choose>
+          <xsl:when test="o:[EMAIL PROTECTED]'height'] != ''">
+            <xsl:value-of select="o:[EMAIL PROTECTED]'height']" />
+          </xsl:when>
+          <xsl:otherwise>100</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:attribute name="width">
+        <xsl:choose>
+          <xsl:when test="o:[EMAIL PROTECTED]'width'] != ''">
+            <xsl:value-of select="o:[EMAIL PROTECTED]'width']" />
+          </xsl:when>
+          <xsl:otherwise>100</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:attribute name="data"><xsl:apply-templates select="." mode="url" 
/></xsl:attribute>
+      <param name="movie">
+        <xsl:attribute name="value"><xsl:apply-templates select="." mode="url" 
/></xsl:attribute>
+      </param>
+    </object>
+    <xsl:if test="$position != $last">,</xsl:if>
+  </xsl:template>
+
 
   <!--
       Given a relation object, produces a value for a style-class attribute in 
HTML.
@@ -439,8 +474,6 @@
 
 
 
-
-
   <!--
        Produces at title for one o:object
   -->


Index: mmxf2kupu.xslt
===================================================================
RCS file: /var/cvs/applications/richtext/config/xslt/mmxf2kupu.xslt,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -b -r1.14 -r1.15
--- mmxf2kupu.xslt      6 Apr 2007 12:21:07 -0000       1.14
+++ mmxf2kupu.xslt      19 Sep 2008 16:04:32 -0000      1.15
@@ -3,7 +3,7 @@
   org.mmbase.bridge.util.Generator, and the XSL is invoked by FormatterTag.
 
   @author:  Michiel Meeuwissen
-  @version: $Id: mmxf2kupu.xslt,v 1.14 2007/04/06 12:21:07 michiel Exp $
+  @version: $Id: mmxf2kupu.xslt,v 1.15 2008/09/19 16:04:32 michiel Exp $
   @since:   MMBase-1.6
 -->
 <xsl:stylesheet
@@ -12,6 +12,7 @@
     xmlns:o="http://www.mmbase.org/xmlns/objects";
     xmlns:mmxf="http://www.mmbase.org/xmlns/mmxf";
     xmlns:html="http://www.w3.org/1999/xhtml";
+    xmlns="http://www.w3.org/1999/xhtml";
     exclude-result-prefixes="node o mmxf html"
     version = "1.0"
     >
@@ -50,7 +51,7 @@
         <xsl:apply-templates select="o:[EMAIL PROTECTED]'xml'][1]/mmxf:mmxf" />
       </xsl:when>
       <xsl:otherwise><!-- should present _something_, FF may hang otherwise -->
-        <body>
+        <body  xmlns="http://www.w3.org/1999/xhtml";>
           <xsl:text>&#xA;</xsl:text>
           <xsl:apply-templates />
           <xsl:text>&#xA;</xsl:text>
@@ -255,6 +256,34 @@
     <xsl:if test="$position != $last">,</xsl:if>
   </xsl:template>
 
+  <xsl:template match="o:[EMAIL PROTECTED] = 'flashobjects']" mode="inline">
+    <xsl:param name="relation" />
+    <xsl:param name="position" />
+    <xsl:param name="last" />
+    <xsl:variable name="url"><xsl:value-of select="$formatter_requestcontext" 
/>/mmbase/kupu/mmbase/icons/flash.png?o=<xsl:value-of select="o:[EMAIL 
PROTECTED]'number']" /></xsl:variable>
+    <img>
+      <xsl:attribute name="class"><xsl:value-of select="$relation/o:[EMAIL 
PROTECTED]'class']"  /></xsl:attribute>
+      <xsl:attribute name="height">
+        <xsl:choose>
+          <xsl:when test="o:[EMAIL PROTECTED]'height'] != ''">
+            <xsl:value-of select="o:[EMAIL PROTECTED]'height']" />
+          </xsl:when>
+          <xsl:otherwise>100</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:attribute name="width">
+        <xsl:choose>
+          <xsl:when test="o:[EMAIL PROTECTED]'width'] != ''">
+            <xsl:value-of select="o:[EMAIL PROTECTED]'width']" />
+          </xsl:when>
+          <xsl:otherwise>100</xsl:otherwise>
+        </xsl:choose>
+      </xsl:attribute>
+      <xsl:attribute name="src"><xsl:value-of select="$url" /></xsl:attribute>
+    </img>
+    <xsl:if test="$position != $last">,</xsl:if>
+  </xsl:template>
+
 
   <xsl:template match="o:[EMAIL PROTECTED]'segments']" mode="inline_body">
     <xsl:param name="relation" />
@@ -293,7 +322,7 @@
   </xsl:template>
 
 
-  <xsl:template match="o:[EMAIL PROTECTED] != 'images' and @type != 'icaches' 
and @type != 'urls' and @type != 'blocks']" mode="url" priority="1">
+  <xsl:template match="o:[EMAIL PROTECTED] != 'images' and @type != 'icaches' 
and @type != 'urls' and @type != 'blocks' and @type != 'flashobjects']" 
mode="url" priority="1">
     <xsl:text>mmbase://</xsl:text><xsl:value-of select="@type" 
/><xsl:text>/</xsl:text><xsl:value-of select="@id" />
   </xsl:template>
 


Index: mmxf2xhtml.xslt
===================================================================
RCS file: /var/cvs/applications/richtext/config/xslt/mmxf2xhtml.xslt,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- mmxf2xhtml.xslt     22 Apr 2008 11:16:59 -0000      1.9
+++ mmxf2xhtml.xslt     19 Sep 2008 16:04:32 -0000      1.10
@@ -5,12 +5,13 @@
   MMXF itself is, besides the mmxf tag itself, nearly a subset of XHTML2, so 
this XSLT is pretty straightforward.
 
 
-  @version $Id: mmxf2xhtml.xslt,v 1.9 2008/04/22 11:16:59 michiel Exp $
+  @version $Id: mmxf2xhtml.xslt,v 1.10 2008/09/19 16:04:32 michiel Exp $
   @author Michiel Meeuwissen
 -->
 <xsl:stylesheet
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
   xmlns:mmxf="http://www.mmbase.org/xmlns/mmxf";
+    xmlns="http://www.w3.org/1999/xhtml";
   exclude-result-prefixes="mmxf"
   version = "1.0"
 >
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to