Skip to content
Snippets Groups Projects
manual.adoc 211 KiB
Newer Older
----
const char_t* xpath_variable::name() const;
xpath_value_type xpath_variable::type() const;
----

Note that each variable has a distinct type which is specified upon variable creation and can not be changed later.

[[xpath_variable::get_boolean]][[xpath_variable::get_number]][[xpath_variable::get_string]][[xpath_variable::get_node_set]]
In order to get variable value, you should use one of the following functions, depending on the variable type:

[source]
----
bool xpath_variable::get_boolean() const;
double xpath_variable::get_number() const;
const char_t* xpath_variable::get_string() const;
const xpath_node_set& xpath_variable::get_node_set() const;
----

These functions return the value of the variable. Note that no type conversions are performed; if the type mismatch occurs, a dummy value is returned (`false` for booleans, `NaN` for numbers, empty string for strings and empty set for node sets).

[[xpath_variable::set]]
In order to set variable value, you should use one of the following functions, depending on the variable type:

[source]
----
bool xpath_variable::set(bool value);
bool xpath_variable::set(double value);
bool xpath_variable::set(const char_t* value);
bool xpath_variable::set(const xpath_node_set& value);
----

These functions modify the variable value. Note that no type conversions are performed; if the type mismatch occurs, the functions return `false`; they also return `false` on allocation failure. The variable values are copied to the internal variable storage, so you can modify or destroy them after the functions return.

This is an example of using variables in XPath queries (link:samples/xpath_variables.cpp[]):

[source,indent=0]
----
include::samples/xpath_variables.cpp[tags=code] 
----

[[xpath.errors]]
=== Error handling

There are two different mechanisms for error handling in XPath implementation; the mechanism used depends on whether exception support is disabled (this is controlled with <<PUGIXML_NO_EXCEPTIONS,PUGIXML_NO_EXCEPTIONS>> define).
[[xpath_exception]][[xpath_exception::result]][[xpath_exception::what]]
By default, XPath functions throw `xpath_exception` object in case of errors; additionally, in the event any memory allocation fails, an `std::bad_alloc` exception is thrown. Also `xpath_exception` is thrown if the query is evaluated to a node set, but the return type is not node set. If the query constructor succeeds (i.e. no exception is thrown), the query object is valid. Otherwise you can get the error details via one of the following functions:

[source]
----
virtual const char* xpath_exception::what() const throw();
const xpath_parse_result& xpath_exception::result() const;
----

[[xpath_query::unspecified_bool_type]][[xpath_query::result]]
If exceptions are disabled, then in the event of parsing failure the query is initialized to invalid state; you can test if the query object is valid by using it in a boolean expression: `if (query) { ... }`. Additionally, you can get parsing result via the result() accessor:

[source]
----
const xpath_parse_result& xpath_query::result() const;
----
    
Without exceptions, evaluating invalid query results in `false`, empty string, `NaN` or an empty node set, depending on the type; evaluating a query as a node set results in an empty node set if the return type is not node set.
[[xpath_parse_result]]
The information about parsing result is returned via `xpath_parse_result` object. It contains parsing status and the offset of last successfully parsed character from the beginning of the source stream:

[source]
----
struct xpath_parse_result
{
    const char* error;
    ptrdiff_t offset;

    operator bool() const;
    const char* description() const;
};
----

[[xpath_parse_result::error]]
Parsing result is represented as the error message; it is either a null pointer, in case there is no error, or the error message in the form of ASCII zero-terminated string.

[[xpath_parse_result::description]]
`description()` member function can be used to get the error message; it never returns the null pointer, so you can safely use `description()` even if query parsing succeeded. Note that `description()` returns a `char` string even in `PUGIXML_WCHAR_MODE`; you'll have to call <<as_wide,as_wide>> to get the `wchar_t` string.
[[xpath_parse_result::offset]]
In addition to the error message, parsing result has an `offset` member, which contains the offset of last successfully parsed character. This offset is in units of <<char_t,pugi::char_t>> (bytes for character mode, wide characters for wide character mode).
[[xpath_parse_result::bool]]
Parsing result object can be implicitly converted to `bool` like this: `if (result) { ... } else { ... }`.

This is an example of XPath error handling (link:samples/xpath_error.cpp[]):

[source,indent=0]
----
include::samples/xpath_error.cpp[tags=code] 
----

[[xpath.w3c]]
=== Conformance to W3C specification

Because of the differences in document object models, performance considerations and implementation complexity, pugixml does not provide a fully conformant XPath 1.0 implementation. This is the current list of incompatibilities:

* Consecutive text nodes sharing the same parent are not merged, i.e. in `<node>text1 <![CDATA[data]]> text2</node>` node should have one text node child, but instead has three.
* Since the document type declaration is not used for parsing, `id()` function always returns an empty node set.
* Namespace nodes are not supported (affects `namespace::` axis).
* Name tests are performed on QNames in XML document instead of expanded names; for `<foo xmlns:ns1='uri' xmlns:ns2='uri'><ns1:child/><ns2:child/></foo>`, query `foo/ns1:*` will return only the first child, not both of them. Compliant XPath implementations can return both nodes if the user provides appropriate namespace declarations.
* String functions consider a character to be either a single `char` value or a single `wchar_t` value, depending on the library configuration; this means that some string functions are not fully Unicode-aware. This affects `substring()`, `string-length()` and `translate()` functions.

[[changes]]
== Changelog

=== v1.6 ^10.04.2015^

Maintenance release. Changes:

* Specification changes:
    . Attribute/text values now use more digits when printing floating point numbers to guarantee round-tripping.
    . Text nodes no longer get extra surrounding whitespace when pretty-printing nodes with mixed contents
    . Fixed translate and normalize-space XPath functions to no longer return internal NUL characters
    . Fixed buffer overrun on malformed comments inside DOCTYPE sections
    . DOCTYPE parsing can no longer run out of stack space on malformed inputs (XML parsing is now using bounded stack space)
    . Adjusted processing instruction output to avoid malformed documents if the PI value contains `?>`
[[v1.5]]
=== v1.5 ^27.11.2014^

Major release, featuring a lot of performance improvements and some new features.

* Specification changes:
    . `xml_document::load(const char_t*)` was renamed to `load_string`; the old method is still available and will be deprecated in a future release
    . `xml_node::select_single_node` was renamed to `select_node`; the old method is still available and will be deprecated in a future release.
    . Added `xml_node::append_move` and other functions for moving nodes within a document
    . Added `xpath_query::evaluate_node` for evaluating queries with a single node as a result
    . Optimized XML parsing (10-40% faster with clang/gcc, up to 10% faster with MSVC)
    . Optimized memory consumption when copying nodes in the same document (string contents is now shared)
    . Optimized node copying (10% faster for cross-document copies, 3x faster for inter-document copies; also it now consumes a constant amount of stack space)
    . Optimized node output (60% faster; also it now consumes a constant amount of stack space)
    . Optimized XPath allocation (query evaluation now results in fewer temporary allocations)
    . Optimized XPath sorting (node set sorting is 2-3x faster in some cases)
    . Optimized XPath evaluation (XPathMark suite is 100x faster; some commonly used queries are 3-4x faster)

* Compatibility improvements:
    . Fixed `xml_node::offset_debug` for corner cases
    . Fixed undefined behavior while calling memcpy in some cases
    . Fixed MSVC 2015 compilation warnings
    . Fixed `contrib/foreach.hpp` for Boost 1.56.0
    . Adjusted comment output to avoid malformed documents if the comment value contains `--`
    . Fix XPath sorting for documents that were constructed using append_buffer
    . Fix `load_file` for wide-character paths with non-ASCII characters in MinGW with C{plus}{plus}11 mode enabled
[[v1.4]]
=== v1.4 ^27.02.2014^

Major release, featuring various new features, bug fixes and compatibility improvements.

* Specification changes:
    . Documents without element nodes are now rejected with `status_no_document_element` error, unless `parse_fragment` option is used
    . Added XML fragment parsing (`parse_fragment` flag)
    . Added PCDATA whitespace trimming (`parse_trim_pcdata` flag)
    . Added long long support for `xml_attribute` and `xml_text` (`as_llong`, `as_ullong` and `set_value`/`set` overloads)
    . Added hexadecimal integer parsing support for `as_int`/`as_uint`/`as_llong`/`as_ullong`
    . Added `xml_node::append_buffer` to improve performance of assembling documents from fragments
    . `xml_named_node_iterator` is now bidirectional
    . Reduced XPath stack consumption during compilation and evaluation (useful for embedded systems)

* Compatibility improvements:
    . Improved support for platforms without wchar_t support
    . Fixed several false positives in clang static analysis
    . Fixed several compilation warnings for various GCC versions
    . Fixed undefined pointer arithmetic in XPath implementation
    . Fixed non-seekable iostream support for certain stream types, i.e. Boost `file_source` with pipe input
    . Fixed `xpath_query::return_type` for some expressions
    . Fixed dllexport issues with `xml_named_node_iterator`
    . Fixed `find_child_by_attribute` assertion for attributes with null name/value
[[v1.2]]
=== v1.2 ^1.05.2012^

Major release, featuring header-only mode, various interface enhancements (i.e. PCDATA manipulation and C{plus}{plus}11 iteration), many other features and compatibility improvements.

* New features:
    . Added `xml_text` helper class for working with PCDATA/CDATA contents of an element node
    . Added optional header-only mode (controlled by `PUGIXML_HEADER_ONLY` define)
    . Added `xml_node::children()` and `xml_node::attributes()` for C{plus}{plus}11 ranged for loop or `BOOST_FOREACH`
    . Added support for Latin-1 (ISO-8859-1) encoding conversion during loading and saving
    . Added custom default values for `xml_attribute::as_*` (they are returned if the attribute does not exist)
    . Added `parse_ws_pcdata_single` flag for preserving whitespace-only PCDATA in case it's the only child
    . Added `format_save_file_text` for `xml_document::save_file` to open files as text instead of binary (changes newlines on Windows)
    . Added `format_no_escapes` flag to disable special symbol escaping (complements `~parse_escapes`)
    . Added support for loading document from streams that do not support seeking
    . Added `PUGIXML_MEMORY_*` constants for tweaking allocation behavior (useful for embedded systems)
    . Added `PUGIXML_VERSION` preprocessor define

* Compatibility improvements:
    . Parser does not require setjmp support (improves compatibility with some embedded platforms, enables `/clr:pure` compilation)
    . STL forward declarations are no longer used (fixes SunCC/RWSTL compilation, fixes clang compilation in C{plus}{plus}11 mode)
    . Fixed AirPlay SDK, Android, Windows Mobile (WinCE) and C{plus}{plus}/CLI compilation
    . Fixed several compilation warnings for various GCC versions, Intel C{plus}{plus} compiler and Clang
    . Fixed unsafe bool conversion to avoid problems on C{plus}{plus}/CLI
    . Iterator dereference operator is const now (fixes Boost `filter_iterator` support)
    . `xml_document::save_file` now checks for file I/O errors during saving
[[v1.0]]
=== v1.0 ^1.11.2010^

Major release, featuring many XPath enhancements, wide character filename support, miscellaneous performance improvements, bug fixes and more.

* XPath:
    . XPath implementation is moved to `pugixml.cpp` (which is the only source file now); use `PUGIXML_NO_XPATH` if you want to disable XPath to reduce code size
    . XPath is now supported without exceptions (`PUGIXML_NO_EXCEPTIONS`); the error handling mechanism depends on the presence of exception support
    . XPath is now supported without STL (`PUGIXML_NO_STL`)
    . Introduced variable support
    . Introduced new `xpath_query::evaluate_string`, which works without STL
    . Introduced new `xpath_node_set` constructor (from an iterator range)
    . Evaluation function now accept attribute context nodes
    . All internal allocations use custom allocation functions
    . Improved error reporting; now a last parsed offset is returned together with the parsing error
    . Fixed memory leak for loading from streams with stream exceptions turned on
    . Fixed custom deallocation function calling with null pointer in one case
    . Fixed missing attributes for iterator category functions; all functions/classes can now be DLL-exported
    . Worked around Digital Mars compiler bug, which lead to minor read overfetches in several functions
    . `load_file` now works with 2+ Gb files in MSVC/MinGW
    . XPath: fixed memory leaks for incorrect queries
    . XPath: fixed `xpath_node()` attribute constructor with empty attribute argument
    . XPath: fixed `lang()` function for non-ASCII arguments
    . CDATA nodes containing `]]>` are printed as several nodes; while this changes the internal structure, this is the only way to escape CDATA contents
    . Memory allocation errors during parsing now preserve last parsed offset (to give an idea about parsing progress)
    . If an element node has the only child, and it is of CDATA type, then the extra indentation is omitted (previously this behavior only held for PCDATA children)
    . Added `xml_parse_result` default constructor
    . Added `xml_document::load_file` and `xml_document::save_file` with wide character paths
    . Added `as_utf8` and `as_wide` overloads for `std::wstring`/`std::string` arguments
    . Added DOCTYPE node type (`node_doctype`) and a special parse flag, `parse_doctype`, to add such nodes to the document during parsing
    . Added `parse_full` parse flag mask, which extends `parse_default` with all node type parsing flags except `parse_ws_pcdata`
    . Added `xml_node::hash_value()` and `xml_attribute::hash_value()` functions for use in hash-based containers
    . Added `internal_object()` and additional constructor for both `xml_node` and `xml_attribute` for easier marshalling (useful for language bindings)
    . Added `xml_document::document_element()` function
    . Added `xml_node::prepend_attribute`, `xml_node::prepend_child` and `xml_node::prepend_copy` functions
    . Added `xml_node::append_child`, `xml_node::prepend_child`, `xml_node::insert_child_before` and `xml_node::insert_child_after` overloads for element nodes (with name instead of type)
    . Added `xml_document::reset()` function
    . `xml_node::root()` and `xml_node::offset_debug()` are now O(1) instead of O(logN)
    . Minor parsing optimizations
    . Minor memory optimization for strings in DOM tree (`set_name`/`set_value`)
    . Memory optimization for string memory reclaiming in DOM tree (`set_name`/`set_value` now reallocate the buffer if memory waste is too big)
    . XPath: optimized document order sorting
    . XPath: optimized child/attribute axis step
    . XPath: optimized number-to-string conversions in MSVC
    . XPath: optimized concat for many arguments
    . XPath: optimized evaluation allocation mechanism: constant and document strings are not heap-allocated
    . XPath: optimized evaluation allocation mechanism: all temporaries' allocations use fast stack-like allocator
    . Removed wildcard functions (`xml_node::child_w`, `xml_node::attribute_w`, etc.)
    . Removed `xml_node::all_elements_by_name`
    . Removed `xpath_type_t` enumeration; use `xpath_value_type` instead
    . Removed `format_write_bom_utf8` enumeration; use `format_write_bom` instead
    . Removed `xml_document::precompute_document_order`, `xml_attribute::document_order` and `xml_node::document_order` functions; document order sort optimization is now automatic
    . Removed `xml_document::parse` functions and `transfer_ownership` struct; use `xml_document::load_buffer_inplace` and `xml_document::load_buffer_inplace_own` instead
    . Removed `as_utf16` function; use `as_wide` instead
[[v0.9]]
=== v0.9 ^1.07.2010^

Major release, featuring extended and improved Unicode support, miscellaneous performance improvements, bug fixes and more.

* Major Unicode improvements:
    . Introduced encoding support (automatic/manual encoding detection on load, manual encoding selection on save, conversion from/to UTF8, UTF16 LE/BE, UTF32 LE/BE)
    . Introduced `wchar_t` mode (you can set `PUGIXML_WCHAR_MODE` define to switch pugixml internal encoding from UTF8 to `wchar_t`; all functions are switched to their Unicode variants)
    . Load/save functions now support wide streams
    . Fixed document corruption on failed parsing bug
    . XPath string/number conversion improvements (increased precision, fixed crash for huge numbers)
    . Improved DOCTYPE parsing: now parser recognizes all well-formed DOCTYPE declarations
    . Fixed `xml_attribute::as_uint()` for large numbers (i.e. 2^32^-1)
    . Fixed `xml_node::first_element_by_path` for path components that are prefixes of node names, but are not exactly equal to them.
    . `parse()` API changed to `load_buffer`/`load_buffer_inplace`/`load_buffer_inplace_own`; `load_buffer` APIs do not require zero-terminated strings.
    . Renamed `as_utf16` to `as_wide`
    . Changed `xml_node::offset_debug` return type and `xml_parse_result::offset` type to `ptrdiff_t`
    . Nodes/attributes with empty names are now printed as `:anonymous`
    . Optimized document parsing and saving
    . Changed internal memory management: internal allocator is used for both metadata and name/value data; allocated pages are deleted if all allocations from them are deleted
    . Optimized memory consumption: `sizeof(xml_node_struct)` reduced from 40 bytes to 32 bytes on x86
    . Optimized debug mode parsing/saving by order of magnitude
    . All STL includes except `<exception>` in `pugixml.hpp` are replaced with forward declarations
    . `xml_node::remove_child` and `xml_node::remove_attribute` now return the operation result
    . `parse()` and `as_utf16` are left for compatibility (these functions are deprecated and will be removed in version 1.0)
    . Wildcard functions, `document_order`/`precompute_document_order` functions, `all_elements_by_name` function and `format_write_bom_utf8` flag are deprecated and will be removed in version 1.0
    . `xpath_type_t` enumeration was renamed to `xpath_value_type`; `xpath_type_t` is deprecated and will be removed in version 1.0
[[v0.5]]
=== v0.5 ^8.11.2009^

Major bugfix release. Changes:

* XPath bugfixes:
    . Fixed `translate()`, `lang()` and `concat()` functions (infinite loops/crashes)
    . Fixed compilation of queries with empty literal strings (`""`)
    . Fixed axis tests: they never add empty nodes/attributes to the resulting node set now
    . Fixed string-value evaluation for node-set (the result excluded some text descendants)
    . Fixed `self::` axis (it behaved like `ancestor-or-self::`)
    . Fixed `following::` and `preceding::` axes (they included descendent and ancestor nodes, respectively)
    . Minor fix for `namespace-uri()` function (namespace declaration scope includes the parent element of namespace declaration attribute)
    . Some incorrect queries are no longer parsed now (i.e. `foo: *`)
    . Fixed `text()`/etc. node test parsing bug (i.e. `foo[text()]` failed to compile)
    . Fixed root step (`/`) - it now selects empty node set if query is evaluated on empty node
    . Fixed string to number conversion (`"123 "` converted to NaN, `"123 .456"` converted to 123.456 - now the results are 123 and NaN, respectively)
    . Node set copying now preserves sorted type; leads to better performance on some queries
    . Fixed `xml_node::offset_debug` for PI nodes
    . Added empty attribute checks to `xml_node::remove_attribute`
    . Fixed `node_pi` and `node_declaration` copying
    . Const-correctness fixes
    . `xpath_node::select_nodes()` and related functions now throw exception if expression return type is not node set (instead of assertion)
    . `xml_node::traverse()` now sets depth to -1 for both `begin()` and `end()` callbacks (was 0 at `begin()` and -1 at `end()`)
    . In case of non-raw node printing a newline is output after PCDATA inside nodes if the PCDATA has siblings
    . UTF8 -> `wchar_t` conversion now considers 5-byte UTF8-like sequences as invalid
    . Added `xpath_node_set::operator[]` for index-based iteration
    . Added `xpath_query::return_type()`
    . Added getter accessors for memory-management functions
[[v0.42]]
=== v0.42 ^17.09.2009^

Maintenance release. Changes:

* Bug fixes:
    . Fixed deallocation in case of custom allocation functions or if `delete[]` / `free` are incompatible
    . XPath parser fixed for incorrect queries (i.e. incorrect XPath queries should now always fail to compile)
    . Const-correctness fixes for `find_child_by_attribute`
    . Improved compatibility (miscellaneous warning fixes, fixed `<cstring>` include dependency for GCC)
    . Fixed iterator begin/end and print function to work correctly for empty nodes
    . Added `PUGIXML_API`/`PUGIXML_CLASS`/`PUGIXML_FUNCTION` configuration macros to control class/function attributes
    . Added `xml_attribute::set_value` overloads for different types
[[v0.41]]
=== v0.41 ^8.02.2009^

Maintenance release. Changes:

* Bug fixes:
    . Fixed bug with node printing (occasionally some content was not written to output stream)
[[v0.4]]
=== v0.4 ^18.01.2009^
    . Documentation fix in samples for `parse()` with manual lifetime control
    . Fixed document order sorting in XPath (it caused wrong order of nodes after `xpath_node_set::sort` and wrong results of some XPath queries)
    . Single quotes are no longer escaped when printing nodes
    . Symbols in second half of ASCII table are no longer escaped when printing nodes; because of this, `format_utf8` flag is deleted as it's no longer needed and `format_write_bom` is renamed to `format_write_bom_utf8`.
    . Reworked node printing - now it works via `xml_writer` interface; implementations for `FILE*` and `std::ostream` are available. As a side-effect, `xml_document::save_file` now works without STL.
    . Added unsigned integer support for attributes (`xml_attribute::as_uint`, `xml_attribute::operator=`)
    . Now document declaration (`<?xml ...?>`) is parsed as node with type `node_declaration` when `parse_declaration` flag is specified (access to encoding/version is performed as if they were attributes, i.e. `doc.child("xml").attribute("version").as_float()`); corresponding flags for node printing were also added
    . Added support for custom memory management (see `set_memory_management_functions` for details)
    . Implemented node/attribute copying (see `xml_node::insert_copy_*` and `xml_node::append_copy` for details)
    . Added `find_child_by_attribute` and `find_child_by_attribute_w` to simplify parsing code in some cases (i.e. COLLADA files)
    . Added file offset information querying for debugging purposes (now you're able to determine exact location of any `xml_node` in parsed file, see `xml_node::offset_debug` for details)
    . Improved error handling for parsing - now `load()`, `load_file()` and `parse()` return `xml_parse_result`, which contains error code and last parsed offset; this does not break old interface as `xml_parse_result` can be implicitly casted to `bool`.
[[v0.34]]
=== v0.34 ^31.10.2007^

Maintenance release. Changes:

* Bug fixes:
    . Fixed bug with loading from text-mode iostreams
    . Fixed leak when `transfer_ownership` is true and parsing is failing
    . Fixed bug in saving (`\r` and `\n` are now escaped in attribute values)
    . Renamed `free()` to `destroy()` - some macro conflicts were reported
    . Improved compatibility (supported Digital Mars C{plus}{plus}, MSVC 6, CodeWarrior 8, PGI C{plus}{plus}, Comeau, supported PS3 and XBox360)
    . `PUGIXML_NO_EXCEPTION` flag for platforms without exception handling
[[v0.3]]
=== v0.3 ^21.02.2007^

Refactored, reworked and improved version. Changes:

* Interface:
    . Added XPath
    . Added tree modification functions
    . Added no STL compilation mode
    . Added saving document to file
    . Refactored parsing flags
    . Removed `xml_parser` class in favor of `xml_document`
    . Added transfer ownership parsing mode
    . Modified the way `xml_tree_walker` works
    . Iterators are now non-constant
    . Support of several compilers and platforms
    . Refactored and sped up parsing core
    . Improved standard compliancy
    . Added XPath implementation
    . Fixed several bugs
[[v0.2]]
=== v0.2 ^6.11.2006^

First public release. Changes:

* Bug fixes:
    . Fixed `child_value()` (for empty nodes)
    . Fixed `xml_parser_impl` warning at W4
    . Introduced `child_value(name)` and `child_value_w(name)`
    . `parse_eol_pcdata` and `parse_eol_attribute` flags + `parse_minimal` optimizations
    . Optimizations of `strconv_t`
[[v0.1]]
=== v0.1 ^15.07.2006^

First private release for testing purposes

[[apiref]]
== API Reference

This is the reference for all macros, types, enumerations, classes and functions in pugixml. Each symbol is a link that leads to the relevant section of the manual.

[[apiref.macros]]
=== Macros
[source,subs="+macros"]
----
#define +++<a href="#PUGIXML_WCHAR_MODE">PUGIXML_WCHAR_MODE</a>+++
#define +++<a href="#PUGIXML_COMPACT">PUGIXML_COMPACT</a>+++
#define +++<a href="#PUGIXML_NO_XPATH">PUGIXML_NO_XPATH</a>+++
#define +++<a href="#PUGIXML_NO_STL">PUGIXML_NO_STL</a>+++
#define +++<a href="#PUGIXML_NO_EXCEPTIONS">PUGIXML_NO_EXCEPTIONS</a>+++
#define +++<a href="#PUGIXML_API">PUGIXML_API</a>+++
#define +++<a href="#PUGIXML_CLASS">PUGIXML_CLASS</a>+++
#define +++<a href="#PUGIXML_FUNCTION">PUGIXML_FUNCTION</a>+++
#define +++<a href="#PUGIXML_MEMORY_PAGE_SIZE">PUGIXML_MEMORY_PAGE_SIZE</a>+++
#define +++<a href="#PUGIXML_MEMORY_OUTPUT_STACK">PUGIXML_MEMORY_OUTPUT_STACK</a>+++
#define +++<a href="#PUGIXML_MEMORY_XPATH_PAGE_SIZE">PUGIXML_MEMORY_XPATH_PAGE_SIZE</a>+++
#define +++<a href="#PUGIXML_HEADER_ONLY">PUGIXML_HEADER_ONLY</a>+++
#define +++<a href="#PUGIXML_HAS_LONG_LONG">PUGIXML_HAS_LONG_LONG</a>+++
[[apiref.types]]
=== Types
[source,subs="+macros"]
typedef configuration-defined-type +++<a href="#char_t">char_t</a>+++;
typedef configuration-defined-type +++<a href="#string_t">string_t</a>+++;
typedef void* (*+++<a href="#allocation_function">allocation_function</a>+++)(size_t size);
typedef void (*+++<a href="#deallocation_function">deallocation_function</a>+++)(void* ptr);
[[apiref.enums]]
=== Enumerations
[source,subs="+macros"]
----
enum +++<a href="#xml_node_type">xml_node_type</a>+++
    +++<a href="#node_null">node_null</a>+++
    +++<a href="#node_document">node_document</a>+++
    +++<a href="#node_element">node_element</a>+++
    +++<a href="#node_pcdata">node_pcdata</a>+++
    +++<a href="#node_cdata">node_cdata</a>+++
    +++<a href="#node_comment">node_comment</a>+++
    +++<a href="#node_pi">node_pi</a>+++
    +++<a href="#node_declaration">node_declaration</a>+++
    +++<a href="#node_doctype">node_doctype</a>+++

enum +++<a href="#xml_parse_status">xml_parse_status</a>+++
    +++<a href="#status_ok">status_ok</a>+++
    +++<a href="#status_file_not_found">status_file_not_found</a>+++
    +++<a href="#status_io_error">status_io_error</a>+++
    +++<a href="#status_out_of_memory">status_out_of_memory</a>+++
    +++<a href="#status_internal_error">status_internal_error</a>+++
    +++<a href="#status_unrecognized_tag">status_unrecognized_tag</a>+++
    +++<a href="#status_bad_pi">status_bad_pi</a>+++
    +++<a href="#status_bad_comment">status_bad_comment</a>+++
    +++<a href="#status_bad_cdata">status_bad_cdata</a>+++
    +++<a href="#status_bad_doctype">status_bad_doctype</a>+++
    +++<a href="#status_bad_pcdata">status_bad_pcdata</a>+++
    +++<a href="#status_bad_start_element">status_bad_start_element</a>+++
    +++<a href="#status_bad_attribute">status_bad_attribute</a>+++
    +++<a href="#status_bad_end_element">status_bad_end_element</a>+++
    +++<a href="#status_end_element_mismatch">status_end_element_mismatch</a>+++
    +++<a href="#status_append_invalid_root">status_append_invalid_root</a>+++
    +++<a href="#status_no_document_element">status_no_document_element</a>+++

enum +++<a href="#xml_encoding">xml_encoding</a>+++
    +++<a href="#encoding_auto">encoding_auto</a>+++
    +++<a href="#encoding_utf8">encoding_utf8</a>+++
    +++<a href="#encoding_utf16_le">encoding_utf16_le</a>+++
    +++<a href="#encoding_utf16_be">encoding_utf16_be</a>+++
    +++<a href="#encoding_utf16">encoding_utf16</a>+++
    +++<a href="#encoding_utf32_le">encoding_utf32_le</a>+++
    +++<a href="#encoding_utf32_be">encoding_utf32_be</a>+++
    +++<a href="#encoding_utf32">encoding_utf32</a>+++
    +++<a href="#encoding_wchar">encoding_wchar</a>+++
    +++<a href="#encoding_latin1">encoding_latin1</a>+++

enum +++<a href="#xpath_value_type">xpath_value_type</a>+++
    +++<a href="#xpath_type_none">xpath_type_none</a>+++
    +++<a href="#xpath_type_node_set">xpath_type_node_set</a>+++
    +++<a href="#xpath_type_number">xpath_type_number</a>+++
    +++<a href="#xpath_type_string">xpath_type_string</a>+++
    +++<a href="#xpath_type_boolean">xpath_type_boolean</a>+++
[[apiref.constants]]
=== Constants
[source,subs="+macros"]
----
// Formatting options bit flags:
const unsigned int +++<a href="#format_default">format_default</a>+++
const unsigned int +++<a href="#format_indent">format_indent</a>+++
const unsigned int +++<a href="#format_indent_attributes">format_indent_attributes</a>+++
const unsigned int +++<a href="#format_no_declaration">format_no_declaration</a>+++
const unsigned int +++<a href="#format_no_escapes">format_no_escapes</a>+++
const unsigned int +++<a href="#format_raw">format_raw</a>+++
const unsigned int +++<a href="#format_save_file_text">format_save_file_text</a>+++
const unsigned int +++<a href="#format_write_bom">format_write_bom</a>+++

// Parsing options bit flags:
const unsigned int +++<a href="#parse_cdata">parse_cdata</a>+++
const unsigned int +++<a href="#parse_comments">parse_comments</a>+++
const unsigned int +++<a href="#parse_declaration">parse_declaration</a>+++
const unsigned int +++<a href="#parse_default">parse_default</a>+++
const unsigned int +++<a href="#parse_doctype">parse_doctype</a>+++
const unsigned int +++<a href="#parse_eol">parse_eol</a>+++
const unsigned int +++<a href="#parse_escapes">parse_escapes</a>+++
const unsigned int +++<a href="#parse_fragment">parse_fragment</a>+++
const unsigned int +++<a href="#parse_full">parse_full</a>+++
const unsigned int +++<a href="#parse_minimal">parse_minimal</a>+++
const unsigned int +++<a href="#parse_pi">parse_pi</a>+++
const unsigned int +++<a href="#parse_trim_pcdata">parse_trim_pcdata</a>+++
const unsigned int +++<a href="#parse_ws_pcdata">parse_ws_pcdata</a>+++
const unsigned int +++<a href="#parse_ws_pcdata_single">parse_ws_pcdata_single</a>+++
const unsigned int +++<a href="#parse_wconv_attribute">parse_wconv_attribute</a>+++
const unsigned int +++<a href="#parse_wnorm_attribute">parse_wnorm_attribute</a>+++
[[apiref.classes]]
=== Classes
[source,subs="+macros"]
----
+++<span class="tok-k">class</span> <a href="#xml_attribute">xml_attribute</a>+++
    +++<a href="#xml_attribute::ctor">xml_attribute</a>+++();

    bool +++<a href="#xml_attribute::empty">empty</a>+++() const;
    operator +++<a href="#xml_attribute::unspecified_bool_type">unspecified_bool_type</a>+++() const;

    bool +++<a href="#xml_attribute::comparison">operator==</a>+++(const xml_attribute& r) const;
    bool +++<a href="#xml_attribute::comparison">operator!=</a>+++(const xml_attribute& r) const;
    bool +++<a href="#xml_attribute::comparison">operator&lt;</a>+++(const xml_attribute& r) const;
    bool +++<a href="#xml_attribute::comparison">operator&gt;</a>+++(const xml_attribute& r) const;
    bool +++<a href="#xml_attribute::comparison">operator&lt;=</a>+++(const xml_attribute& r) const;
    bool +++<a href="#xml_attribute::comparison">operator&gt;=</a>+++(const xml_attribute& r) const;

    size_t +++<a href="#xml_attribute::hash_value">hash_value</a>+++() const;

    xml_attribute +++<a href="#xml_attribute::next_attribute">next_attribute</a>+++() const;
    xml_attribute +++<a href="#xml_attribute::previous_attribute">previous_attribute</a>+++() const;

    const char_t* +++<a href="#xml_attribute::name">name</a>+++() const;
    const char_t* +++<a href="#xml_attribute::value">value</a>+++() const;

    const char_t* +++<a href="#xml_attribute::as_string">as_string</a>+++(const char_t* def = "") const;
    int +++<a href="#xml_attribute::as_int">as_int</a>+++(int def = 0) const;
    unsigned int +++<a href="#xml_attribute::as_uint">as_uint</a>+++(unsigned int def = 0) const;
    double +++<a href="#xml_attribute::as_double">as_double</a>+++(double def = 0) const;
    float +++<a href="#xml_attribute::as_float">as_float</a>+++(float def = 0) const;
    bool +++<a href="#xml_attribute::as_bool">as_bool</a>+++(bool def = false) const;
    long long +++<a href="#xml_attribute::as_llong">as_llong</a>+++(long long def = 0) const;
    unsigned long long +++<a href="#xml_attribute::as_ullong">as_ullong</a>+++(unsigned long long def = 0) const;

    bool +++<a href="#xml_attribute::set_name">set_name</a>+++(const char_t* rhs);
    bool +++<a href="#xml_attribute::set_value">set_value</a>+++(const char_t* rhs);
    bool +++<a href="#xml_attribute::set_value">set_value</a>+++(int rhs);
    bool +++<a href="#xml_attribute::set_value">set_value</a>+++(unsigned int rhs);
    bool +++<a href="#xml_attribute::set_value">set_value</a>+++(double rhs);
    bool +++<a href="#xml_attribute::set_value">set_value</a>+++(float rhs);
    bool +++<a href="#xml_attribute::set_value">set_value</a>+++(bool rhs);
    bool +++<a href="#xml_attribute::set_value">set_value</a>+++(long long rhs);
    bool +++<a href="#xml_attribute::set_value">set_value</a>+++(unsigned long long rhs);

    xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(const char_t* rhs);
    xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(int rhs);
    xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(unsigned int rhs);
    xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(double rhs);
    xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(float rhs);
    xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(bool rhs);
    xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(long long rhs);
    xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(unsnigned long long rhs);

+++<span class="tok-k">class</span> <a href="#xml_node">xml_node</a>+++
    +++<a href="#xml_node::ctor">xml_node</a>+++();

    bool +++<a href="#xml_node::empty">empty</a>+++() const;
    operator +++<a href="#xml_node::unspecified_bool_type">unspecified_bool_type</a>+++() const;

    bool +++<a href="#xml_node::comparison">operator==</a>+++(const xml_node& r) const;
    bool +++<a href="#xml_node::comparison">operator!=</a>+++(const xml_node& r) const;
    bool +++<a href="#xml_node::comparison">operator&lt;</a>+++(const xml_node& r) const;
    bool +++<a href="#xml_node::comparison">operator&gt;</a>+++(const xml_node& r) const;
    bool +++<a href="#xml_node::comparison">operator&lt;=</a>+++(const xml_node& r) const;
    bool +++<a href="#xml_node::comparison">operator&gt;=</a>+++(const xml_node& r) const;

    size_t +++<a href="#xml_node::hash_value">hash_value</a>+++() const;

    xml_node_type +++<a href="#xml_node::type">type</a>+++() const;

    const char_t* +++<a href="#xml_node::name">name</a>+++() const;
    const char_t* +++<a href="#xml_node::value">value</a>+++() const;

    xml_node +++<a href="#xml_node::parent">parent</a>+++() const;
    xml_node +++<a href="#xml_node::first_child">first_child</a>+++() const;
    xml_node +++<a href="#xml_node::last_child">last_child</a>+++() const;
    xml_node +++<a href="#xml_node::next_sibling">next_sibling</a>+++() const;
    xml_node +++<a href="#xml_node::previous_sibling">previous_sibling</a>+++() const;

    xml_attribute +++<a href="#xml_node::first_attribute">first_attribute</a>+++() const;
    xml_attribute +++<a href="#xml_node::last_attribute">last_attribute</a>+++() const;

    implementation-defined-type +++<a href="#xml_node::children">children</a>+++() const;
    implementation-defined-type +++<a href="#xml_node::children">children</a>+++(const char_t* name) const;
    implementation-defined-type +++<a href="#xml_node::attributes">attributes</a>+++() const;

    xml_node +++<a href="#xml_node::child">child</a>+++(const char_t* name) const;
    xml_attribute +++<a href="#xml_node::attribute">attribute</a>+++(const char_t* name) const;
    xml_node +++<a href="#xml_node::next_sibling_name">next_sibling</a>+++(const char_t* name) const;
    xml_node +++<a href="#xml_node::previous_sibling_name">previous_sibling</a>+++(const char_t* name) const;
    xml_node +++<a href="#xml_node::find_child_by_attribute">find_child_by_attribute</a>+++(const char_t* name, const char_t* attr_name, const char_t* attr_value) const;
    xml_node +++<a href="#xml_node::find_child_by_attribute">find_child_by_attribute</a>+++(const char_t* attr_name, const char_t* attr_value) const;

    const char_t* +++<a href="#xml_node::child_value">child_value</a>+++() const;
    const char_t* +++<a href="#xml_node::child_value">child_value</a>+++(const char_t* name) const;
    xml_text +++<a href="#xml_node::text">text</a>+++() const;

    typedef xml_node_iterator +++<a href="#xml_node_iterator">iterator</a>+++;
    iterator +++<a href="#xml_node::begin">begin</a>+++() const;
    iterator +++<a href="#xml_node::end">end</a>+++() const;

    typedef xml_attribute_iterator +++<a href="#xml_attribute_iterator">attribute_iterator</a>+++;
    attribute_iterator +++<a href="#xml_node::attributes_begin">attributes_begin</a>+++() const;
    attribute_iterator +++<a href="#xml_node::attributes_end">attributes_end</a>+++() const;

    bool +++<a href="#xml_node::traverse">traverse</a>+++(xml_tree_walker& walker);

    template <typename Predicate> xml_attribute +++<a href="#xml_node::find_attribute">find_attribute</a>+++(Predicate pred) const;
    template <typename Predicate> xml_node +++<a href="#xml_node::find_child">find_child</a>+++(Predicate pred) const;
    template <typename Predicate> xml_node +++<a href="#xml_node::find_node">find_node</a>+++(Predicate pred) const;

    string_t +++<a href="#xml_node::path">path</a>+++(char_t delimiter = '/') const;
    xml_node +++<a href="#xml_node::first_element_by_path">xml_node::first_element_by_path</a>+++(const char_t* path, char_t delimiter = '/') const;
    xml_node +++<a href="#xml_node::root">root</a>+++() const;
    ptrdiff_t +++<a href="#xml_node::offset_debug">offset_debug</a>+++() const;
    bool +++<a href="#xml_node::set_name">set_name</a>+++(const char_t* rhs);
    bool +++<a href="#xml_node::set_value">set_value</a>+++(const char_t* rhs);
    xml_attribute +++<a href="#xml_node::append_attribute">append_attribute</a>+++(const char_t* name);
    xml_attribute +++<a href="#xml_node::prepend_attribute">prepend_attribute</a>+++(const char_t* name);
    xml_attribute +++<a href="#xml_node::insert_attribute_after">insert_attribute_after</a>+++(const char_t* name, const xml_attribute& attr);
    xml_attribute +++<a href="#xml_node::insert_attribute_before">insert_attribute_before</a>+++(const char_t* name, const xml_attribute& attr);

    xml_node +++<a href="#xml_node::append_child">append_child</a>+++(xml_node_type type = node_element);
    xml_node +++<a href="#xml_node::prepend_child">prepend_child</a>+++(xml_node_type type = node_element);
    xml_node +++<a href="#xml_node::insert_child_after">insert_child_after</a>+++(xml_node_type type, const xml_node& node);
    xml_node +++<a href="#xml_node::insert_child_before">insert_child_before</a>+++(xml_node_type type, const xml_node& node);

    xml_node +++<a href="#xml_node::append_child">append_child</a>+++(const char_t* name);
    xml_node +++<a href="#xml_node::prepend_child">prepend_child</a>+++(const char_t* name);
    xml_node +++<a href="#xml_node::insert_child_after">insert_child_after</a>+++(const char_t* name, const xml_node& node);
    xml_node +++<a href="#xml_node::insert_child_before">insert_child_before</a>+++(const char_t* name, const xml_node& node);

    xml_attribute +++<a href="#xml_node::append_copy">append_copy</a>+++(const xml_attribute& proto);
    xml_attribute +++<a href="#xml_node::prepend_copy">prepend_copy</a>+++(const xml_attribute& proto);
    xml_attribute +++<a href="#xml_node::insert_copy_after">insert_copy_after</a>+++(const xml_attribute& proto, const xml_attribute& attr);
    xml_attribute +++<a href="#xml_node::insert_copy_before">insert_copy_before</a>+++(const xml_attribute& proto, const xml_attribute& attr);

    xml_node +++<a href="#xml_node::append_copy">append_copy</a>+++(const xml_node& proto);
    xml_node +++<a href="#xml_node::prepend_copy">prepend_copy</a>+++(const xml_node& proto);
    xml_node +++<a href="#xml_node::insert_copy_after">insert_copy_after</a>+++(const xml_node& proto, const xml_node& node);
    xml_node +++<a href="#xml_node::insert_copy_before">insert_copy_before</a>+++(const xml_node& proto, const xml_node& node);

    xml_node +++<a href="#xml_node::append_move">append_move</a>+++(const xml_node& moved);
    xml_node +++<a href="#xml_node::prepend_move">prepend_move</a>+++(const xml_node& moved);
    xml_node +++<a href="#xml_node::insert_move_after">insert_move_after</a>+++(const xml_node& moved, const xml_node& node);
    xml_node +++<a href="#xml_node::insert_move_before">insert_move_before</a>+++(const xml_node& moved, const xml_node& node);
    bool +++<a href="#xml_node::remove_attribute">remove_attribute</a>+++(const xml_attribute& a);
    bool +++<a href="#xml_node::remove_attribute">remove_attribute</a>+++(const char_t* name);
    bool +++<a href="#xml_node::remove_child">remove_child</a>+++(const xml_node& n);
    bool +++<a href="#xml_node::remove_child">remove_child</a>+++(const char_t* name);
    xml_parse_result +++<a href="#xml_node::append_buffer">append_buffer</a>+++(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
    void +++<a href="#xml_node::print">print</a>+++(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
    void +++<a href="#xml_node::print_stream">print</a>+++(std::ostream& os, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto, unsigned int depth = 0) const;
    void +++<a href="#xml_node::print_stream">print</a>+++(std::wostream& os, const char_t* indent = "\t", unsigned int flags = format_default, unsigned int depth = 0) const;
    xpath_node +++<a href="#xml_node::select_node">select_node</a>+++(const char_t* query, xpath_variable_set* variables = 0) const;
    xpath_node +++<a href="#xml_node::select_node_precomp">select_node</a>+++(const xpath_query& query) const;
    xpath_node_set +++<a href="#xml_node::select_nodes">select_nodes</a>+++(const char_t* query, xpath_variable_set* variables = 0) const;
    xpath_node_set +++<a href="#xml_node::select_nodes_precomp">select_nodes</a>+++(const xpath_query& query) const;
+++<span class="tok-k">class</span> <a href="#xml_document">xml_document</a>+++
    +++<a href="#xml_document::ctor">xml_document</a>+++();
    ~+++<a href="#xml_document::dtor">xml_document</a>+++();
    void +++<a href="#xml_document::reset">reset</a>+++();
    void +++<a href="#xml_document::reset">reset</a>+++(const xml_document& proto);
    xml_parse_result +++<a href="#xml_document::load_stream">load</a>+++(std::istream& stream, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
    xml_parse_result +++<a href="#xml_document::load_stream">load</a>+++(std::wistream& stream, unsigned int options = parse_default);
    xml_parse_result +++<a href="#xml_document::load_string">load_string</a>+++(const char_t* contents, unsigned int options = parse_default);
    xml_parse_result +++<a href="#xml_document::load_file">load_file</a>+++(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
    xml_parse_result +++<a href="#xml_document::load_file_wide">load_file</a>+++(const wchar_t* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
    xml_parse_result +++<a href="#xml_document::load_buffer">load_buffer</a>+++(const void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
    xml_parse_result +++<a href="#xml_document::load_buffer_inplace">load_buffer_inplace</a>+++(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
    xml_parse_result +++<a href="#xml_document::load_buffer_inplace_own">load_buffer_inplace_own</a>+++(void* contents, size_t size, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
    bool +++<a href="#xml_document::save_file">save_file</a>+++(const char* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
    bool +++<a href="#xml_document::save_file_wide">save_file</a>+++(const wchar_t* path, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
    void +++<a href="#xml_document::save_stream">save</a>+++(std::ostream& stream, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
    void +++<a href="#xml_document::save_stream">save</a>+++(std::wostream& stream, const char_t* indent = "\t", unsigned int flags = format_default) const;
    void +++<a href="#xml_document::save">save</a>+++(xml_writer& writer, const char_t* indent = "\t", unsigned int flags = format_default, xml_encoding encoding = encoding_auto) const;
    xml_node +++<a href="#xml_document::document_element">document_element</a>+++() const;
+++<span class="tok-k">struct</span> <a href="#xml_parse_result">xml_parse_result</a>+++
    xml_parse_status +++<a href="#xml_parse_result::status">status</a>+++;
    ptrdiff_t +++<a href="#xml_parse_result::offset">offset</a>+++;
    xml_encoding +++<a href="#xml_parse_result::encoding">encoding</a>+++;
    operator +++<a href="#xml_parse_result::bool">bool</a>+++() const;
    const char* +++<a href="#xml_parse_result::description">description</a>+++() const;
+++<span class="tok-k">class</span> <a href="#xml_node_iterator">xml_node_iterator</a>+++
+++<span class="tok-k">class</span> <a href="#xml_attribute_iterator">xml_attribute_iterator</a>+++
+++<span class="tok-k">class</span> <a href="#xml_tree_walker">xml_tree_walker</a>+++
    virtual bool +++<a href="#xml_tree_walker::begin">begin</a>+++(xml_node& node);
    virtual bool +++<a href="#xml_tree_walker::for_each">for_each</a>+++(xml_node& node) = 0;
    virtual bool +++<a href="#xml_tree_walker::end">end</a>+++(xml_node& node);
    int +++<a href="#xml_tree_walker::depth">depth</a>+++() const;
+++<span class="tok-k">class</span> <a href="#xml_text">xml_text</a>+++
    bool +++<a href="#xml_text::empty">empty</a>+++() const;
    operator +++<a href="#xml_text::unspecified_bool_type">xml_text::unspecified_bool_type</a>+++() const;
    const char_t* +++<a href="#xml_text::get">xml_text::get</a>+++() const;
    const char_t* +++<a href="#xml_text::as_string">as_string</a>+++(const char_t* def = "") const;
    int +++<a href="#xml_text::as_int">as_int</a>+++(int def = 0) const;
    unsigned int +++<a href="#xml_text::as_uint">as_uint</a>+++(unsigned int def = 0) const;
    double +++<a href="#xml_text::as_double">as_double</a>+++(double def = 0) const;
    float +++<a href="#xml_text::as_float">as_float</a>+++(float def = 0) const;
    bool +++<a href="#xml_text::as_bool">as_bool</a>+++(bool def = false) const;
    long long +++<a href="#xml_text::as_llong">as_llong</a>+++(long long def = 0) const;
    unsigned long long +++<a href="#xml_text::as_ullong">as_ullong</a>+++(unsigned long long def = 0) const;
    bool +++<a href="#xml_text::set">set</a>+++(const char_t* rhs);
    bool +++<a href="#xml_text::set">set</a>+++(int rhs);
    bool +++<a href="#xml_text::set">set</a>+++(unsigned int rhs);
    bool +++<a href="#xml_text::set">set</a>+++(double rhs);
    bool +++<a href="#xml_text::set">set</a>+++(float rhs);
    bool +++<a href="#xml_text::set">set</a>+++(bool rhs);
    bool +++<a href="#xml_text::set">set</a>+++(long long rhs);
    bool +++<a href="#xml_text::set">set</a>+++(unsigned long long rhs);
    xml_text& +++<a href="#xml_text::assign">operator=</a>+++(const char_t* rhs);
    xml_text& +++<a href="#xml_text::assign">operator=</a>+++(int rhs);
    xml_text& +++<a href="#xml_text::assign">operator=</a>+++(unsigned int rhs);
    xml_text& +++<a href="#xml_text::assign">operator=</a>+++(double rhs);
    xml_text& +++<a href="#xml_text::assign">operator=</a>+++(float rhs);
    xml_text& +++<a href="#xml_text::assign">operator=</a>+++(bool rhs);
    xml_text& +++<a href="#xml_text::assign">operator=</a>+++(long long rhs);
    xml_text& +++<a href="#xml_text::assign">operator=</a>+++(unsigned long long rhs);
    xml_node +++<a href="#xml_text::data">data</a>+++() const;
+++<span class="tok-k">class</span> <a href="#xml_writer">xml_writer</a>+++
    virtual void +++<a href="#xml_writer::write">write</a>+++(const void* data, size_t size) = 0;
+++<span class="tok-k">class</span> <a href="#xml_writer_file">xml_writer_file</a>+++: public xml_writer
    +++<a href="#xml_writer_file">xml_writer_file</a>+++(void* file);
+++<span class="tok-k">class</span> <a href="#xml_writer_stream">xml_writer_stream</a>+++: public xml_writer
    +++<a href="#xml_writer_stream">xml_writer_stream</a>+++(std::ostream& stream);
    +++<a href="#xml_writer_stream">xml_writer_stream</a>+++(std::wostream& stream);
+++<span class="tok-k">struct</span> <a href="#xpath_parse_result">xpath_parse_result</a>+++
    const char* +++<a href="#xpath_parse_result::error">error</a>+++;
    ptrdiff_t +++<a href="#xpath_parse_result::offset">offset</a>+++;
    operator +++<a href="#xpath_parse_result::bool">bool</a>+++() const;
    const char* +++<a href="#xpath_parse_result::description">description</a>+++() const;
+++<span class="tok-k">class</span> <a href="#xpath_query">xpath_query</a>+++
    explicit +++<a href="#xpath_query::ctor">xpath_query</a>+++(const char_t* query, xpath_variable_set* variables = 0);
    bool +++<a href="#xpath_query::evaluate_boolean">evaluate_boolean</a>+++(const xpath_node& n) const;
    double +++<a href="#xpath_query::evaluate_number">evaluate_number</a>+++(const xpath_node& n) const;
    string_t +++<a href="#xpath_query::evaluate_string">evaluate_string</a>+++(const xpath_node& n) const;
    size_t +++<a href="#xpath_query::evaluate_string_buffer">evaluate_string</a>+++(char_t* buffer, size_t capacity, const xpath_node& n) const;
    xpath_node_set +++<a href="#xpath_query::evaluate_node_set">evaluate_node_set</a>+++(const xpath_node& n) const;
    xpath_node +++<a href="#xpath_query::evaluate_node">evaluate_node</a>+++(const xpath_node& n) const;
    xpath_value_type +++<a href="#xpath_query::return_type">return_type</a>+++() const;
    const xpath_parse_result& +++<a href="#xpath_query::result">result</a>+++() const;
    operator +++<a href="#xpath_query::unspecified_bool_type">unspecified_bool_type</a>+++() const;
+++<span class="tok-k">class</span> <a href="#xpath_exception">xpath_exception</a>+++: public std::exception
    virtual const char* +++<a href="#xpath_exception::what">what</a>+++() const throw();
    const xpath_parse_result& +++<a href="#xpath_exception::result">result</a>+++() const;
+++<span class="tok-k">class</span> <a href="#xpath_node">xpath_node</a>+++
    +++<a href="#xpath_node::ctor">xpath_node</a>+++();
    +++<a href="#xpath_node::ctor">xpath_node</a>+++(const xml_node& node);
    +++<a href="#xpath_node::ctor">xpath_node</a>+++(const xml_attribute& attribute, const xml_node& parent);
    xml_node +++<a href="#xpath_node::node">node</a>+++() const;
    xml_attribute +++<a href="#xpath_node::attribute">attribute</a>+++() const;
    xml_node +++<a href="#xpath_node::parent">parent</a>+++() const;
    operator +++<a href="#xpath_node::unspecified_bool_type">unspecified_bool_type</a>+++() const;
    bool +++<a href="#xpath_node::comparison">operator==</a>+++(const xpath_node& n) const;
    bool +++<a href="#xpath_node::comparison">operator!=</a>+++(const xpath_node& n) const;
+++<span class="tok-k">class</span> <a href="#xpath_node_set">xpath_node_set</a>+++
    +++<a href="#xpath_node_set::ctor">xpath_node_set</a>+++();
    +++<a href="#xpath_node_set::ctor">xpath_node_set</a>+++(const_iterator begin, const_iterator end, type_t type = type_unsorted);
    typedef const xpath_node* +++<a href="#xpath_node_set::const_iterator">const_iterator</a>+++;
    const_iterator +++<a href="#xpath_node_set::begin">begin</a>+++() const;
    const_iterator +++<a href="#xpath_node_set::end">end</a>+++() const;
    const xpath_node& +++<a href="#xpath_node_set::index">operator[</a>+++](size_t index) const;
    size_t +++<a href="#xpath_node_set::size">size</a>+++() const;
    bool +++<a href="#xpath_node_set::empty">empty</a>+++() const;
    xpath_node +++<a href="#xpath_node_set::first">first</a>+++() const;
    enum type_t {+++<a href="#xpath_node_set::type_unsorted">type_unsorted</a>+++, +++<a href="#xpath_node_set::type_sorted">type_sorted</a>+++, +++<a href="#xpath_node_set::type_sorted_reverse">type_sorted_reverse</a>+++};
    type_t +++<a href="#xpath_node_set::type">type</a>+++() const;
    void +++<a href="#xpath_node_set::sort">sort</a>+++(bool reverse = false);
+++<span class="tok-k">class</span> <a href="#xpath_variable">xpath_variable</a>+++
    const char_t* +++<a href="#xpath_variable::name">name</a>+++() const;
    xpath_value_type +++<a href="#xpath_variable::type">type</a>+++() const;
    bool +++<a href="#xpath_variable::get_boolean">get_boolean</a>+++() const;
    double +++<a href="#xpath_variable::get_number">get_number</a>+++() const;
    const char_t* +++<a href="#xpath_variable::get_string">get_string</a>+++() const;
    const xpath_node_set& +++<a href="#xpath_variable::get_node_set">get_node_set</a>+++() const;
    bool +++<a href="#xpath_variable::set">set</a>+++(bool value);
    bool +++<a href="#xpath_variable::set">set</a>+++(double value);
    bool +++<a href="#xpath_variable::set">set</a>+++(const char_t* value);
    bool +++<a href="#xpath_variable::set">set</a>+++(const xpath_node_set& value);
+++<span class="tok-k">class</span> <a href="#xpath_variable_set">xpath_variable_set</a>+++
    xpath_variable* +++<a href="#xpath_variable_set::add">add</a>+++(const char_t* name, xpath_value_type type);
    bool +++<a href="#xpath_variable_set::set">set</a>+++(const char_t* name, bool value);
    bool +++<a href="#xpath_variable_set::set">set</a>+++(const char_t* name, double value);
    bool +++<a href="#xpath_variable_set::set">set</a>+++(const char_t* name, const char_t* value);
    bool +++<a href="#xpath_variable_set::set">set</a>+++(const char_t* name, const xpath_node_set& value);
    xpath_variable* +++<a href="#xpath_variable_set::get">get</a>+++(const char_t* name);
    const xpath_variable* +++<a href="#xpath_variable_set::get">get</a>+++(const char_t* name) const;
[[apiref.functions]]
=== Functions
[source,subs="+macros"]
----
std::string +++<a href="#as_utf8">as_utf8</a>+++(const wchar_t* str);
std::string +++<a href="#as_utf8">as_utf8</a>+++(const std::wstring& str);
std::wstring +++<a href="#as_wide">as_wide</a>+++(const char* str);
std::wstring +++<a href="#as_wide">as_wide</a>+++(const std::string& str);
void +++<a href="#set_memory_management_functions">set_memory_management_functions</a>+++(allocation_function allocate, deallocation_function deallocate);
allocation_function +++<a href="#get_memory_allocation_function">get_memory_allocation_function</a>+++();
deallocation_function +++<a href="#get_memory_deallocation_function">get_memory_deallocation_function</a>+++();