sax_ns_parser

Defined in header: <orcus/sax_ns_parser.hpp>

template<typename HandlerT>
class sax_ns_parser

SAX based XML parser with extra namespace handling.

It uses an instance of xmlns_context passed by the caller to validate and convert namespace values into identifiers. The namespace identifier of each encountered element is always given even if one is not explicitly given.

This parser keeps track of element scopes and detects non-matching element pairs.

Template Parameters:

HandlerT – Handler type with member functions for event callbacks. Refer to sax_ns_handler.

Public Types

typedef HandlerT handler_type

Public Functions

sax_ns_parser(std::string_view content, xmlns_context &ns_cxt, handler_type &handler)
~sax_ns_parser() = default
void parse()

Start parsing the document.

Throws:

orcus::malformed_xml_error – when it encounters a non-matching closing element.