Subject: RE: [xsl] Evaluating last 3 or 4 characters of URL? From: cknell@xxxxxxxxxx Date: Sun, 11 May 2003 22:43:23 -0500 |
Look again carefully. The period before the file extension isn't being counted in the length of the substring you are testing. You will have to change "substring({@url}, -4, 4)" to substring({@url}, -5, 5)" if you want to test it against ".html". -- Charles Knell cknell@xxxxxxxxxx - email
-----Original Message----- From: David Pratt <prattda@xxxxxxxxxxxxxxx> Sent: Sun, 11 May 2003 21:08:48 -0500 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] Evaluating last 3 or 4 characters of URL?
I am trying to evaluate the last 3 or 4 characters of a URL so that I can add javascript in the href attribute.
It is not liking the {@url}. Is this not just the string value of the url attribute? Help on the syntax appreciated.
..more <xsl:attribute name="id"> <xsl:value-of select="@id"/> </xsl:attribute> </xsl:if> <xsl:attribute name="href"> <xsl:choose> <xsl:when test="substring({@url}, -4, 4)!='.html'"> javascript: do_windowopen(' <xsl:value-of select="@url"/> ') </xsl:when> <xsl:when test="substring({@url}, -3, 3)!='.htm'"> javascript: do_windowopen(' <xsl:value-of select="@url"/> ') </xsl:when> <xsl:otherwise> <xsl:value-of select="@url"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> ..more
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] What is the best way to c, me | Thread | Re: [xsl] Evaluating last 3 or 4 ch, David Pratt |
Re: [xsl] Evaluating last 3 or 4 ch, David Pratt | Date | [xsl] Avoid copying of namespace de, Ram UGroups |
Month |