## Class parser

zeep::xml::parser

## Synopsis

    // In header: <zeep/xml/parser.hpp>

    class parser {
    public:
      // types
      typedef unspecified attr_type;
      typedef unspecified attr_list_type;

      // construct/copy/destruct
      parser(std::istream &);
      parser(const std::string &);
      ~parser();

      // public member functions
      void parse(bool, bool);

      // protected member functions
      virtual void xml_decl(encoding_type, bool, float);
      virtual void
      doctype_decl(const std::string &, const std::string &, const std::string &);
      virtual void
      start_element(const std::string &, const std::string &,
                    const attr_list_type &);
      virtual void end_element(const std::string &, const std::string &);
      virtual void character_data(const std::string &);
      virtual void
      processing_instruction(const std::string &, const std::string &);
      virtual void comment(const std::string &);
      virtual void start_cdata_section();
      virtual void end_cdata_section();
      virtual void start_namespace_decl(const std::string &, const std::string &);
      virtual void end_namespace_decl(const std::string &);
      virtual void
      notation_decl(const std::string &, const std::string &, const std::string &);
      virtual void report_invalidation(const std::string &);
      virtual std::istream *
      external_entity_ref(const std::string &, const std::string &,
                          const std::string &);

      // public data members
      std::function< void(encoding_type encoding, bool standalone, float version)> xml_decl_handler;
      std::function< void(const std::string &name, const std::string &uri, const attr_list_type &atts)> start_element_handler;
      std::function< void(const std::string &name, const std::string &uri)> end_element_handler;
      std::function< void(const std::string &data)> character_data_handler;
      std::function< void(const std::string &target, const std::string &data)> processing_instruction_handler;
      std::function< void(const std::string &data)> comment_handler;
      std::function< void()> start_cdata_section_handler;
      std::function< void()> end_cdata_section_handler;
      std::function< void(const std::string &prefix, const std::string &uri)> start_namespace_decl_handler;
      std::function< void(const std::string &prefix)> end_namespace_decl_handler;
      std::function< void(const std::string &root, const std::string &publicId, const std::string &uri)> doctype_decl_handler;
      std::function< void(const std::string &name, const std::string &systemId, const std::string &publicId)> notation_decl_handler;
      std::function< std::istream *(const std::string &base, const std::string &pubid, const std::string &uri)> external_entity_ref_handler;
      std::function< void(const std::string &msg)> report_invalidation_handler;
    };

## Description

zeep::xml::parser is a SAX parser. After construction, you should assign call back handlers for the SAX events and then call parse().

### `parser` public construct/copy/destruct

1.     parser(std::istream & is);

2.     parser(const std::string & s);

3.     ~parser();

### `parser` public member functions

1.     void parse(bool validate, bool validate_ns);

### `parser` protected member functions

1.     virtual void xml_decl(encoding_type encoding, bool standalone, float version);

2.     virtual void
       doctype_decl(const std::string & root, const std::string & publicId,
                    const std::string & uri);

3.     virtual void
       start_element(const std::string & name, const std::string & uri,
                     const attr_list_type & atts);

4.     virtual void end_element(const std::string & name, const std::string & uri);

5.     virtual void character_data(const std::string & data);

6.     virtual void
       processing_instruction(const std::string & target, const std::string & data);

7.     virtual void comment(const std::string & data);

8.     virtual void start_cdata_section();

9.     virtual void end_cdata_section();

10.     virtual void
        start_namespace_decl(const std::string & prefix, const std::string & uri);

11.     virtual void end_namespace_decl(const std::string & prefix);

12.     virtual void
        notation_decl(const std::string & name, const std::string & systemId,
                      const std::string & publicId);

13.     virtual void report_invalidation(const std::string & msg);

14.     virtual std::istream *
        external_entity_ref(const std::string & base, const std::string & pubid,
                            const std::string & uri);