SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict Belfast75's Avatar
    Join Date
    Oct 2005
    Location
    London, England
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Wildcard search or regex in XSLT

    Hi,

    Is it possible to use regular expressions or wildcards in <xsl:if> tests?

    Psuedo code:
    Code:
    <xsl:if test="$variable = '[wildcard value]Some[wildcard value]'">
    <p>Display results</p>
    </xsl:if>
    I want to match the word 'Some' or any variation (eg 'Something' to also match)

    Is this possible?
    Cheers, Des

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2007
    Posts
    566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not exactly a regexp, but you have the text function contains() that can help you:
    http://www.zvon.org/xxl/XSLTreferenc..._contains.html


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •