<map:match pattern="**/*.css"> <map:read src="styles/{2}.css" mime-type="text/css"/> </map:match>
Worked perfectly for me, thanks :) -----Oprindelig meddelelse----- Fra: Piroumian, Konstantin [mailto:[EMAIL PROTECTED]] Sendt: 8. november 2001 08:03 Til: [EMAIL PROTECTED] Emne: Re: More sitemap magic, what about css files? This doesn't work (maybe this has been fixed already?) in case, when your referring file is in a subdirectory: http://<host>/level1/level2/file.xml href="main-style.css" will result in http://<host>/level1/level2/main-style.css request from browser - this won't be processed by "*.css" matcher. I use this combination: <!-- this will match any <dir>/*.css request --> <map:match pattern="**/*.css"> <map:read src="styles/{2}.css" mime-type="text/css"/> </map:match> <!-- this will match any /*.css request --> <map:match pattern="*.css"> <map:read src="styles/{1}.css" mime-type="text/css"/> </map:match> Regards, Konstantin Piroumian ----- Original Message ----- From: "Luca Morandini" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 08, 2001 6:34 PM Subject: RE: More sitemap magic, what about css files? Soren, I simply use this in the sitemap (of course I have a "styles" directory): <map:match pattern="*.css"> <map:read src="styles/{1}.css" mime-type="text/css"/> </map:match> and this in the HTML: <link href="main-style.css" rel="stylesheet" type="text/css"> and it works. Though an error is signaled by Tomcat... and it was reported by other users last week... this error is suspicious, but, apparently, harmless. Best regards, --------------------------------------------- Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html --------------------------------------------- > -----Original Message----- > From: Søren Neigaard [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 09, 2001 1:28 AM > To: [EMAIL PROTECTED] > Subject: More sitemap magic, what about css files? > > > It's like my css files aren't returned by my server, as if C2 wants to > process them instead. If I try to hit a css file directly via my browser > (and I know it's there), I get a blank page!??? Do I have to > instruct C2 to > return those css files without even looking at them? How do I do this > smartest? > > One thing I like in the sitemap, is the posibility to fake the DocumenRoot > (look beneath). > > Real DocumentRoot (set by application server) = /project/ > > With following sitemap: > -------------------- > <map:match pattern="*.xml"> > <map:generate type="serverpages" src="client/media_pc/pages/{1}.xml"/> > <map:transform type="xslt" src="client/media_pc/pages/{1}.xsl"/> > <map:serialize/> > </map:match> > -------------------- > > Gives: > -------------------- > http://host/test.xml -> /project/client/media_pc/pages/test.xml > -------------------- > > But what if the generated HTML has a relative URL to it's CSS, like > "../css/test.css", and this CSS file really is in > "/project/client/media_pc/css/test.css"? What to do then? The > page thinks it > is on root of server, so "../" would go beneath DocumentRoot and that wont > work. What would you guys do here? > > Med venlig hilsen/Best regards > Søren Neigaard > System Architect > ................................ > Mobilethink A/S > Arosgaarden > Åboulevarden 23, 5.sal > DK - 8000 Århus C > Telefon: +45 86207800 > Direct: +45 86207810 > Fax: +45 86207801 > Email: [EMAIL PROTECTED] > Web: www.mobilethink.dk > ................................ > > > --------------------------------------------------------------------- > 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: <[EMAIL PROTECTED]> > For additional commands, e-mail: <[EMAIL PROTECTED]> > > --------------------------------------------------------------------- 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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- 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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]> --------------------------------------------------------------------- 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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>