cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Georg Von Sperling" <...@medaptus.com>
Subject RE: Css stylesheet problem
Date Thu, 21 Feb 2002 07:36:08 GMT
Xavier,
 
Took me a while as well as the documentation on sitemap.xmap is kinda sparse, but here is
a snipped to put into the <map:pipeline> tag of your sitemap.xmap:
 
   <map:match pattern="**.css">
     <map:read src="{1}.css" mime-type="text/css"/>
   </map:match>
 
What this means in English:
take any request to this context that ends with ".css" and respond with the content of the
corresponding ".css" file.
 
Assume you have this directory structure:
tomcat -
    webapps -
       cocoon -
           xml -
               page.xml
           xsl -
               page.xsl
           css -
               style.css
 
you might want to set-up your sitemap like this:
<map:pipelines>
  <map:pipeline>
   ... blah ...
   <map:match pattern="page.html">
    <map:generate type="serverpages" src="xml/page.xml"/>
    <map:transform type="xslt" src="xsl/page.xsl"/>
    <map:serialize/>
   </map:match>
   <map:match pattern="style.css">
     <map:read src="css/style.css" mime-type="text/css"/>
   </map:match>
  </map:pipeline>
</map:pipelines>
 
or, alternatively, you can use the wildcards as described above (a double-star will re-curse
through directories, a single-star will stay in the current directory only).
 
Hope this helps... 
Georg von Sperling
MedAptus, Inc.
http://www.medaptus.com
mailto://gvs@medaptus.com
 

	-----Original Message----- 
	From: Je vous site [mailto:contact@je-vous-site.com] 
	Sent: Wed 2/20/2002 11:00 AM 
	To: cocoon-users@xml.apache.org 
	Cc: 
	Subject: Css stylesheet problem
	
	

	Hello,
	
	I would like to apply a Css stylesheet to the HTML file i have generated
	on Cocoon.
	Is there a solution to this problem, without changing my configuration
	(Tomcat 4.0.1 / Cocoon 2 under W2k)
	
	<?xml version="1.0" encoding="ISO-8859-1"?>
	<xsl:stylesheet     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0" >
	
	<xsl:template match="/">
	  <html>
	  <head>
	        <link rel="stylesheet" href="style.css" type="text/css" />
	  </head>
	...
	
	Thank you for all kind of help : Xavier
	
	
	---------------------------------------------------------------------
	Please check that your question has not already been answered in the
	FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
	
	To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
	For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
	
	

Mime
View raw message