Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 59783 invoked from network); 18 May 2004 01:33:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 May 2004 01:33:55 -0000 Received: (qmail 54089 invoked by uid 500); 18 May 2004 01:34:15 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 53727 invoked by uid 500); 18 May 2004 01:34:13 -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 53703 invoked by uid 98); 18 May 2004 01:34:13 -0000 Received: from tianyr2005@yahoo.co.uk by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(217.12.10.49):. Processed in 0.227127 secs); 18 May 2004 01:34:13 -0000 X-Qmail-Scanner-Mail-From: tianyr2005@yahoo.co.uk via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(217.12.10.49):. Processed in 0.227127 secs) Received: from unknown (HELO web25101.mail.ukl.yahoo.com) (217.12.10.49) by hermes.apache.org with SMTP; 18 May 2004 01:34:13 -0000 Message-ID: <20040518013333.88602.qmail@web25101.mail.ukl.yahoo.com> Received: from [81.154.175.253] by web25101.mail.ukl.yahoo.com via HTTP; Tue, 18 May 2004 02:33:33 BST Date: Tue, 18 May 2004 02:33:33 +0100 (BST) From: =?iso-8859-1?q?leon=20tian?= Subject: Re: apply css? To: users@cocoon.apache.org In-Reply-To: <40A95426.2050606@gmx.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-912366905-1084844013=:88548" Content-Transfer-Encoding: 8bit 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 --0-912366905-1084844013=:88548 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi, i tried to using xsl:choose to link the img but the first 'when' doesn't work. Could you spot the error for me? Thanks. Joerg Heinicke wrote: On 18.05.2004 01:39, leon tian wrote: > 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="/css.css", the others using full url like > href="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. xsl: starts-with(whatToTest, 'http') There is also a linkrewriter block in Cocoon that might do this job in a more sophisticated way: http://wiki.cocoondev.org/Wiki.jsp?page=BlockDescriptions. Maybe you get it to work. Joerg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now --0-912366905-1084844013=:88548 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hi, i tried to using xsl:choose to link the img but the first 'when' doesn't work. Could you spot the error for me? Thanks.
 
<xsl:template match="img/@src">
<xsl:variable name="link" select="." />
 <xsl:attribute name="src">
  <xsl:choose>
   <xsl:when test="starts-with($link ,'http')">
    <xsl:value-of select="."/>
   </xsl:when>
   <xsl:otherwise>
    <xsl:value-of select="concat($remoteserver, .)"/>
   </xsl:otherwise>
  </xsl:choose>
   </xsl:attribute>
</xsl:template>

Joerg Heinicke <joerg.heinicke@gmx.de> wrote:
On 18.05.2004 01:39, leon tian wrote:

> 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="/css.css", the others using full url like
> href="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.

xsl: starts-with(whatToTest, 'http')

There is also a linkrewriter block in Cocoon that might do this job in a
more sophisticated way:
http://wiki.cocoondev.org/Wiki.jsp?page=BlockDescriptions. Maybe you get
it to work.

Joerg

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


Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now --0-912366905-1084844013=:88548--