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 2006/03/09 16:18:18 UTC

svn commit: r384530 - /lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl

Author: andreas
Date: Thu Mar  9 07:18:16 2006
New Revision: 384530

URL: http://svn.apache.org/viewcvs?rev=384530&view=rev
Log:
Replaced <xsl:attribute> with string function in menu2xslt.xsl. This solves a Xalan problem.

Modified:
    lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl

Modified: lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl?rev=384530&r1=384529&r2=384530&view=diff
==============================================================================
--- lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl (original)
+++ lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl Thu Mar  9 07:18:16 2006
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
   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
-
+  
+  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.
@@ -18,6 +18,7 @@
 <!-- $Id$ -->
 
 <xsl:stylesheet version="1.0"
+  xmlns="http://www.w3.org/1999/xhtml"
   xmlns:xhtml="http://www.w3.org/1999/xhtml"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xso="http://apache.org/cocoon/lenya/xslt/1.0"
@@ -25,100 +26,99 @@
   exclude-result-prefixes="menu"
   >
   
-<xsl:param name="contextprefix"/>
-<xsl:param name="publicationid"/>
-<xsl:param name="area"/>
-<xsl:param name="documenturl"/>
-  
-<xsl:namespace-alias stylesheet-prefix="xso" result-prefix="xsl"/>
-  
-<xsl:template match="/">
-  
-  <xso:stylesheet version="1.0"
-    xmlns:xhtml="http://www.w3.org/1999/xhtml"
-    exclude-result-prefixes="xhtml">
-    
-  <xso:output method="xml" indent="yes"/>
-
-  <xsl:if test="$area != 'live'">
-    
-  <xso:template match="/">
-    <html>
-      <head>
-        <xso:call-template name="title"/>
-        <script src="{$contextprefix}/lenya/menu/menu.js" type="text/javascript">&#160;</script>
-        <link href="{$contextprefix}/lenya/css/menu.css" rel="stylesheet" type="text/css"/>
-        <xso:apply-templates select="xhtml:html/xhtml:head/*[local-name() != 'title']"/>
-      </head>
-      <body>
-        <xsl:apply-templates select="xhtml:div[@id = 'lenya-logo']"/>
-        <xsl:apply-templates select="xhtml:div[@id = 'lenya-menus']"/>
-        <div id="lenya-cmsbody">
-          <xso:apply-templates select="xhtml:html/xhtml:body/node()"/>
-        </div>
-        <script type="text/javascript"> initialize(); </script>
-      </body>
-    </html>
-  </xso:template>
-  
-  <xso:template name="title">
-    <title>
-      Apache Lenya |
-      <xsl:value-of select="$publicationid"/> |
-      <xsl:value-of select="$area"/> |
-      <xsl:value-of select="$documenturl"/> |
-      <xso:value-of select="xhtml:html/xhtml:head/xhtml:title"/>
-    </title>
-  </xso:template>
+  <xsl:param name="contextprefix"/>
+  <xsl:param name="publicationid"/>
+  <xsl:param name="area"/>
+  <xsl:param name="documenturl"/>
   
-  </xsl:if>
+  <xsl:namespace-alias stylesheet-prefix="xso" result-prefix="xsl"/>
+  
+  <xsl:template match="/">
     
-    <xso:template match="xhtml:script">
+    <xso:stylesheet version="1.0"
+      xmlns:xhtml="http://www.w3.org/1999/xhtml"
+      exclude-result-prefixes="xhtml">
+      
+      <xso:output method="xml" indent="yes"/>
+      
+      <xsl:if test="$area != 'live'">
+        
+        <xso:template match="/">
+          <html>
+            <head>
+              <xso:call-template name="title"/>
+              <script src="{$contextprefix}/lenya/menu/menu.js" type="text/javascript">&#160;</script>
+              <link href="{$contextprefix}/lenya/css/menu.css" rel="stylesheet" type="text/css"/>
+              <xso:apply-templates select="xhtml:html/xhtml:head/*[local-name() != 'title']"/>
+            </head>
+            <body>
+              <xsl:apply-templates select="xhtml:div[@id = 'lenya-logo']"/>
+              <xsl:apply-templates select="xhtml:div[@id = 'lenya-menus']"/>
+              <div id="lenya-cmsbody">
+                <xso:apply-templates select="xhtml:html/xhtml:body/node()"/>
+              </div>
+              <script type="text/javascript"> initialize(); </script>
+            </body>
+          </html>
+        </xso:template>
+        
+        <xso:template name="title">
+          <title>
+            Apache Lenya |
+            <xsl:value-of select="$publicationid"/> |
+            <xsl:value-of select="$area"/> |
+            <xsl:value-of select="$documenturl"/> |
+            <xso:value-of select="xhtml:html/xhtml:head/xhtml:title"/>
+          </title>
+        </xso:template>
+        
+      </xsl:if>
+      
+      <xso:template match="xhtml:script">
         <xso:copy>
-           <xso:apply-templates select="@*|node()"/>
-           <xso:if test="not(.//text())"><xso:text>&#160;</xso:text></xso:if>
+          <xso:apply-templates select="@*|node()"/>
+          <xso:if test="not(.//text())"><xso:text>&#160;</xso:text></xso:if>
         </xso:copy>
-    </xso:template>
-
-  <xso:template match="xhtml:*">
-    <xso:element>
-      <xsl:attribute name="name">{local-name()}</xsl:attribute>
-      <xso:apply-templates select="@*|node()"/>
-    </xso:element>
-  </xso:template>
+      </xso:template>
+      
+      <xso:template match="xhtml:*">
+        <xso:element name="{string('{local-name()}')}">
+          <xso:apply-templates select="@*|node()"/>
+        </xso:element>
+      </xso:template>
+      
+      
+      <xso:template match="@*|node()">
+        <xso:copy>
+          <xso:apply-templates select="@*|node()"/>
+        </xso:copy>
+      </xso:template>
+      
+    </xso:stylesheet>
+    
+  </xsl:template>
   
   
-  <xso:template match="@*|node()">
-    <xso:copy>
-      <xso:apply-templates select="@*|node()"/>
-    </xso:copy>
-  </xso:template>
-
-  </xso:stylesheet>
   
-</xsl:template>
+  <xsl:template match="xhtml:*">
+    <xsl:element name="{local-name()}">
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:element>
+  </xsl:template>
   
-
-
-<xsl:template match="xhtml:*">
-  <xsl:element name="{local-name()}">
-    <xsl:apply-templates select="@*|node()"/>
-  </xsl:element>
-</xsl:template>
-
-
-<xsl:template match="menu:message">
-  <xsl:attribute name="title">
-    <xsl:value-of select="."/>
-  </xsl:attribute>
-</xsl:template>
-
   
-<xsl:template match="@*|node()">
-  <xsl:copy>
-    <xsl:apply-templates select="@*|node()"/>
-  </xsl:copy>
-</xsl:template>
+  <xsl:template match="menu:message">
+    <xsl:attribute name="title">
+      <xsl:value-of select="."/>
+    </xsl:attribute>
+  </xsl:template>
+  
+  
+  <xsl:template match="@*|node()">
+    <xsl:copy>
+      <xsl:apply-templates select="@*|node()"/>
+    </xsl:copy>
+  </xsl:template>
+  
   
-
 </xsl:stylesheet>



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


Re: whitespace noise (Was: Re: svn commit: r384530)

Posted by Thorsten Scherler <th...@wyona.com>.
El jue, 09-03-2006 a las 17:50 +0100, Andreas Hartmann escribió:
> Thorsten Scherler wrote:
> > Hi all, 
> > 
> > please do not change the indenting of the file.
> > We cannot see the actual differences.
> > 
> > If you want to fix the whitespace, then do that in
> > a completely separate commit.
> 
> Mea culpa ...
> I re-did the changes in two separate commits.

:)

Thank you very much. Now I know which attribute. ;)

salu2
-- 
Thorsten Scherler
COO Spain
Wyona Inc.  -  Open Source Content Management  -  Apache Lenya
http://www.wyona.com                   http://lenya.apache.org
thorsten.scherler@wyona.com                thorsten@apache.org


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


Re: whitespace noise (Was: Re: svn commit: r384530)

Posted by Andreas Hartmann <an...@apache.org>.
Thorsten Scherler wrote:
> Hi all, 
> 
> please do not change the indenting of the file.
> We cannot see the actual differences.
> 
> If you want to fix the whitespace, then do that in
> a completely separate commit.

Mea culpa ...
I re-did the changes in two separate commits.

-- Andreas

-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


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


whitespace noise (Was: Re: svn commit: r384530)

Posted by Thorsten Scherler <th...@apache.org>.
Hi all, 

please do not change the indenting of the file.
We cannot see the actual differences.

If you want to fix the whitespace, then do that in
a completely separate commit.

TIA

salu2

El jue, 09-03-2006 a las 15:18 +0000, andreas@apache.org escribió:
> Author: andreas
> Date: Thu Mar  9 07:18:16 2006
> New Revision: 384530
> 
> URL: http://svn.apache.org/viewcvs?rev=384530&view=rev
> Log:
> Replaced <xsl:attribute> with string function in menu2xslt.xsl. This solves a Xalan problem.
> 
> Modified:
>     lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl
> 
> Modified: lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl
> URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl?rev=384530&r1=384529&r2=384530&view=diff
> ==============================================================================
> --- lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl (original)
> +++ lenya/trunk/src/webapp/lenya/xslt/menu/menu2xslt.xsl Thu Mar  9 07:18:16 2006
> @@ -1,13 +1,13 @@
>  <?xml version="1.0" encoding="UTF-8"?>
>  <!--
>    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
> -
> +  
> +  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.
> @@ -18,6 +18,7 @@
>  <!-- $Id$ -->
>  
>  <xsl:stylesheet version="1.0"
> +  xmlns="http://www.w3.org/1999/xhtml"
>    xmlns:xhtml="http://www.w3.org/1999/xhtml"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:xso="http://apache.org/cocoon/lenya/xslt/1.0"
> @@ -25,100 +26,99 @@
>    exclude-result-prefixes="menu"
>    >
>    
> -<xsl:param name="contextprefix"/>
> -<xsl:param name="publicationid"/>
> -<xsl:param name="area"/>
> -<xsl:param name="documenturl"/>
> -  
> -<xsl:namespace-alias stylesheet-prefix="xso" result-prefix="xsl"/>
> -  
> -<xsl:template match="/">
> -  
> -  <xso:stylesheet version="1.0"
> -    xmlns:xhtml="http://www.w3.org/1999/xhtml"
> -    exclude-result-prefixes="xhtml">
> -    
> -  <xso:output method="xml" indent="yes"/>
> -
> -  <xsl:if test="$area != 'live'">
> -    
> -  <xso:template match="/">
> -    <html>
> -      <head>
> -        <xso:call-template name="title"/>
> -        <script src="{$contextprefix}/lenya/menu/menu.js" type="text/javascript">&#160;</script>
> -        <link href="{$contextprefix}/lenya/css/menu.css" rel="stylesheet" type="text/css"/>
> -        <xso:apply-templates select="xhtml:html/xhtml:head/*[local-name() != 'title']"/>
> -      </head>
> -      <body>
> -        <xsl:apply-templates select="xhtml:div[@id = 'lenya-logo']"/>
> -        <xsl:apply-templates select="xhtml:div[@id = 'lenya-menus']"/>
> -        <div id="lenya-cmsbody">
> -          <xso:apply-templates select="xhtml:html/xhtml:body/node()"/>
> -        </div>
> -        <script type="text/javascript"> initialize(); </script>
> -      </body>
> -    </html>
> -  </xso:template>
> -  
> -  <xso:template name="title">
> -    <title>
> -      Apache Lenya |
> -      <xsl:value-of select="$publicationid"/> |
> -      <xsl:value-of select="$area"/> |
> -      <xsl:value-of select="$documenturl"/> |
> -      <xso:value-of select="xhtml:html/xhtml:head/xhtml:title"/>
> -    </title>
> -  </xso:template>
> +  <xsl:param name="contextprefix"/>
> +  <xsl:param name="publicationid"/>
> +  <xsl:param name="area"/>
> +  <xsl:param name="documenturl"/>
>    
> -  </xsl:if>
> +  <xsl:namespace-alias stylesheet-prefix="xso" result-prefix="xsl"/>
> +  
> +  <xsl:template match="/">
>      
> -    <xso:template match="xhtml:script">
> +    <xso:stylesheet version="1.0"
> +      xmlns:xhtml="http://www.w3.org/1999/xhtml"
> +      exclude-result-prefixes="xhtml">
> +      
> +      <xso:output method="xml" indent="yes"/>
> +      
> +      <xsl:if test="$area != 'live'">
> +        
> +        <xso:template match="/">
> +          <html>
> +            <head>
> +              <xso:call-template name="title"/>
> +              <script src="{$contextprefix}/lenya/menu/menu.js" type="text/javascript">&#160;</script>
> +              <link href="{$contextprefix}/lenya/css/menu.css" rel="stylesheet" type="text/css"/>
> +              <xso:apply-templates select="xhtml:html/xhtml:head/*[local-name() != 'title']"/>
> +            </head>
> +            <body>
> +              <xsl:apply-templates select="xhtml:div[@id = 'lenya-logo']"/>
> +              <xsl:apply-templates select="xhtml:div[@id = 'lenya-menus']"/>
> +              <div id="lenya-cmsbody">
> +                <xso:apply-templates select="xhtml:html/xhtml:body/node()"/>
> +              </div>
> +              <script type="text/javascript"> initialize(); </script>
> +            </body>
> +          </html>
> +        </xso:template>
> +        
> +        <xso:template name="title">
> +          <title>
> +            Apache Lenya |
> +            <xsl:value-of select="$publicationid"/> |
> +            <xsl:value-of select="$area"/> |
> +            <xsl:value-of select="$documenturl"/> |
> +            <xso:value-of select="xhtml:html/xhtml:head/xhtml:title"/>
> +          </title>
> +        </xso:template>
> +        
> +      </xsl:if>
> +      
> +      <xso:template match="xhtml:script">
>          <xso:copy>
> -           <xso:apply-templates select="@*|node()"/>
> -           <xso:if test="not(.//text())"><xso:text>&#160;</xso:text></xso:if>
> +          <xso:apply-templates select="@*|node()"/>
> +          <xso:if test="not(.//text())"><xso:text>&#160;</xso:text></xso:if>
>          </xso:copy>
> -    </xso:template>
> -
> -  <xso:template match="xhtml:*">
> -    <xso:element>
> -      <xsl:attribute name="name">{local-name()}</xsl:attribute>
> -      <xso:apply-templates select="@*|node()"/>
> -    </xso:element>
> -  </xso:template>
> +      </xso:template>
> +      
> +      <xso:template match="xhtml:*">
> +        <xso:element name="{string('{local-name()}')}">
> +          <xso:apply-templates select="@*|node()"/>
> +        </xso:element>
> +      </xso:template>
> +      
> +      
> +      <xso:template match="@*|node()">
> +        <xso:copy>
> +          <xso:apply-templates select="@*|node()"/>
> +        </xso:copy>
> +      </xso:template>
> +      
> +    </xso:stylesheet>
> +    
> +  </xsl:template>
>    
>    
> -  <xso:template match="@*|node()">
> -    <xso:copy>
> -      <xso:apply-templates select="@*|node()"/>
> -    </xso:copy>
> -  </xso:template>
> -
> -  </xso:stylesheet>
>    
> -</xsl:template>
> +  <xsl:template match="xhtml:*">
> +    <xsl:element name="{local-name()}">
> +      <xsl:apply-templates select="@*|node()"/>
> +    </xsl:element>
> +  </xsl:template>
>    
> -
> -
> -<xsl:template match="xhtml:*">
> -  <xsl:element name="{local-name()}">
> -    <xsl:apply-templates select="@*|node()"/>
> -  </xsl:element>
> -</xsl:template>
> -
> -
> -<xsl:template match="menu:message">
> -  <xsl:attribute name="title">
> -    <xsl:value-of select="."/>
> -  </xsl:attribute>
> -</xsl:template>
> -
>    
> -<xsl:template match="@*|node()">
> -  <xsl:copy>
> -    <xsl:apply-templates select="@*|node()"/>
> -  </xsl:copy>
> -</xsl:template>
> +  <xsl:template match="menu:message">
> +    <xsl:attribute name="title">
> +      <xsl:value-of select="."/>
> +    </xsl:attribute>
> +  </xsl:template>
> +  
> +  
> +  <xsl:template match="@*|node()">
> +    <xsl:copy>
> +      <xsl:apply-templates select="@*|node()"/>
> +    </xsl:copy>
> +  </xsl:template>
> +  
>    
> -
>  </xsl:stylesheet>
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
> For additional commands, e-mail: commits-help@lenya.apache.org
> 
-- 
thorsten

"Together we stand, divided we fall!" 
Hey you (Pink Floyd)


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