# File lib/xtemplate/xpath.rb, line 1084
    def eval_condition(expr, val, plugin)
      if( expr =~ /\s+or\s+/ )
        expr.split(/\s+or\s+/).any?{|x| eval_condition(x.strip,val,plugin) }
      elsif( expr =~ /\s+and\s+/ )
        expr.split(/\s+and\s+/).all?{|x| eval_condition(x.strip,val,plugin) }
      elsif( expr =~ /^not\s+(.+)$/ )
        ! eval_condition($1.strip,val,plugin)
      else
        case expr
        when /^([^!=<>~\s\(\)]+(\([^!=<>~\s\(\)]*\))?)\s*(=|!=|<|>|<=|>=|=~|!~|&lt;=?|&gt;=?)\s*([^!=<>~\s\(\)]+(\([^!=<>~\s\(\)]*\))?)$/
          lhs = eval_expr($1.strip,val,plugin)
          op  = $3
          rhs = eval_expr($4.strip,val,plugin)
          unless( lhs.nil? || rhs.nil? )
            case op
            when '='
              (lhs == rhs)
            when '&lt;', '<'
              (lhs < rhs)
            when '&lt;=', '<='
              (lhs <= rhs)
            when '&gt;', '>'
              (lhs > rhs)
            when '&gt;=', '>='
              (lhs >= rhs)
            when '=~'
              (lhs =~ rhs)
            when '!~'
              (lhs !~ rhs)
            else
              raise(NotImplementedError, "'#{op}'")
            end
          else
            false
          end
        when /^([^=<>~]+)$/
          eval_expr($1.strip,val,plugin)
        else
          nil
        end
      end # end of 'else'
    end