cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michel Erard" <cocoon.er...@besonet.ch>
Subject Re: Problem with stylesheets
Date Tue, 05 Apr 2005 13:13:28 GMT
Hi, 

thanks for your mail.

it works now a bit better, but not yet perfect :-( 
In the sitemap I use this:

<map:transform type="forms" />
<map:transform type="xalan" src="stylesheets/layout.xsl" />      
<map:transform type="xalan" src="resources/forms-samples-styling.xsl" />     
<map:serialize type="xhtml" />

instead of the version in the block example (Multipage forms)

<map:resources>
<!-- this will later become a virtual transformer -->
   <map:resource name="simple-page2html">
      <map:transform src="stylesheets/simple-page2html.xsl">
         <map:parameter name="contextPath" value="{request:contextPath}"/>
         <map:parameter name="servletPath" value="{request:servletPath}"/>
         <map:parameter name="sitemapURI" value="{request:sitemapURI}"/>
         <map:parameter name="file" value="{file}"/>
         <map:parameter name="remove" value="{../0}"/>
      </map:transform> 
   </map:resource>
</map:resources>

<map:call resource="simple-page2html">
   <map:parameter name="file" value="forms/multipage_template.xml"/>
</map:call>
<map:transform src="stylesheets/forms-samples-styling.xsl"/>
<map:serialize/>

The layout of my page is now correct and the functionality is more or less correct. The form
works fine but the js tags for the advanced fields are missing.

Best regards, 

Mike

The Layout.xsl you find below.


---------- Original Message ----------------------------------
From: Jan Hoskens <jh@schaubroeck.be>
Reply-To: users@cocoon.apache.org
Date:  Mon, 04 Apr 2005 17:06:54 +0200

>Maybe this is because the forms stylesheets try to match with a html document to add the
styles and 
>javascripts. When no html header element is found, the mentioned elements are not included
in the 
>final page. Look into the stylesheets templates to see where the scripts/styles are added.
>
>One solution is to set the forms stylesheets at the end after you've transformed to the
html 
>elements. Another one is to customize the forms stylesheets to add the scripts/styles
into a 
>different element (create a stylesheet and import the forms stylesheets to make it easier).
>
>Kind regards,
>Jan
>
>Michel Erard wrote:
>> Hello,
>> 
>> I've tried to aggregate the multi-page-form example into an existing 
>> application. Now I've the problem, that my styles.css file isnt found 
>> any longer and it doesn't add the javascripts for the popups from matt 
>> kruse to the page.
>> 
>> Does somebody see my fault?
>> 
>> Thanks
>> 
>> Mike
>> 
>> -------------------------------------------------------------
>> Pipelines:
>> 
>> <map:pipelines>
>> 
>> <map:pipeline type="noncaching" internal-only="true">
>>         <map:act type="locale">
>>            <map:match pattern="*.form">
>>               <map:aggregate element="document">
>>                  <map:part src="cocoon:/info/{1}" />
>>                  <map:part src="cocoon:/header/{1}" />
>>                  <map:part src="cocoon:/menu/{1}" />
>>                  <map:part src="cocoon:/form/{1}" />
>>               </map:aggregate>
>> 
>>           <!--map:transform type="xalan" src="stylesheets/layout.xsl" /-->
>>               <map:transform type="forms"/>
>>               <map:transform type="xalan" 
>> src="resources/forms-samples-styling.xsl" />
>>           <map:transform type="xalan" 
>> src="resources/forms-advanced-field-styling.xsl" />
>>                          <map:serialize type="xhtml" />
>>            </map:match>
>> 
>>            <map:match pattern="info/*">
>>               <map:generate type="serverpages" src="forms/info/info.xsp">
>>                  <map:parameter name="context" value="{1}" />
>>               </map:generate>
>>               <map:serialize type="xml" />
>>            </map:match>
>> 
>>            <map:match pattern="header/*">
>>               <map:generate type="serverpages" src="forms/menus/hmenu.xsp">
>>                  <map:parameter name="context" value="{1}" />
>>               </map:generate>
>>               <map:serialize type="xml" />
>>            </map:match>
>> 
>>            <map:match pattern="menu/*">
>>               <map:generate type="serverpages" src="forms/menus/vmenu.xsp">
>>                  <map:parameter name="context" value="{1}" />
>>               </map:generate>
>>               <map:serialize type="xml" />
>>            </map:match>
>> 
>>            <map:match pattern="form/*">
>>               <map:generate src="forms/multipage_template.xml"/>
>>               <map:serialize type="xml" />
>>            </map:match>
>>         </map:act>
>>      </map:pipeline>
>>  
>>   <map:pipeline>
>> 
>>     <map:match pattern="do-*.flow">
>>       <map:call function="do_{1}"/>
>>     </map:match>
>> 
>>     <map:match pattern="*.continue">
>>       <map:call continuation="{1}"/>
>>     </map:match>
>> 
>>     <map:match pattern="resources/**">
>>       <map:read src="{0}"/>
>>     </map:match> 
>>    <map:match pattern="*">
>>        <map:redirect-to uri="{1}/"/>
>>    </map:match>
>> 
>>    <map:match pattern="*/**">
>>     <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/>
>>   </map:match>
>> 
>>   </map:pipeline>
>> 
>>   <map:pipeline type="caching" internal-only="false">
>>         <map:match pattern="images/*.gif">
>>            <map:read mime-type="images/gif" src="images/{1}.gif" />
>>         </map:match>
>>         <map:match pattern="images/*.jpg">
>>            <map:read mime-type="images/jpeg" src="images/{1}.jpg" />
>>         </map:match>
>>         <map:match pattern="styles/*.css">
>>            <map:read mime-type="text/css" src="styles/{1}.css" />
>>         </map:match>
>>         <map:match pattern="scripts/*.js">
>>            <map:read mime-type="text/javascript" src="scripts/{1}.js" />
>>         </map:match>
>>   </map:pipeline>
>> 
>> </map:pipelines>
>> 
>> 
>> -------------------------------------------------------------
>> layout.xsl:
>> 
>>   <xsl:template match="/">
>>      <xsl:apply-templates />
>>   </xsl:template>
>> 
>>   <xsl:template match="document">
>>      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
>>         <head>
>>            <title>Elquerito</title>
>>            <meta http-eqoiv="Content-Type" content="text/html; 
>> charset=ISO-8859-1" />
>>            <meta http-eqoiv="Content-Script-Type" 
>> content="text/javascript" />
>>            <link rel="stylesheet" type="text/css" 
>> href="styles/styles.css" />
>>            <script type="text/javascript" language="Javascript1.5" 
>> src="scripts/main.js">;</script>
>>         </head>
>> 
>>         <body>
>>            <table summary="" border="0" class="main" cellpadding="0" 
>> cellspacing="0">
>>               <tr>
>>                  <td style="background-image: url( 'images/logo.gif' ); 
>> height: 66px; width: 800px;"/>
>>                  <td align="right">
>>                     <table summary="" border="0" cellpadding="0" 
>> cellspacing="0">
>>                        <tr nowrap="nowrap" align="right">
>>                           <td><xsl:copy-of 
>> select="/document/info/user-id"/></td>
>>                        </tr>
>>                        <!--tr nowrap="nowrap" align="right">
>>                           <td><xsl:copy-of 
>> select="/document/info/role"/></td>
>>                        </tr-->
>>                        <tr nowrap="nowrap" align="right">
>>                           <td><xsl:copy-of 
>> select="/document/info/dateTime"/></td>
>>                        </tr>
>>                        <tr nowrap="nowrap" align="right">
>>                           <td><xsl:copy-of 
>> select="/document/info/version"/></td>
>>                        </tr>                                            
>> </table>
>>                  </td>
>>               </tr>
>>               <xsl:apply-templates />
>>            </table>
>>         </body>
>>      </html>
>>   </xsl:template>
>> 
>>   <xsl:template match="info">
>>   </xsl:template>
>> 
>>   <xsl:template match="header">
>>      <tr class="menu">
>>         <td class="hmenu" nowrap="nowrap" colspan="2">
>>            <xsl:copy-of select="*" />
>>         </td>
>>      </tr>
>> 
>>      <tr class="page">
>>         <td colspan="2">
>>            <table summary="" border="0" cellpadding="0" cellspacing="0">
>>               <tr>                          <td class="vmenu">
>>                  <xsl:copy-of select="/document/menu/*" />
>>               </td>
>>                    <td class="page">
>>                  <xsl:copy-of select="/document/page/*" />
>>               </td>
>>               </tr>
>>            </table>
>>         </td>
>>      </tr>
>>   </xsl:template>
>> 
>>   <xsl:template match="menu">
>>   </xsl:template>
>> 
>>   <xsl:template match="page">
>>   </xsl:template>
>> </xsl:stylesheet>
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>> 
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
 


____________________________________________
QuickLine WebMail - http://www.QuickLine.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message