Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 06, 2011 @ 21:30
    Johan Plesner Hamann
    0

    for-each select multiple conditions

    Hey Guys

    why is it that this does not work

     <xsl:for-each select="$currentPage/*
    [pris > $prismin and $prismax > pris and date >
    $aarmin  and $aarmax  > date and  serie = $moble and @isDoc and
    string(umbracoNaviHide) != '1']"
    >

    and this do

     <xsl:for-each select="$currentPage/*
    [pris > $prismin and $prismax > pris and serie = $moble and @isDoc and
    string(umbracoNaviHide) != '1']"
    >

     

    date = umbraco.library:FormatDateTime(design_aar, 'yyyy')

    aarmax / aarmin = umbraco.library:RequestQueryString

    Hope this is enough!

    I know I can work with 'and', 'or'. but what more do I have of possibilities.
    I've looked many places online but I can not find a list.

    Cheers, Johan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 06, 2011 @ 21:37
    Jan Skovgaard
    0

    Hi Johan

    Do you get some kind of error on the first expression or does it just not return any results?

    /Jan

  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 06, 2011 @ 21:44
    Johan Plesner Hamann
    0

    I get nothing. no error.

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Feb 06, 2011 @ 21:46
    Chriztian Steinmeier
    1

    Hi Johan,

    Problem is dates are just strings in XSLT - converting the year part to a number should solve it for you, e.g.: 

    <xsl:for-each select="$currentPage/*
     [pris > $prismin and $prismax > pris and number(substring(date, 1, 4)) > 
    $aarmin  and $aarmax  > number(substring(date, 1, 4)) and  serie = $moble and @isDoc and 
    string(umbracoNaviHide) != '1']">

    /Chriztian

  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 06, 2011 @ 21:54
    Johan Plesner Hamann
    0

    hey forgot something...

    date should be $date  
    <xsl:variable name="date" select="umbraco.library:FormatDateTime(design_aar, 'yyyy')"/>
  • Johan Plesner Hamann 105 posts 199 karma points
    Feb 06, 2011 @ 22:03
    Johan Plesner Hamann
    0

    Son of a bee-sting. You're so wise Mr. Chriztian. thank you!

    number(substring(design_aar, 1, 4))
  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Feb 06, 2011 @ 22:13
    Chriztian Steinmeier
    0

    Hehe - thanks Johan.

    Merely standing on the shoulders of giants :-)

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft