xsl-list
[Top] [All Lists]

Evaluating last 3 or 4 characters of URL?

2003-05-11 19:08:48
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 {(_at_)url}(_dot_)  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({(_at_)url}, -4, 4)!='.html'">
                          javascript: do_windowopen('
                            <xsl:value-of select="@url"/>       
                          ')
                        </xsl:when>
                        <xsl:when test="substring({(_at_)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


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list