sax_parser
: public orcus::sax::parser_base¶Template-based sax parser that doesn’t use function pointer for callbacks for better performance, especially on large XML streams.
Public Functions
sax_parser
(const char *content, const size_t size, handler_type &handler)¶~sax_parser
()¶parse
()¶sax_ns_parser
¶SAX based XML parser with proper namespace handling.
Public Types
handler_type
¶Public Functions
sax_ns_parser
(const char *content, const size_t size, xmlns_context &ns_cxt, handler_type &handler)¶~sax_ns_parser
()¶parse
()¶sax_token_parser
¶XML parser that tokenizes element and attribute names while parsing.
Public Types
handler_type
¶Public Functions
sax_token_parser
(const char *content, const size_t size, const tokens &_tokens, xmlns_context &ns_cxt, handler_type &handler)¶~sax_token_parser
()¶parse
()¶xmlns_repository
¶Central XML namespace repository that stores all namespaces that are used in the current session.
Public Functions
xmlns_repository
()¶~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. create_context
()¶get_identifier
(size_t index) const¶Get XML namespace identifier from its numerical index.
index
: numeric index of namespace.get_short_name
(xmlns_id_t ns_id) const¶get_short_name
(size_t index) const¶xmlns_context
¶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
xmlns_context
(const xmlns_context &r)¶~xmlns_context
()¶push
(const pstring &key, const pstring &uri)¶get
(const pstring &key) const¶Get the currnet namespace identifier for a specified namespace alias.
key
: namespace alias to get the current namespace identifier for.get_index
(xmlns_id_t ns_id) const¶Get a unique index value associated with a specified identifier. An index value is guaranteed to be unique regardless of contexts.
ns_id
: a namespace identifier to obtain index for.get_short_name
(xmlns_id_t ns_id) const¶Get a ‘short’ name associated with a specified identifier. A short name is a string value conveniently short enough for display purposes, but still guaranteed to be unique to the identifier it is associated with.
Note that the xmlns_repository class has method of the same name, and that method works identically to this method.
ns_id
: a namespace identifier to obtain short name for.get_alias
(xmlns_id_t ns_id) const¶Get an alias currently associated with a given namespace identifier.
ns_id
: namespace identifier.get_all_namespaces
() const¶dump
(std::ostream &os) const¶