Results 1 to 2 of 2

Thread: Resolved: XSL String test

  1. #1

    Thread Starter
    Hyperactive Member richy's Avatar
    Join Date
    Jan 1999
    Location
    Liverpool, England
    Posts
    353

    Resolved 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."

  2. #2

    Thread Starter
    Hyperactive Member richy's Avatar
    Join Date
    Jan 1999
    Location
    Liverpool, England
    Posts
    353
    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
  •  



Click Here to Expand Forum to Full Width