def xj(xp):
    """
  Split xpath/jpath expr in -> xpath,jpath
  ex:   "//b[@v='.'].-1.size" ---> ( "//b[@v='.']" , '-1.size' )
  """
    ll = xp.split('.')
    if len(ll) > 1:
        ends = []
        while 1:
            if 'size' in ll[-1]:
                ends.append(ll.pop())
            elif ll[-1].lstrip('-+').isdigit():
                ends.append(ll.pop())
            else:
                break
        return '.'.join(ll), '.'.join(reversed(ends))
    else:
        return xp, ''
