}
  private int getContextSize(Node ctx)  {    if (ctx.getNodeType() == Node.ATTRIBUTE_NODE)      {        Node owner = ((Attr) ctx).getOwnerElement();        return owner.getAttributes().getLength();      }    int count = 1;    Node sib = ctx.getPreviousSibling();    for (; sib != null; sib = sib.getPreviousSibling())      count++;    sib = ctx.getNextSibling();    for (; sib != null; sib = sib.getNextSibling())      count++;    return count;  }