Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 81717 invoked from network); 17 May 2004 23:03:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 May 2004 23:03:34 -0000 Received: (qmail 32750 invoked by uid 500); 17 May 2004 23:03:51 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 32699 invoked by uid 500); 17 May 2004 23:03:51 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 32664 invoked by uid 98); 17 May 2004 23:03:51 -0000 Received: from joerg.heinicke@gmx.de by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(213.165.64.20):. Processed in 0.275275 secs); 17 May 2004 23:03:51 -0000 X-Qmail-Scanner-Mail-From: joerg.heinicke@gmx.de via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(213.165.64.20):. Processed in 0.275275 secs) Received: from unknown (HELO mail.gmx.net) (213.165.64.20) by hermes.apache.org with SMTP; 17 May 2004 23:03:50 -0000 Received: (qmail 28514 invoked by uid 65534); 17 May 2004 23:03:13 -0000 Received: from a183069.studnetz.uni-leipzig.de (EHLO gmx.de) (139.18.183.69) by mail.gmx.net (mp021) with SMTP; 18 May 2004 01:03:13 +0200 X-Authenticated: #3483660 Message-ID: <40A944C5.4030306@gmx.de> Date: Tue, 18 May 2004 01:03:33 +0200 From: Joerg Heinicke User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: de-de, de, en-us, en-gb, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: apply css? References: <20040517214519.35361.qmail@web25105.mail.ukl.yahoo.com> In-Reply-To: <20040517214519.35361.qmail@web25105.mail.ukl.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On 17.05.2004 23:45, leon tian wrote: > Hi, thanks for the reply. But I wanna transform web pages from the > internet dynamically which means different css should be applied > based on different web pages. How can I get the url of each css > automatically (like a web browser)? You mean my example was to simple as it was only one hardcoded remote resource? With a pipeline of your current sitemap it would be easier for me to give an example, but maybe you see what I try to suggest: 1. Absolutize the links to the external resources: Somewhere you have to determine where to get a web page from, don't you? This part you can pass into a stylesheet as parameter that absolutizes the links to CSS, JS and images. In the stylesheet you match on link/@href, style/@src, img/@src etc. and change all relative links: The resources would be fetched from the remote server without any Cocoon inbetween. 2. forward the request to the remote server In the same way you determine the remote URL for the web page you can do it for the CSS. And even if this is not possible, you can add a transformer into the remote.html pipeline that adds a hint on the remote server into all resource links (same as in approach 1). In the CSS pipeline you get them from the URL The difference is then only that those resources are delivered through Cocoon, not grabbed from the remote server directly. Hope you get the ideas. Joerg > Joerg Heinicke wrote: On 17.05.2004 15:53, > >> hi, >> >> is there any way to apply the css of the original web pages from >> the internet? after i transform web pages from the internet, most >> of the styles are lost because they are linked to a css file on the >> web site's server. should i try to download and apply them on my >> resulting pages and how? > > > It should be easy to forward the request to the CSS to the original > server in the same way as you get the HTML source. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org