// Copyright (C) 2005-2006 Code Synthesis Tools CC
//
// This program was generated by XML Schema Definition Compiler (XSD)
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// In addition, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//

// Begin prologue.
//
//
// End prologue.

// hello_type
//

namespace _xsd_hello_type
{
  // hello_type::greeting
  //

  template < typename _xsd_greeting_, typename _xsd_name_ >
  void hello_type< _xsd_greeting_, _xsd_name_ >::
  greeting_parser (::xsd::cxx::parser::xerces::parser< _xsd_greeting_, char >& greeting)
  {
    this->_xsd_greeting__ = &greeting;
  }


  // hello_type::name
  //

  template < typename _xsd_greeting_, typename _xsd_name_ >
  void hello_type< _xsd_greeting_, _xsd_name_ >::
  name_parser (::xsd::cxx::parser::xerces::parser< _xsd_name_, char >& name)
  {
    this->_xsd_name__ = &name;
  }


  template < typename _xsd_greeting_, typename _xsd_name_ >
  void hello_type< _xsd_greeting_, _xsd_name_ >::
  parsers (::xsd::cxx::parser::xerces::parser< _xsd_greeting_, char >& greeting,
           ::xsd::cxx::parser::xerces::parser< _xsd_name_, char >& name)
  {
    this->_xsd_greeting__ = &greeting;
    this->_xsd_name__ = &name;
  }

  template < typename _xsd_greeting_, typename _xsd_name_ >
  hello_type< _xsd_greeting_, _xsd_name_ >::
  hello_type ()
  : _xsd_greeting__ (0),
  _xsd_name__ (0)
  {
  }
}


// hello_type
//

namespace _xsd_hello_type
{
  template < typename x >
  _xsd_greeting< x >::
  ~_xsd_greeting () 
  {
  }

  template < typename x >
  void _xsd_greeting< x >::
  greeting (x const&) 
  {
  }

  template <>
  struct _xsd_greeting<void>
  {
    virtual ~_xsd_greeting () 
    {
    }

    virtual void greeting () 
    {
    }
  };

  template < typename x >
  _xsd_name< x >::
  ~_xsd_name () 
  {
  }

  template < typename x >
  void _xsd_name< x >::
  name (x const&) 
  {
  }

  template <>
  struct _xsd_name<void>
  {
    virtual ~_xsd_name () 
    {
    }

    virtual void name () 
    {
    }
  };

  template < typename _xsd_greeting_, typename _xsd_name_ >
  bool hello_type< _xsd_greeting_, _xsd_name_ >::
  _start_element_impl (::std::basic_string< char > const& ns,
                       ::std::basic_string< char > const& n)
  {
    if (::xsd::cxx::parser::event_consumer_impl< char >::_start_element_impl (ns, n))
    {
      return true;
    }

    if (n == "greeting" && ns.empty ())
    {
      this->::xsd::cxx::parser::event_consumer_impl< char >::context_.top ().parser_ = _xsd_greeting__;

      if (this->_xsd_greeting__)
      {
        this->_xsd_greeting__->pre ();
      }

      return true;
    }

    if (n == "name" && ns.empty ())
    {
      this->::xsd::cxx::parser::event_consumer_impl< char >::context_.top ().parser_ = _xsd_name__;

      if (this->_xsd_name__)
      {
        this->_xsd_name__->pre ();
      }

      return true;
    }

    return false;
  }

  template < typename _xsd_greeting_, typename _xsd_name_ >
  bool hello_type< _xsd_greeting_, _xsd_name_ >::
  _end_element_impl (::std::basic_string< char > const& ns,
                     ::std::basic_string< char > const& n)
  {
    if (::xsd::cxx::parser::event_consumer_impl< char >::_end_element_impl (ns, n))
    {
      return true;
    }

    if (n == "greeting" && ns.empty ())
    {
      if (this->_xsd_greeting__)
      {
        ::xsd::cxx::parser::glue< _xsd_greeting_ >::call (
          (_xsd_hello_type::_xsd_greeting< _xsd_greeting_ >*) (this),
          &_xsd_hello_type::_xsd_greeting< _xsd_greeting_ >::greeting,
          this->_xsd_greeting__,
          &::xsd::cxx::parser::xerces::parser< _xsd_greeting_, char >::post);
      }

      return true;
    }

    if (n == "name" && ns.empty ())
    {
      if (this->_xsd_name__)
      {
        ::xsd::cxx::parser::glue< _xsd_name_ >::call (
          (_xsd_hello_type::_xsd_name< _xsd_name_ >*) (this),
          &_xsd_hello_type::_xsd_name< _xsd_name_ >::name,
          this->_xsd_name__,
          &::xsd::cxx::parser::xerces::parser< _xsd_name_, char >::post);
      }

      return true;
    }

    return false;
  }
}


// Begin epilogue.
//
//
// End epilogue.

