xml_name_t

Defined in header: <orcus/types.hpp>

struct xml_name_t

Represents a name with a normalized namespace in XML documents. This can be used either as an element name or as an attribute name.

Public Types

enum to_string_type

Values:

enumerator use_alias
enumerator use_short_name

Public Functions

xml_name_t() noexcept
xml_name_t(xmlns_id_t _ns, std::string_view _name)
xml_name_t(const xml_name_t &other)
xml_name_t &operator=(const xml_name_t &other)
bool operator==(const xml_name_t &other) const noexcept
bool operator!=(const xml_name_t &other) const noexcept
std::string to_string(const xmlns_context &cxt, to_string_type type) const

Convert a namespace-name value pair to a string representation with the namespace value converted to either an alias or a unique “short name”. Refer to get_alias() and get_short_name() for the explanations of an alias and short name.

Parameters:
  • cxt – namespace context object associated with the XML stream currently being parsed.

  • type – policy on how to convert a namespace identifier to a string representation.

Returns:

string representation of a namespace-name value pair.

std::string to_string(const xmlns_repository &repo) const

Convert a namespace-name value pair to a string representation with the namespace value converted to a unique “short name”. Refer to get_short_name() for the explanations of a short name.

Parameters:

repo – namespace repository.

Returns:

string representation of a namespace-name value pair.

Public Members

xmlns_id_t ns
std::string_view name