sax_parser

Defined in header: <orcus/sax_parser.hpp>

template<typename HandlerT, typename ConfigT = sax_parser_default_config>
class sax_parser : public orcus::sax::parser_base

SAX parser for XML documents.

This parser is barebone in that it only parses the document and picks up all encountered elements and attributes without checking proper element pairs. The user is responsible for checking whether or not the document is well-formed in terms of element scopes.

This parser additionally records the begin and end offset positions of each element.

Template Parameters:
  • HandlerT – Handler type with member functions for event callbacks. Refer to sax_handler.

  • ConfigT – Parser configuration.

Public Types

typedef HandlerT handler_type
typedef ConfigT config_type

Public Functions

sax_parser(std::string_view content, handler_type &handler)
~sax_parser() = default
void parse()