cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anto...@apache.org
Subject svn commit: r106880 - in cocoon/branches/BRANCH_2_1_X: . src/blocks/scratchpad/samples/sitemap-viewer/transforms src/webapp/resources/scripts src/webapp/resources/styles src/webapp/stylesheets/system
Date Mon, 29 Nov 2004 04:26:04 GMT
Author: antonio
Date: Sun Nov 28 20:26:02 2004
New Revision: 106880

URL: http://svn.apache.org/viewcvs?view=rev&rev=106880
Log:
Bug #30043: [PATCH] xml2html.xslt does not work on IE
Added:
   cocoon/branches/BRANCH_2_1_X/src/webapp/resources/scripts/prettycontent.js
   cocoon/branches/BRANCH_2_1_X/src/webapp/resources/styles/prettycontent.css
Modified:
   cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/samples/sitemap-viewer/transforms/xml2html.xslt
   cocoon/branches/BRANCH_2_1_X/src/webapp/stylesheets/system/xml2html.xslt
   cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/samples/sitemap-viewer/transforms/xml2html.xslt
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/samples/sitemap-viewer/transforms/xml2html.xslt?view=diff&rev=106880&p1=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/samples/sitemap-viewer/transforms/xml2html.xslt&r1=106879&p2=cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/samples/sitemap-viewer/transforms/xml2html.xslt&r2=106880
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/samples/sitemap-viewer/transforms/xml2html.xslt
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/scratchpad/samples/sitemap-viewer/transforms/xml2html.xslt
Sun Nov 28 20:26:02 2004
@@ -22,71 +22,18 @@
     | Conversion to XSLT 1.0 REC Syntax by Steve Muench (smuench@oracle.com)
     | Added script support by Andrew Timberlake (andrew@timberlake.co.za)
     | Cleaned up and ported to standard DOM by Stefano Mazzocchi (stefano@apache.org)
-    | Changed the right margin for SitmapViewer by Jelle Alten 
+    | Changed the right margin for SitmapViewer by Jelle Alten
     |
-    | CVS $Id: xml2html.xslt,v 1.2 2004/03/06 02:25:37 antonio Exp $
+    | CVS $Id$
     +-->
-    
+
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
    <xsl:template match="/">
       <HTML>
          <HEAD>
-            <STYLE>
-              BODY  {background-color: white; color: black; font: monospace;}
-                .b  {cursor:pointer; color:red; font-weight:bold; text-decoration:none}
-                .e  {border: 0px; padding: 0px; margin: 0px 0px 0px 2em; text-indent:-1em;}
-                .en {color:#000088; font-weight:bold;}
-                .an {color:#880000}
-                .av {color:#888888}
-                .c  {color:#008800}
-                .t  {color:black}
-                .m  {color:navy}
-                .pi {color:red}
-                PRE {margin:0px; display:inline}
-                DIV {border:0; padding:0; margin:0;}
-            </STYLE>
-            <SCRIPT><xsl:comment><![CDATA[
-
-function click(event) {
-
-    var mark = event.target;
-
-    while ((mark.className != "b") && (mark.nodeName != "BODY")) {
-        mark = mark.parentNode
-    }
-    
-    var e = mark;
-    
-    while ((e.className != "e") && (e.nodeName != "BODY")) {
-        e = e.parentNode
-    }
-    
-    if (mark.childNodes[0].nodeValue == "+") {
-        mark.childNodes[0].nodeValue = "-";
-        for (var i = 2; i < e.childNodes.length; i++) {
-            var name = e.childNodes[i].nodeName;
-            if (name != "#text") {
-                if (name == "PRE" || name == "SPAN") {
-                   window.status = "inline";
-                   e.childNodes[i].style.display = "inline";
-                } else {
-                   e.childNodes[i].style.display = "block";
-                }
-            }
-        }
-    } else if (mark.childNodes[0].nodeValue == "-") {
-        mark.childNodes[0].nodeValue = "+";
-        for (var i = 2; i < e.childNodes.length; i++) {
-            if (e.childNodes[i].nodeName != "#text") {
-                e.childNodes[i].style.display = "none";
-            }
-        }
-    }
-}  
-  
-]]></xsl:comment>
-         </SCRIPT>
+            <link href="/styles/prettycontent.css" type="text/css" rel="stylesheet"/>
+            <script src="/scripts/prettycontent.js" type="text/javascript"/>
          </HEAD>
          <BODY>
             <xsl:apply-templates/>
@@ -122,7 +69,7 @@
    <!-- match comments -->
    <xsl:template match="comment()">
       <DIV class="e">
-         <SPAN class="b" onclick="click(event)">-</SPAN>
+         <SPAN class="b" onclick="toggle(event)">-</SPAN>
          <SPAN class="m">
             <xsl:text>&lt;!--</xsl:text>
          </SPAN>
@@ -151,7 +98,7 @@
          <xsl:text> </xsl:text>
       </xsl:if>
    </xsl:template>
-   
+
    <!-- match empty nodes -->
    <xsl:template match="*">
       <DIV class="e">
@@ -172,7 +119,7 @@
    <xsl:template match="*[node()]">
       <DIV class="e">
          <DIV>
-            <SPAN class="b" onclick="click(event)">-</SPAN>
+            <SPAN class="b" onclick="toggle(event)">-</SPAN>
             <SPAN class="m">&lt;</SPAN>
             <SPAN class="en">
                <xsl:value-of select="name(.)"/>
@@ -233,7 +180,7 @@
    <xsl:template match="*[*]" priority="20">
       <DIV class="e">
          <DIV>
-            <SPAN class="b" onclick="click(event)">-</SPAN>
+            <SPAN class="b" onclick="toggle(event)">-</SPAN>
             <SPAN class="m">&lt;</SPAN>
             <SPAN class="en">
                <xsl:value-of select="name(.)"/>

Added: cocoon/branches/BRANCH_2_1_X/src/webapp/resources/scripts/prettycontent.js
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/resources/scripts/prettycontent.js?view=auto&rev=106880
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/resources/scripts/prettycontent.js	Sun Nov 28
20:26:02 2004
@@ -0,0 +1,66 @@
+/*
+* Copyright 1999-2004 The Apache Software Foundation
+*
+* 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.
+*/
+function toggle(event) {
+
+    var mark;
+    if (event.srcElement) {
+      mark = event.srcElement;
+    } else {
+      mark = event.target;
+    }
+
+    while ((mark.className != "b") && (mark.nodeName != "BODY")) {
+        mark = mark.parentNode
+    }
+
+    var e = mark;
+
+    while ((e.className != "e") && (e.nodeName != "BODY")) {
+        e = e.parentNode
+    }
+
+    if (mark.childNodes[0].nodeValue == "+") {
+        mark.childNodes[0].nodeValue = "-";
+        var starthiding = false;
+        for (var i = 0; i < e.childNodes.length; i++) {
+            var name = e.childNodes[i].nodeName;
+            if (name != "#text") {
+              if (starthiding) {
+                if (name == "PRE" || name == "SPAN") {
+                  window.status = "inline";
+                  e.childNodes[i].style.display = "inline";
+                } else {
+                  e.childNodes[i].style.display = "block";
+                }
+              } else {
+                 starthiding = true;
+              }
+            }
+        }
+    } else if (mark.childNodes[0].nodeValue == "-") {
+        mark.childNodes[0].nodeValue = "+";
+        var starthiding = false;
+        for (var i = 0; i < e.childNodes.length; i++) {
+            if (e.childNodes[i].nodeName != "#text") {
+                if (starthiding) {
+                    e.childNodes[i].style.display = "none";
+                } else {
+                    starthiding = true;
+                }
+            }
+        }
+    }
+} 

Added: cocoon/branches/BRANCH_2_1_X/src/webapp/resources/styles/prettycontent.css
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/resources/styles/prettycontent.css?view=auto&rev=106880
==============================================================================
--- (empty file)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/resources/styles/prettycontent.css	Sun Nov 28
20:26:02 2004
@@ -0,0 +1,27 @@
+/*
+* Copyright 1999-2004 The Apache Software Foundation
+*
+* 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.
+*/
+BODY  {background-color: white; color: black; font-family: monospace;}
+.b  {cursor:pointer; color:red; font-weight:bold; text-decoration:none; padding-right: 2px;}
+.e  {border: 0px; padding: 0px; margin: 0px 0px 0px 2em; text-indent:-1em;}
+.en {color:#000088; font-weight:bold;}
+.an {color:#880000}
+.av {color:#888888}
+.c  {color:#008800}
+.t  {color:black}
+.m  {color:navy}
+.pi {color:red}
+PRE {margin:0px; display:inline}
+DIV {border:0; padding:0; margin:0;}
\ No newline at end of file

Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/stylesheets/system/xml2html.xslt
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/stylesheets/system/xml2html.xslt?view=diff&rev=106880&p1=cocoon/branches/BRANCH_2_1_X/src/webapp/stylesheets/system/xml2html.xslt&r1=106879&p2=cocoon/branches/BRANCH_2_1_X/src/webapp/stylesheets/system/xml2html.xslt&r2=106880
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/stylesheets/system/xml2html.xslt	(original)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/stylesheets/system/xml2html.xslt	Sun Nov 28 20:26:02
2004
@@ -23,76 +23,23 @@
     | Added script support by Andrew Timberlake (andrew@timberlake.co.za)
     | Cleaned up and ported to standard DOM by Stefano Mazzocchi (stefano@apache.org)
     |
-    | CVS $Id: xml2html.xslt,v 1.10 2004/05/01 13:20:55 joerg Exp $
+    | CVS $Id$
     +-->
-    
+
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
    <xsl:template match="/">
       <HTML>
-         <xsl:call-template name="head"/>
+         <HEAD>
+            <link href="/styles/prettycontent.css" type="text/css" rel="stylesheet"/>
+            <script src="/scripts/prettycontent.js" type="text/javascript"/>
+         </HEAD>
          <BODY>
             <xsl:apply-templates/>
          </BODY>
       </HTML>
    </xsl:template>
 
-   <xsl:template name="head">
-         <HEAD>
-            <STYLE>
-              BODY  {background-color: white; color: black; font-family: monospace;}
-                .b  {cursor:pointer; color:red; font-weight:bold; text-decoration:none; padding-right:
2px;}
-                .e  {border: 0px; padding: 0px; margin: 0px 0px 0px 2em; text-indent:-1em;}
-                .en {color:#000088; font-weight:bold;}
-                .an {color:#880000}
-                .av {color:#888888}
-                .c  {color:#008800}
-                .t  {color:black}
-                .m  {color:navy}
-                .pi {color:red}
-                PRE {margin:0px; display:inline}
-                DIV {border:0; padding:0; margin:0;}
-            </STYLE>
-            <SCRIPT><xsl:comment><![CDATA[
-function click(event) {
-
-    var mark = event.target;
-    while ((mark.className != "b") && (mark.nodeName != "BODY")) {
-        mark = mark.parentNode
-    }
-
-    var e = mark;
-    while ((e.className != "e") && (e.nodeName != "BODY")) {
-        e = e.parentNode
-    }
-
-    if (mark.childNodes[0].nodeValue == "+") {
-        mark.childNodes[0].nodeValue = "-";
-        for (var i = 2; i < e.childNodes.length; i++) {
-            var name = e.childNodes[i].nodeName;
-            if (name != "#text") {
-                if (name == "PRE" || name == "SPAN") {
-                   window.status = "inline";
-                   e.childNodes[i].style.display = "inline";
-                } else {
-                   e.childNodes[i].style.display = "block";
-                }
-            }
-        }
-    } else if (mark.childNodes[0].nodeValue == "-") {
-        mark.childNodes[0].nodeValue = "+";
-        for (var i = 2; i < e.childNodes.length; i++) {
-            if (e.childNodes[i].nodeName != "#text") {
-                e.childNodes[i].style.display = "none";
-            }
-        }
-    }
-}  
-]]></xsl:comment>
-            </SCRIPT>
-         </HEAD>
-   </xsl:template>
-
    <!-- match processing instructions -->
    <xsl:template match="processing-instruction()">
       <DIV class="e">
@@ -118,7 +65,7 @@
    <!-- match comments -->
    <xsl:template match="comment()">
       <DIV class="e">
-         <SPAN class="b" onclick="click(event)">-</SPAN>
+         <SPAN class="b" onclick="toggle(event)">-</SPAN>
          <SPAN class="m">&lt;!--</SPAN>
          <SPAN class="c">
             <PRE>
@@ -143,7 +90,7 @@
          <xsl:text> </xsl:text>
       </xsl:if>
    </xsl:template>
-   
+
    <!-- match empty elements -->
    <xsl:template match="*[not(node())]">
       <DIV class="e">
@@ -191,7 +138,7 @@
    <xsl:template match="*[node()]">
       <DIV class="e">
          <DIV>
-            <SPAN class="b" onclick="click(event)">-</SPAN>
+            <SPAN class="b" onclick="toggle(event)">-</SPAN>
             <SPAN class="m">&lt;</SPAN>
             <SPAN class="en">
                <xsl:value-of select="name(.)"/>

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?view=diff&rev=106880&p1=cocoon/branches/BRANCH_2_1_X/status.xml&r1=106879&p2=cocoon/branches/BRANCH_2_1_X/status.xml&r2=106880
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml	(original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml	Sun Nov 28 20:26:02 2004
@@ -202,6 +202,9 @@
 
   <changes>
  <release version="@version@" date="@date@">
+   <action dev="AG" type="fix" fixes-bug="30043" due-to="Micah Dubinko" due-to-email="mdubinko@snapbridge.com">
+     xml2html.xslt does not work on IE.
+   </action>
    <action dev="RG" type="fix" fixes-bug="32417">
      Portal: attributes "javax.portlet.request" and "javax.portlet.response" were not set
for JSR-168
      portlets running in the Cocoon webapp.

Mime
View raw message