public void revertToParentFromLeaveAttribute(
      Object result, int cookie, String uri, String local, String qname) throws SAXException {

    int id = _source.replace(this, _parent);
    _parent.onChildCompleted(result, cookie, true);
    _source.sendLeaveAttribute(id, uri, local, qname);
  }
  //
  //
  // reverts to the parent object from the child handler
  //
  //
  public void revertToParentFromEnterElement(
      Object result, int cookie, String uri, String local, String qname, Attributes atts)
      throws SAXException {

    int id = _source.replace(this, _parent);
    _parent.onChildCompleted(result, cookie, true);
    _source.sendEnterElement(id, uri, local, qname, atts);
  }
  public void joinByText(NGCCEventReceiver source, String value) throws SAXException {

    if (isJoining) return; // we are already in the process of joining. ignore.
    isJoining = true;

    // send special token to the rest of the branches.
    // these branches don't understand this token, so they will
    // try to move to a final state and send the token back to us,
    // which this object will ignore (because isJoining==true)
    // Otherwise branches will find an error.
    for (int i = 0; i < _receivers.length; i++)
      if (_receivers[i] != source) _receivers[i].text(value);

    // revert to the parent
    _parent._source.replace(this, _parent);
    _parent.onChildCompleted(null, _cookie, true);
    // send this event to the parent
    _parent.text(value);
  }
  public void revertToParentFromLeaveElement(
      Object result, int cookie, String uri, String local, String qname) throws SAXException {

    if (uri == NGCCRuntime.IMPOSSIBLE && uri == local && uri == qname && _parent == null)
      // all the handlers are properly finalized.
      // quit now, because we don't have any more NGCCHandler.
      // see the endDocument handler for detail
      return;

    int id = _source.replace(this, _parent);
    _parent.onChildCompleted(result, cookie, true);
    _source.sendLeaveElement(id, uri, local, qname);
  }
  public void revertToParentFromText(Object result, int cookie, String text) throws SAXException {

    int id = _source.replace(this, _parent);
    _parent.onChildCompleted(result, cookie, true);
    _source.sendText(id, text);
  }