|
-
Dec 2nd, 2004, 10:48 AM
#1
Thread Starter
Hyperactive Member
Resolved: XSL String test
Hopefully I'm asking this in the right place. I have the following code:
Code:
<xsl:if test="/products/product/bookingweb != ''">
<a><xsl:attribute name="href">http://<xsl:value-of select="/products/product/bookingweb" disable-output-escaping="yes" /></xsl:attribute><xsl:attribute name="target">_blank</xsl:attribute>
<img class="linklist-image">
<xsl:attribute name="src">images\bookonline_image.gif</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</img>
</a><br />
</xsl:if>
Rather than putting the html at the beginning of the booking web string automatically, I want to check whether the first 7 letters are http://. Now I don't know xsl very well at all, but its for this project in work. Can anybody help as to how I do this?
Thanks very much
Last edited by richy; Dec 2nd, 2004 at 11:10 AM.
ASP, PHP, VB, JavaScript, CSS, HTML, a little C and a little CGI.
Richard Whitehouse.
Join the Footie Predictions League
"Make it idiot proof and someone will make a better idiot."
-
Dec 2nd, 2004, 11:09 AM
#2
Thread Starter
Hyperactive Member
I've sorted it. Incase anyone cares...
Code:
<xsl:choose>
<xsl:when test="starts-with /products/product/bookingweb,'http://')">
</xsl:when>
<xsl:otherwise>
http://
</xsl:otherwise>
</xsl:choose>
ASP, PHP, VB, JavaScript, CSS, HTML, a little C and a little CGI.
Richard Whitehouse.
Join the Footie Predictions League
"Make it idiot proof and someone will make a better idiot."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|