Template-based sax parser that doesn’t use function pointer for callbacks for better performance, especially on large XML streams.
Inherits from orcus::sax::parser_base
Public Types
Public Functions
orcus::sax_parser::
sax_parser
(const char *content, const size_t size, handler_type &handler)¶orcus::sax_parser::
~sax_parser
()¶orcus::sax_parser::
parse
()¶SAX based XML parser with proper namespace handling.
Public Types
Public Functions
orcus::sax_ns_parser::
sax_ns_parser
(const char *content, const size_t size, xmlns_context &ns_cxt, handler_type &handler)¶orcus::sax_ns_parser::
~sax_ns_parser
()¶orcus::sax_ns_parser::
parse
()¶XML parser that tokenizes element and attribute names while parsing.
Public Types
Public Functions
orcus::sax_token_parser::
sax_token_parser
(const char *content, const size_t size, const tokens &_tokens, xmlns_context &ns_cxt, handler_type &handler)¶orcus::sax_token_parser::
~sax_token_parser
()¶orcus::sax_token_parser::
parse
()¶Central XML namespace repository that stores all namespaces that are used in the current session.
Public Functions
orcus::xmlns_repository::
xmlns_repository
()¶orcus::xmlns_repository::
~xmlns_repository
()¶orcus::xmlns_repository::
add_predefined_values
(const xmlns_id_t *predefined_ns)¶Add a set of predefined namespace values to the repository.
predefined_ns
: predefined set of namespace values. This is a null-terminated array of xmlns_id_t. This xmlns_repository instance will assume that the instances of these xmlns_id_t values will be available throughout its life cycle; caller needs to ensure that they won’t get deleted before the corresponding xmlns_repository instance is deleted. orcus::xmlns_repository::
create_context
()¶orcus::xmlns_repository::
get_identifier
(size_t index) const¶Get XML namespace identifier from its numerical index.
index
: numeric index of namespace.orcus::xmlns_repository::
get_short_name
(xmlns_id_t ns_id) const¶orcus::xmlns_repository::
get_short_name
(size_t index) const¶XML namespace context. A new context should be used for each xml stream since the namespace keys themselves are not interned. Don’t hold an instance of this class any longer than the life cycle of the xml stream it is used in.
An empty key value is associated with a default namespace.
Public Functions
orcus::xmlns_context::
xmlns_context
(const xmlns_context &r)¶orcus::xmlns_context::
~xmlns_context
()¶orcus::xmlns_context::
push
(const pstring &key, const pstring &uri)¶orcus::xmlns_context::
get
(const pstring &key) const¶orcus::xmlns_context::
get_index
(xmlns_id_t ns_id) const¶orcus::xmlns_context::
get_short_name
(xmlns_id_t ns_id) const¶orcus::xmlns_context::
get_alias
(xmlns_id_t ns_id) const¶Get an alias currently associated with a given namespace identifier.
ns_id
: namespace identifier.orcus::xmlns_context::
get_all_namespaces
(std::vector<xmlns_id_t> &nslist) const¶orcus::xmlns_context::
dump
(std::ostream &os) const¶