Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    XML if String 'Does Not Contain' Syntax

    I'd like to detect whether or not a string contains another string in a succession - what I'm doing is passing a phrase through a number of detections, where it does or does not do X. Here's what I have so far -

    <if test="string-length($env.http_user_agent) > 1 and string-length($env.remote_addr) > 1 and string-length(match(value-of('phrase', 'state-param'),$filter,'i')) = 0">
    DO X
    </if>

    Where the http_user_agent is the end user's browser (must not be empty), the remote_addr is the end user's IP address (must not be empty), and the phrase is what is being passed. $filter is a series of words to match - in this case, if the phrase does not appear in the filter, do X.

    This all works.

    What I'd like to do further, is detect IE10, where X is NOT done, if the user is using IE10. So, something like

    and if the string for $env.http_user_agent does not contain 'MSIE 10.0' (or however IE10 is expressed as a user agent), do X. I think it can be added into the above series, but I'm not sure on syntax.

    Any ideas? Much appreciated.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,609
    Thanks
    24
    Thanked 647 Times in 646 Posts
    Read this article to see if it helps http://www.impressivewebs.com/ie10-css-hacks/
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    New to the CF scene
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I did read that, actually. No dice. The code they give fires in IE9 as well, which I can't have. I tested that one. I also put it together this way:

    <if test="string-length($env.http_user_agent) > 1 and string-length($env.remote_addr) > 1 and string-length(match(value-of('phrase', 'state-param'),$filter,'i')) = 0 and not(contains($env.http_user_agent, 'MSIE 10'))">

    But while this code didn't break anything, it also failed to detect IE10. It did basically nothing. Is my syntax okay?


  •  

    Tags for this Thread

    Posting Permissions

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