# File lib/xtemplate/xpath.rb, line 674
    def cond_split(path)
      i = 0
      l = 0
      s = 0
      xs = []
      path.each_byte{|c|
        case c
        when ?{, ?[
          if( l == 0 )
            case i
            when 0
              xs.push("")
            when s
              # do nothing
            else
              xs.push(path[s..(i-1)])
            end
            s = i
          end
          l += 1
        when ?}, ?]
          l -= 1
          if( l == 0 )
            xs.push(path[s..i])
            s = i + 1
          end
        end
        i += 1
      }
      unless( s == i )
        xs.push(path[s..i])
      end
      xs
    end