Hi, thanks for such detailed reply! I got it with 1 more question. Some remote pages reference their resources to the remote server like href="", the others using full url like href=""http://www.remote.com/css.css">http://www.remote.com/css.css". I'm thinking using your method 1 plus 'xsl:choose' to test the first four letters of 'href' (==http?) and link it to the correct url. But I don't know how to test the first four letters. Could you tell me how although it is more likely a xsl question.
 
Regards


Joerg Heinicke <[EMAIL PROTECTED]> wrote:
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now

Reply via email to