/*******************************************************************\

              Copyright (C) 2003 Joseph Coffland

    This program is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
        of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
             GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
                           02111-1307, USA.

            For information regarding this software email
                   jcofflan@users.sourceforge.net

\*******************************************************************/

#ifndef XMLPARSEEVENT_H
#define XMLPARSEEVENT_H

#include "XMLPullParser.h"
#include "XMLAttrib.h"
#include <xercesc/util/XercesDefs.hpp>

#include <string>
#include <list>

namespace XERCES_CPP_NAMESPACE {
  class Attributes;
  class Locator;
};

/** 
 * XML pull parser event.
 */
struct XMLParseEvent {
  /// The event type.
  XMLPullParser::event_t event;

  /// The number of attributes
  unsigned int numAttribs;

  /// An array of attributes.
  XMLAttrib *attribs;

  /// Event name
  std::string name;

  /// Event Uniform Resource Identifier or namespace.
  std::string uri;

  /// Event namespace prefix.
  std::string prefix;

  /// Event text data.
  std::string text;

  /// True if all whitespace.
  bool isWhitespace;
  
  /// The column with in the XML document of this event.
  int col;

  /// The line with in the XML document of this event.
  int line;

  XMLParseEvent(XMLPullParser::event_t event,
		const XERCES_CPP_NAMESPACE::Locator *locator);
  virtual ~XMLParseEvent();

  /** 
   * @return The text name of an event type.
   */
  static const std::string &getEventName(XMLPullParser::event_t event);
};
#endif // XMLPARSEEVENT_H
