/**
   * Sets this <code>XmlReaderContentHandler</code> object's <code>tag</code> field if the given
   * name is the key for a tag and this object's state is not <code>INITIAL</code>. The field is set
   * to the constant that corresponds to the given element name. If the state is <code>INITIAL
   * </code>, the state is set to the given name, which will be one of the sections <code>PROPERTIES
   * </code>, <code>METADATA</code>, or <code>DATA</code>. In either case, this method puts this
   * document handler in the proper state for calling the method <code>endElement</code>.
   *
   * <p>If the state is <code>DATA</code> and the tag is <code>RowTag</code>, <code>DelTag</code>,
   * or <code>InsTag</code>, this method moves the rowset's cursor to the insert row and sets this
   * <code>XmlReaderContentHandler</code> object's <code>idx</code> field to <code>0</code> so that
   * it will be in the proper state when the parser calls the method <code>endElement</code>.
   *
   * @param lName the name of the element; either (1) one of the array elements in the fields <code>
   *     properties</code>, <code>colDef</code>, or <code>data</code> or (2) one of the <code>RowSet
   *     </code> elements <code>"properties"</code>, <code>"metadata"</code>, or <code>"data"</code>
   * @param attributes <code>org.xml.sax.AttributeList</code> objects that are attributes of the
   *     named section element; may be <code>null</code> if there are no attributes, which is the
   *     case for <code>WebRowSet</code> objects
   * @exception SAXException if a general SAX error occurs
   */
  public void startElement(String uri, String lName, String qName, Attributes attributes)
      throws SAXException {
    int tag;
    String name = "";

    name = lName;

    switch (getState()) {
      case PROPERTIES:
        tempCommand = "";
        tag = propMap.get(name);
        if (tag == PropNullTag) setNullValue(true);
        else setTag(tag);
        break;
      case METADATA:
        tag = colDefMap.get(name);

        if (tag == MetaNullTag) setNullValue(true);
        else setTag(tag);
        break;
      case DATA:

        /**
         * This has been added to clear out the values of the previous read so that we should not
         * add up values of data between different tags
         */
        tempStr = "";
        tempUpdate = "";
        if (dataMap.get(name) == null) {
          tag = NullTag;
        } else if (dataMap.get(name) == EmptyStringTag) {
          tag = EmptyStringTag;
        } else {
          tag = dataMap.get(name);
        }

        if (tag == NullTag) {
          setNullValue(true);
        } else if (tag == EmptyStringTag) {
          setEmptyStringValue(true);
        } else {
          setTag(tag);

          if (tag == RowTag || tag == DelTag || tag == InsTag) {
            idx = 0;
            try {
              rs.moveToInsertRow();
            } catch (SQLException ex) {;
            }
          }
        }

        break;
      default:
        setState(name);
    }
  }