Maybe you already solved it in the meantime ...
On 18.05.2004 03:33, leon tian wrote:
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.
No, it looks ok. What does "doesn't work" mean? It's never evaluated to true?
Joerg
<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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
