}
  public String toString()  {    StringBuffer buf = new StringBuffer();    switch (axis)      {      case ANCESTOR:        buf.append("ancestor::");        break;      case ANCESTOR_OR_SELF:        buf.append("ancestor-or-self::");        break;      case ATTRIBUTE:        if (tests.length == 0 ||            (tests[0] instanceof NameTest))          {            buf.append('@');          }        else          {        buf.append("attribute::");          }        break;      case CHILD:        //buf.append("child::");        break;      case DESCENDANT:        buf.append("descendant::");        break;      case DESCENDANT_OR_SELF:        buf.append("descendant-or-self::");        break;      case FOLLOWING:        buf.append("following::");        break;      case FOLLOWING_SIBLING:        buf.append("following-sibling::");        break;      case NAMESPACE:        buf.append("namespace::");        break;      case PARENT:        if (tests.length == 0 ||            (tests[0] instanceof NodeTypeTest &&             ((NodeTypeTest) tests[0]).type == 0))          {            return "..";          }        buf.append("parent::");        break;      case PRECEDING:        buf.append("preceding::");        break;      case PRECEDING_SIBLING:        buf.append("preceding-sibling::");        break;      case SELF:        if (tests.length == 0 ||            (tests[0] instanceof NodeTypeTest &&             ((NodeTypeTest) tests[0]).type == 0))          {            return ".";          }        buf.append("self::");        break;      }    if (tests.length == 0)      {        buf.append('*');      }    else      {        for (int i = 0; i < tests.length; i++)          {            buf.append(tests[i]);          }      }    return buf.toString();  }