I missed that one. You don't need(and as you have discovered, can't use) the braces here.
"select" is not an attribute, even thought it has the same form as an
attribute, so an Attribute Value Template (AVT) (that's what the braces are) is
inappropriate here. Lose them, and you should be OK.
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: David Pratt <prattda(_at_)Assiniboine(_dot_)net>
Sent: Sun, 11 May 2003 22:09:30 -0500
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Evaluating last 3 or 4 characters of URL?
Thanks Charles. I'll make this change. I am a bit tired and I did this
as well as != instead of = . It's going to be a slow night. From
xsltproc I am getting an XPath error at the first { in the expression
which is the first hitch - so
not even getting to evaluate the expression.
XPath error Invalid expression
substring({(_at_)url}, -5, 5)='.html'
On Sunday, May 11, 2003, at 10:43 PM, cknell(_at_)onebox(_dot_)com wrote:
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({(_at_)url}, -4, 4)" to substring({(_at_)url}, -5, 5)" if
you want to test it against ".html".
--
Charles Knell
cknell(_at_)onebox(_dot_)com - email
-----Original Message-----
From: David Pratt <prattda(_at_)Assiniboine(_dot_)net>
Sent: Sun, 11 May 2003 21:08:48 -0500
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
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 {(_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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list