namespace orcus::dom

Enum

node_t

enum class orcus::dom::node_t : uint8_t

Values:

enumerator unset
enumerator declaration
enumerator element

Struct

entity_name

struct entity_name

Public Functions

entity_name()
entity_name(std::string_view _name)
entity_name(xmlns_id_t _ns, std::string_view _name)
bool operator==(const entity_name &other) const
bool operator!=(const entity_name &other) const

Public Members

xmlns_id_t ns
std::string_view name

Classes

const_node

class const_node

Public Functions

const_node()
const_node(const const_node &other)
const_node(const_node &&other)
~const_node()
node_t type() const
size_t child_count() const
const_node child(size_t index) const
entity_name name() const
std::string_view attribute(const entity_name &name) const
std::string_view attribute(std::string_view name) const
size_t attribute_count() const
const_node parent() const
void swap(const_node &other)
const_node &operator=(const const_node &other)
bool operator==(const const_node &other) const
bool operator!=(const const_node &other) const

document_tree

class document_tree

Ordinary DOM tree representing the content of an XML document.

Public Functions

document_tree(const document_tree&) = delete
document_tree &operator=(const document_tree&) = delete
document_tree(xmlns_context &cxt)
document_tree(document_tree &&other)
~document_tree()
void load(std::string_view strm)

Parse a given XML stream and build the content tree.

Parameters:

strm – XML stream.

dom::const_node root() const
dom::const_node declaration(std::string_view name) const
void swap(document_tree &other)

Swap the content with another dom_tree instance.

Parameters:

other – the dom_tree instance to swap the content with.

const sax::doctype_declaration *get_doctype() const
void dump_compact(std::ostream &os) const