summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-11-24 00:29:41 -0800
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2016-11-24 00:29:41 -0800
commit27837382e128b9b2b8ead3c4a8326c8604295091 (patch)
treef4f9d049b9751cdd75712b0ff9495071205d565d
parent1bf64a081bd999e0b5b6d40997efe1ed9224d08b (diff)
docs: Update to 1.8
-rw-r--r--docs/manual.adoc201
-rw-r--r--docs/manual.html418
-rw-r--r--docs/quickstart.adoc14
-rw-r--r--docs/quickstart.html113
-rw-r--r--docs/samples/include.cpp2
-rw-r--r--docs/samples/save_declaration.cpp2
6 files changed, 452 insertions, 298 deletions
diff --git a/docs/manual.adoc b/docs/manual.adoc
index 82c6b6a..61dcfcb 100644
--- a/docs/manual.adoc
+++ b/docs/manual.adoc
@@ -46,7 +46,7 @@ Thanks to *Vyacheslav Egorov* for documentation proofreading and fuzz testing.
The pugixml library is distributed under the MIT license:
....
-Copyright (c) 2006-2015 Arseny Kapoulkine
+Copyright (c) 2006-2016 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -71,10 +71,10 @@ OTHER DEALINGS IN THE SOFTWARE.
....
This means that you can freely use pugixml in your applications, both open-source and proprietary. If you use pugixml in a product, it is sufficient to add an acknowledgment like this to the product distribution:
-
+
....
This software is based on pugixml library (http://pugixml.org).
-pugixml is Copyright (C) 2006-2015 Arseny Kapoulkine.
+pugixml is Copyright (C) 2006-2016 Arseny Kapoulkine.
....
[[install]]
@@ -142,9 +142,9 @@ Here's an incomplete list of pugixml packages in various systems:
=== Building pugixml
pugixml is distributed in source form without any pre-built binaries; you have to build them yourself.
-
+
The complete pugixml source consists of three files - one source file, `pugixml.cpp`, and two header files, `pugixml.hpp` and `pugiconfig.hpp`. `pugixml.hpp` is the primary header which you need to include in order to use pugixml classes/functions; `pugiconfig.hpp` is a supplementary configuration file (see <<install.building.config>>). The rest of this guide assumes that `pugixml.hpp` is either in the current directory or in one of include directories of your projects, so that `#include "pugixml.hpp"` can find the header; however you can also use relative path (i.e. `#include "../libs/pugixml/src/pugixml.hpp"`) or include directory-relative path (i.e. `#include <xml/thirdparty/pugixml/src/pugixml.hpp>`).
-
+
[[install.building.embed]]
==== Building pugixml as a part of another static library/executable
@@ -165,11 +165,11 @@ The correct way to resolve this is to disable precompiled headers for `pugixml.c
| image::vs2005_pch3.png[link="images/vs2005_pch3.png"]
| image::vs2005_pch4.png[link="images/vs2005_pch4.png"]
|===
-
+
[[install.building.static]]
==== Building pugixml as a standalone static library
-
-It's possible to compile pugixml as a standalone static library. This process depends on the method of building your application; pugixml distribution comes with project files for several popular IDEs/build systems. There are project files for Apple XCode, Code::Blocks, Codelite, Microsoft Visual Studio 2005, 2008, 2010+, and configuration scripts for CMake and premake4. You're welcome to submit project files/build scripts for other software; see <<overview.feedback>>.
+
+It's possible to compile pugixml as a standalone static library. This process depends on the method of building your application; pugixml distribution comes with project files for several popular IDEs/build systems. There are project files for Apple XCode, Code::Blocks, Codelite, Microsoft Visual Studio 2005, 2008, 2010+, and configuration scripts for CMake and premake4. You're welcome to submit project files/build scripts for other software; see <<overview.feedback>>.
There are two projects for each version of Microsoft Visual Studio: one for dynamically linked CRT, which has a name like `pugixml_vs2008.vcproj`, and another one for statically linked CRT, which has a name like `pugixml_vs2008_static.vcproj`. You should select the version that matches the CRT used in your application; the default option for new projects created by Microsoft Visual Studio is dynamically linked CRT, so unless you changed the defaults, you should use the version with dynamic CRT (i.e. `pugixml_vs2008.vcproj` for Microsoft Visual Studio 2008).
@@ -187,7 +187,7 @@ In addition to adding pugixml project to your workspace, you'll have to make sur
[[install.building.shared]]
==== Building pugixml as a standalone shared library
-
+
It's possible to compile pugixml as a standalone shared library. The process is usually similar to the static library approach; however, no preconfigured projects/scripts are included into pugixml distribution, so you'll have to do it yourself. Generally, if you're using GCC-based toolchain, the process does not differ from building any other library as DLL (adding -shared to compilation flags should suffice); if you're using MSVC-based toolchain, you'll have to explicitly mark exported symbols with a declspec attribute. You can do it by defining <<PUGIXML_API,PUGIXML_API>> macro, i.e. via `pugiconfig.hpp`:
[source]
@@ -243,13 +243,13 @@ NOTE: In that example `PUGIXML_API` is inconsistent between several source files
[[PUGIXML_MEMORY_PAGE_SIZE]]`PUGIXML_MEMORY_PAGE_SIZE`, [[PUGIXML_MEMORY_OUTPUT_STACK]]`PUGIXML_MEMORY_OUTPUT_STACK` and [[PUGIXML_MEMORY_XPATH_PAGE_SIZE]]`PUGIXML_MEMORY_XPATH_PAGE_SIZE` can be used to customize certain important sizes to optimize memory usage for the application-specific patterns. For details see <<dom.memory.tuning>>.
[[PUGIXML_HAS_LONG_LONG]]`PUGIXML_HAS_LONG_LONG` define enables support for `long long` type in pugixml. This define is automatically enabled if your platform is known to have `long long` support (i.e. has C{plus}{plus}11 support or uses a reasonably modern version of a known compiler); if pugixml does not recognize that your platform supports `long long` but in fact it does, you can enable the define manually.
-
+
[[install.portability]]
=== Portability
pugixml is written in standard-compliant C{plus}{plus} with some compiler-specific workarounds where appropriate. pugixml is compatible with the C{plus}{plus}11 standard, but does not require C{plus}{plus}11 support. Each version is tested with a unit test suite with code coverage exceeding 99%.
-pugixml runs on a variety of desktop platforms (including Microsoft Windows, Linux, FreeBSD, Apple MacOSX and Sun Solaris), game consoles (inclusing Microsoft Xbox 360, Microsoft Xbox One, Nintendo Wii, Sony Playstation Portable and Sony Playstation 3) and mobile platforms (including Android, BlackBerry, Samsung bada and Microsoft Windows CE).
+pugixml runs on a variety of desktop platforms (including Microsoft Windows, Linux, FreeBSD, Apple MacOSX and Sun Solaris), game consoles (inclusing Microsoft Xbox 360, Microsoft Xbox One, Nintendo Wii, Sony Playstation Portable and Sony Playstation 3) and mobile platforms (including Android, iOS, BlackBerry, Samsung bada and Microsoft Windows CE).
pugixml supports various architectures, such as x86/x86-64, PowerPC, ARM, MIPS and SPARC. In general it should run on any architecture since it does not use architecture-specific code and does not rely on features such as unaligned memory access.
@@ -291,7 +291,7 @@ Here `"node"` element has three children, two of which are PCDATA nodes with val
* Character data nodes ([[node_cdata]]`node_cdata`) represent text in XML that is quoted in a special way. CDATA nodes do not differ from PCDATA nodes except in XML representation - the above text example looks like this with CDATA:
+
----
-<node> <![CDATA[[text1]]> <child/> <![CDATA[[text2]]> </node>
+<node> <![CDATA[text1]]> <child/> <![CDATA[text2]]> </node>
----
+
CDATA nodes make it easy to include non-escaped `<`, `&` and `>` characters in plain text. CDATA value can not contain the character sequence `]]>`, since it is used to determine the end of node contents.
@@ -451,7 +451,7 @@ you'll have to use
`xml_node node = doc.child(L"bookstore").find_child_by_attribute(L"book", L"id", L"12345");`
====
-
+
[[dom.thread]]
=== Thread-safety guarantees
@@ -509,11 +509,11 @@ This is a simple example of custom memory management (link:samples/custom_memory
[source,indent=0]
----
-include::samples/custom_memory_management.cpp[tags=decl]
+include::samples/custom_memory_management.cpp[tags=decl]
----
[source,indent=0]
----
-include::samples/custom_memory_management.cpp[tags=call]
+include::samples/custom_memory_management.cpp[tags=call]
----
When setting new memory management functions, care must be taken to make sure that there are no live pugixml objects. Otherwise when the objects are destroyed, the new deallocation function will be called with the memory obtained by the old allocation function, resulting in undefined behavior.
@@ -569,7 +569,7 @@ The most common source of XML data is files; pugixml provides dedicated function
xml_parse_result xml_document::load_file(const char* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
xml_parse_result xml_document::load_file(const wchar_t* path, unsigned int options = parse_default, xml_encoding encoding = encoding_auto);
----
-
+
These functions accept the file path as its first argument, and also two optional arguments, which specify parsing options (see <<loading.options>>) and input data encoding (see <<loading.encoding>>). The path has the target operating system format, so it can be a relative or absolute one, it should have the delimiters of the target system, it should have the exact case if the target file system is case-sensitive, etc.
File path is passed to the system file opening function as is in case of the first function (which accepts `const char* path`); the second function either uses a special file opening function if it is provided by the runtime library or converts the path to UTF-8 and uses the system file opening function.
@@ -580,7 +580,7 @@ This is an example of loading XML document from file (link:samples/load_file.cpp
[source,indent=0]
----
-include::samples/load_file.cpp[tags=code]
+include::samples/load_file.cpp[tags=code]
----
[[loading.memory]]
@@ -616,25 +616,25 @@ This is an example of loading XML document from memory using different functions
[source,indent=0]
----
-include::samples/load_memory.cpp[tags=decl]
+include::samples/load_memory.cpp[tags=decl]
----
[source,indent=0]
----
-include::samples/load_memory.cpp[tags=load_buffer]
+include::samples/load_memory.cpp[tags=load_buffer]
----
[source,indent=0]
----
-include::samples/load_memory.cpp[tags=load_buffer_inplace_begin]
+include::samples/load_memory.cpp[tags=load_buffer_inplace_begin]
-include::samples/load_memory.cpp[tags=load_buffer_inplace_end]
+include::samples/load_memory.cpp[tags=load_buffer_inplace_end]
----
[source,indent=0]
----
-include::samples/load_memory.cpp[tags=load_buffer_inplace_own]
+include::samples/load_memory.cpp[tags=load_buffer_inplace_own]
----
[source,indent=0]
----
-include::samples/load_memory.cpp[tags=load_string]
+include::samples/load_memory.cpp[tags=load_string]
----
[[loading.stream]]
@@ -657,7 +657,7 @@ This is a simple example of loading XML document from file using streams (link:s
[source,indent=0]
----
-include::samples/load_stream.cpp[tags=code]
+include::samples/load_stream.cpp[tags=code]
----
[[loading.errors]]
@@ -718,7 +718,7 @@ This is an example of handling loading errors (link:samples/load_error_handling.
[source,indent=0]
----
-include::samples/load_error_handling.cpp[tags=code]
+include::samples/load_error_handling.cpp[tags=code]
----
[[loading.options]]
@@ -746,6 +746,9 @@ These flags control the resulting tree contents:
* [[parse_ws_pcdata_single]]`parse_ws_pcdata_single` determines if whitespace-only PCDATA nodes that have no sibling nodes are to be put in DOM tree. In some cases application needs to parse the whitespace-only contents of nodes, i.e. `<node> </node>`, but is not interested in whitespace markup elsewhere. It is possible to use <<parse_ws_pcdata,parse_ws_pcdata>> flag in this case, but it results in excessive allocations and complicates document processing; this flag can be used to avoid that. As an example, after parsing XML string `<node> <a> </a> </node>` with `parse_ws_pcdata_single` flag set, `<node>` element will have one child `<a>`, and `<a>` element will have one child with type <<node_pcdata,node_pcdata>> and value `" "`. This flag has no effect if <<parse_ws_pcdata,parse_ws_pcdata>> is enabled. This flag is *off* by default.
+* [[parse_embed_pcdata]]`parse_embed_pcdata` determines if PCDATA contents is to be saved as element values. Normally element nodes have names but not values; this flag forces the parser to store the contents as a value if PCDATA is the first child of the element node (otherwise PCDATA node is created as usual). This can significantly reduce the memory required for documents with many PCDATA nodes. To retrieve the data you can use `xml_node::value()` on the element nodes or any of the higher-level functions like `child_value` or `text`. This flag is *off* by default.
+Since this flag significantly changes the DOM structure it is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. This flag is *off* by default.
+
* [[parse_fragment]]`parse_fragment` determines if document should be treated as a fragment of a valid XML. Parsing document as a fragment leads to top-level PCDATA content (i.e. text that is not located inside a node) to be added to a tree, and additionally treats documents without element nodes as valid. This flag is *off* by default.
CAUTION: Using in-place parsing (<<xml_document::load_buffer_inplace,load_buffer_inplace>>) with `parse_fragment` flag may result in the loss of the last character of the buffer if it is a part of PCDATA. Since PCDATA values are null-terminated strings, the only way to resolve this is to provide a null-terminated buffer as an input to `load_buffer_inplace` - i.e. `doc.load_buffer_inplace("test\0", 5, pugi::parse_default | pugi::parse_fragment)`.
@@ -774,7 +777,7 @@ This is an example of using different parsing options (link:samples/load_options
[source,indent=0]
----
-include::samples/load_options.cpp[tags=code]
+include::samples/load_options.cpp[tags=code]
----
[[loading.encoding]]
@@ -835,7 +838,7 @@ pugixml features an extensive interface for getting various types of data from t
[[xml_node::parent]][[xml_node::first_child]][[xml_node::last_child]][[xml_node::next_sibling]][[xml_node::previous_sibling]][[xml_node::first_attribute]][[xml_node::last_attribute]][[xml_attribute::next_attribute]][[xml_attribute::previous_attribute]]
The internal representation of the document is a tree, where each node has a list of child nodes (the order of children corresponds to their order in the XML representation), and additionally element nodes have a list of attributes, which is also ordered. Several functions are provided in order to let you get from one node in the tree to the other. These functions roughly correspond to the internal representation, and thus are usually building blocks for other methods of traversing (i.e. XPath traversals are based on these functions).
-
+
[source]
----
xml_node xml_node::parent() const;
@@ -860,7 +863,7 @@ With these functions, you can iterate through all child nodes and display all at
[source,indent=0]
----
-include::samples/traverse_base.cpp[tags=basic]
+include::samples/traverse_base.cpp[tags=basic]
----
[[access.nodedata]]
@@ -919,7 +922,7 @@ It returns `def` argument if the attribute handle is null. If you do not specify
[[xml_attribute::as_int]][[xml_attribute::as_uint]][[xml_attribute::as_double]][[xml_attribute::as_float]][[xml_attribute::as_bool]][[xml_attribute::as_llong]][[xml_attribute::as_ullong]]
In many cases attribute values have types that are not strings - i.e. an attribute may always contain values that should be treated as integers, despite the fact that they are represented as strings in XML. pugixml provides several accessors that convert attribute value to some other type:
-
+
[source]
----
int xml_attribute::as_int(int def = 0) const;
@@ -931,9 +934,9 @@ long long xml_attribute::as_llong(long long def = 0) const;
unsigned long long xml_attribute::as_ullong(unsigned long long def = 0) const;
----
-`as_int`, `as_uint`, `as_llong`, `as_ullong`, `as_double` and `as_float` convert attribute values to numbers. If attribute handle is null or attribute value is empty, `def` argument is returned (which is 0 by default). Otherwise, all leading whitespace characters are truncated, and the remaining string is parsed as an integer number in either decimal or hexadecimal form (applicable to `as_int`, `as_uint`, `as_llong` and `as_ullong`; hexadecimal format is used if the number has `0x` or `0X` prefix) or as a floating point number in either decimal or scientific form (`as_double` or `as_float`). Any extra characters are silently discarded, i.e. `as_int` will return `1` for string `"1abc"`.
+`as_int`, `as_uint`, `as_llong`, `as_ullong`, `as_double` and `as_float` convert attribute values to numbers. If attribute handle is null `def` argument is returned (which is 0 by default). Otherwise, all leading whitespace characters are truncated, and the remaining string is parsed as an integer number in either decimal or hexadecimal form (applicable to `as_int`, `as_uint`, `as_llong` and `as_ullong`; hexadecimal format is used if the number has `0x` or `0X` prefix) or as a floating point number in either decimal or scientific form (`as_double` or `as_float`).
-In case the input string contains a number that is out of the target numeric range, the result is undefined.
+In case the input string contains a non-numeric character sequence or a number that is out of the target numeric range, the result is undefined.
CAUTION: Number conversion functions depend on current C locale as set with `setlocale`, so may return unexpected results if the locale is different from `"C"`.
@@ -946,7 +949,7 @@ This is an example of using these functions, along with node data retrieval ones
[source,indent=0]
----
-include::samples/traverse_base.cpp[tags=data]
+include::samples/traverse_base.cpp[tags=data]
----
[[access.contents]]
@@ -989,7 +992,7 @@ This is an example of using these functions (link:samples/traverse_base.cpp[]):
[source,indent=0]
----
-include::samples/traverse_base.cpp[tags=contents]
+include::samples/traverse_base.cpp[tags=contents]
----
[[access.rangefor]]
@@ -1011,7 +1014,7 @@ This is an example of using these functions (link:samples/traverse_rangefor.cpp[
[source,indent=0]
----
-include::samples/traverse_rangefor.cpp[tags=code]
+include::samples/traverse_rangefor.cpp[tags=code]
----
[[access.iterators]]
@@ -1044,7 +1047,7 @@ Here is an example of using iterators for document traversal (link:samples/trave
[source,indent=0]
----
-include::samples/traverse_iter.cpp[tags=code]
+include::samples/traverse_iter.cpp[tags=code]
----
CAUTION: Node and attribute iterators are somewhere in the middle between const and non-const iterators. While dereference operation yields a non-constant reference to the object, so that you can use it for tree modification operations, modifying this reference using assignment - i.e. passing iterators to a function like `std::sort` - will not give expected results, as assignment modifies local handle that's stored in the iterator.
@@ -1086,11 +1089,11 @@ This is an example of traversing tree hierarchy with xml_tree_walker (link:sampl
[source,indent=0]
----
-include::samples/traverse_walker.cpp[tags=impl]
+include::samples/traverse_walker.cpp[tags=impl]
----
[source,indent=0]
----
-include::samples/traverse_walker.cpp[tags=traverse]
+include::samples/traverse_walker.cpp[tags=traverse]
----
[[access.predicate]]
@@ -1118,11 +1121,11 @@ This is an example of using predicate-based functions (link:samples/traverse_pre
[source,indent=0]
----
-include::samples/traverse_predicate.cpp[tags=decl]
+include::samples/traverse_predicate.cpp[tags=decl]
----
[source,indent=0]
----
-include::samples/traverse_predicate.cpp[tags=find]
+include::samples/traverse_predicate.cpp[tags=find]
----
[[access.text]]
@@ -1133,7 +1136,7 @@ It is common to store data as text contents of some node - i.e. `<node><descript
[[xml_node::text]]
You can get the text object from a node by using `text()` method:
-
+
[source]
----
xml_text xml_node::text() const;
@@ -1190,7 +1193,7 @@ This is an example of using `xml_text` object (link:samples/text.cpp[]):
[source,indent=0]
----
-include::samples/text.cpp[tags=access]
+include::samples/text.cpp[tags=access]
----
[[access.misc]]
@@ -1217,7 +1220,7 @@ xml_node xml_node::first_element_by_path(const char_t* path, char_t delimiter =
Node paths consist of node names, separated with a delimiter (which is `/` by default); also paths can contain self (`.`) and parent (`..`) pseudo-names, so that this is a valid path: `"../../foo/./bar"`. `path` returns the path to the node from the document root, `first_element_by_path` looks for a node represented by a given path; a path can be an absolute one (absolute paths start with the delimiter), in which case the rest of the path is treated as document root relative, and relative to the given node. For example, in the following document: `<a><b><c/></b></a>`, node `<c/>` has path `"a/b/c"`; calling `first_element_by_path` for document with path `"a/b"` results in node `<b/>`; calling `first_element_by_path` for node `<a/>` with path `"../a/./b/../."` results in node `<a/>`; calling `first_element_by_path` with path `"/a"` results in node `<a/>` for any node.
-In case path component is ambiguous (if there are two nodes with given name), the first one is selected; paths are not guaranteed to uniquely identify nodes in a document. If any component of a path is not found, the result of `first_element_by_path` is null node; also `first_element_by_path` returns null node for null nodes, in which case the path does not matter. `path` returns an empty string for null nodes.
+In case path component is ambiguous (if there are two nodes with given name), the first one is selected; paths are not guaranteed to uniquely identify nodes in a document. If any component of a path is not found, the result of `first_element_by_path` is null node; also `first_element_by_path` returns null node for null nodes, in which case the path does not matter. `path` returns an empty string for null nodes.
NOTE: `path` function returns the result as STL string, and thus is not available if <<PUGIXML_NO_STL,PUGIXML_NO_STL>> is defined.
@@ -1258,7 +1261,7 @@ This is an example of setting node name and value (link:samples/modify_base.cpp[
[source,indent=0]
----
-include::samples/modify_base.cpp[tags=node]
+include::samples/modify_base.cpp[tags=node]
----
[[modify.attrdata]]
@@ -1281,13 +1284,15 @@ In addition to string functions, several functions are provided for handling att
----
bool xml_attribute::set_value(int rhs);
bool xml_attribute::set_value(unsigned int rhs);
+bool xml_attribute::set_value(long rhs);
+bool xml_attribute::set_value(unsigned long rhs);
bool xml_attribute::set_value(double rhs);
bool xml_attribute::set_value(float rhs);
bool xml_attribute::set_value(bool rhs);
bool xml_attribute::set_value(long long rhs);
bool xml_attribute::set_value(unsigned long long rhs);
----
-
+
The above functions convert the argument to string and then call the base `set_value` function. Integers are converted to a decimal form, floating-point numbers are converted to either decimal or scientific form, depending on the number magnitude, boolean values are converted to either `"true"` or `"false"`.
CAUTION: Number conversion functions depend on current C locale as set with `setlocale`, so may generate unexpected results if the locale is different from `"C"`.
@@ -1303,6 +1308,8 @@ For convenience, all `set_value` functions have the corresponding assignment ope
xml_attribute& xml_attribute::operator=(const char_t* rhs);
xml_attribute& xml_attribute::operator=(int rhs);
xml_attribute& xml_attribute::operator=(unsigned int rhs);
+xml_attribute& xml_attribute::operator=(long rhs);
+xml_attribute& xml_attribute::operator=(unsigned long rhs);
xml_attribute& xml_attribute::operator=(double rhs);
xml_attribute& xml_attribute::operator=(float rhs);
xml_attribute& xml_attribute::operator=(bool rhs);
@@ -1316,7 +1323,7 @@ This is an example of setting attribute name and value (link:samples/modify_base
[source,indent=0]
----
-include::samples/modify_base.cpp[tags=attr]
+include::samples/modify_base.cpp[tags=attr]
----
[[modify.add]]
@@ -1365,7 +1372,7 @@ This is an example of adding new attributes/nodes to the document (link:samples/
[source,indent=0]
----
-include::samples/modify_add.cpp[tags=code]
+include::samples/modify_add.cpp[tags=code]
----
[[modify.remove]]
@@ -1402,7 +1409,7 @@ This is an example of removing attributes/nodes from the document (link:samples/
[source,indent=0]
----
-include::samples/modify_remove.cpp[tags=code]
+include::samples/modify_remove.cpp[tags=code]
----
[[modify.text]]
@@ -1427,13 +1434,15 @@ In addition to a string function, several functions are provided for handling te
----
bool xml_text::set(int rhs);
bool xml_text::set(unsigned int rhs);
+bool xml_text::set(long rhs);
+bool xml_text::set(unsigned long rhs);
bool xml_text::set(double rhs);
bool xml_text::set(float rhs);
bool xml_text::set(bool rhs);
bool xml_text::set(long long rhs);
bool xml_text::set(unsigned long long rhs);
----
-
+
The above functions convert the argument to string and then call the base `set` function. These functions have the same semantics as similar `xml_attribute` functions. You can <<xml_attribute::set_value,refer to documentation for the attribute functions>> for details.
[[xml_text::assign]]
@@ -1445,6 +1454,8 @@ For convenience, all `set` functions have the corresponding assignment operators
xml_text& xml_text::operator=(const char_t* rhs);
xml_text& xml_text::operator=(int rhs);
xml_text& xml_text::operator=(unsigned int rhs);
+xml_text& xml_text::operator=(long rhs);
+xml_text& xml_text::operator=(unsigned long rhs);
xml_text& xml_text::operator=(double rhs);
xml_text& xml_text::operator=(float rhs);
xml_text& xml_text::operator=(bool rhs);
@@ -1458,7 +1469,7 @@ This is an example of using `xml_text` object to modify text contents (link:samp
[source,indent=0]
----
-include::samples/text.cpp[tags=modify]
+include::samples/text.cpp[tags=modify]
----
[[modify.clone]]
@@ -1494,7 +1505,7 @@ This is an example with one possible implementation of include tags in XML (link
[source,indent=0]
----
-include::samples/include.cpp[tags=code]
+include::samples/include.cpp[tags=code]
----
[[modify.move]]
@@ -1597,7 +1608,7 @@ This is a simple example of saving XML document to file (link:samples/save_file.
[source,indent=0]
----
-include::samples/save_file.cpp[tags=code]
+include::samples/save_file.cpp[tags=code]
----
[[saving.stream]]
@@ -1621,7 +1632,7 @@ This is a simple example of saving XML document to standard output (link:samples
[source,indent=0]
----
-include::samples/save_stream.cpp[tags=code]
+include::samples/save_stream.cpp[tags=code]
----
[[saving.writer]]
@@ -1649,7 +1660,7 @@ This is a simple example of custom writer for saving document data to STL string
[source,indent=0]
----
-include::samples/save_custom_writer.cpp[tags=code]
+include::samples/save_custom_writer.cpp[tags=code]
----
[[saving.subtree]]
@@ -1671,7 +1682,7 @@ Saving a subtree differs from saving the whole document: the process behaves as
[source,indent=0]
----
-include::samples/save_subtree.cpp[tags=code]
+include::samples/save_subtree.cpp[tags=code]
----
[[saving.options]]
@@ -1691,6 +1702,8 @@ These flags control the resulting tree contents:
* [[format_no_escapes]]`format_no_escapes` disables output escaping for attribute values and PCDATA contents. If this flag is off, special symbols (`"`, `&`, `<`, `>`) and all non-printable characters (those with codepoint values less than 32) are converted to XML escape sequences (i.e. `&amp;amp;`) during output. If this flag is on, no text processing is performed; therefore, output XML can be malformed if output contents contains invalid symbols (i.e. having a stray `<` in the PCDATA will make the output malformed). This flag is *off* by default.
+* [[format_no_empty_element_tags]]`format_no_empty_element_tags` determines if start/end tags should be output instead of empty element tags for empty elements (that is, elements with no children). This flag is *off* by default.
+
These flags control the additional output information:
* [[format_no_declaration]]`format_no_declaration` disables default node declaration output. By default, if the document is saved via `save` or `save_file` function, and it does not have any document declaration, a default declaration is output before the document contents. Enabling this flag disables this declaration. This flag has no effect in `xml_node::print` functions: they never output the default declaration. This flag is *off* by default.
@@ -1708,7 +1721,7 @@ This is an example that shows the outputs of different output options (link:samp
[source,indent=0]
----
-include::samples/save_options.cpp[tags=code]
+include::samples/save_options.cpp[tags=code]
----
[[saving.encoding]]
@@ -1735,7 +1748,7 @@ This is an example that shows how to create a custom declaration node (link:samp
[source,indent=0]
----
-include::samples/save_declaration.cpp[tags=code]
+include::samples/save_declaration.cpp[tags=code]
----
[[xpath]]
@@ -1869,7 +1882,7 @@ This is an example of selecting nodes using XPath expressions (link:samples/xpat
[source,indent=0]
----
-include::samples/xpath_select.cpp[tags=code]
+include::samples/xpath_select.cpp[tags=code]
----
[[xpath.query]]
@@ -1924,7 +1937,7 @@ Note that `evaluate_string` function returns the STL string; as such, it's not a
size_t xpath_query::evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const;
----
-This function evaluates the string, and then writes the result to `buffer` (but at most `capacity` characters); then it returns the full size of the result in characters, including the terminating zero. If `capacity` is not 0, the resulting buffer is always zero-terminated. You can use this function as follows:
+This function evaluates the string, and then writes the result to `buffer` (but at most `capacity` characters); then it returns the full size of the result in characters, including the terminating zero. If `capacity` is not 0, the resulting buffer is always zero-terminated. You can use this function as follows:
* First call the function with `buffer = 0` and `capacity = 0`; then allocate the returned amount of characters, and call the function again, passing the allocated storage and the amount of characters;
* First call the function with small buffer and buffer capacity; then, if the result is larger than the capacity, the output has been trimmed, so allocate a larger buffer and call the function again.
@@ -1933,7 +1946,7 @@ This is an example of using query objects (link:samples/xpath_query.cpp[]):
[source,indent=0]
----
-include::samples/xpath_query.cpp[tags=code]
+include::samples/xpath_query.cpp[tags=code]
----
[[xpath.variables]]
@@ -2037,7 +2050,7 @@ This is an example of using variables in XPath queries (link:samples/xpath_varia
[source,indent=0]
----
-include::samples/xpath_variables.cpp[tags=code]
+include::samples/xpath_variables.cpp[tags=code]
----
[[xpath.errors]]
@@ -2061,7 +2074,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
----
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]]
@@ -2095,7 +2108,7 @@ This is an example of XPath error handling (link:samples/xpath_error.cpp[]):
[source,indent=0]
----
-include::samples/xpath_error.cpp[tags=code]
+include::samples/xpath_error.cpp[tags=code]
----
[[xpath.w3c]]
@@ -2114,8 +2127,30 @@ Because of the differences in document object models, performance considerations
:!numbered:
+[[v1.8]]
+=== v1.8 ^2016-11-24^
+
+Maintenance release. Changes:
+
+* Specification changes:
+ . When printing empty elements, a space is no longer added before / in format_raw mode
+
+* New features:
+ . Added parse_embed_pcdata parsing mode in which PCDATA value is stored in the element node if possible (significantly reducing memory consumption for some documents)
+ . Added auto-detection support for Latin-1 (ISO-8859-1) encoding during parsing
+ . Added format_no_empty_element_tags formatting flag that outputs start/end tags instead of empty element tags for empty elements
+
+* Performance improvements:
+ . Minor memory allocation improvements (yielding up to 1% memory savings in some cases)
+
+* Compatibility improvements:
+ . Fixed compilation issues for Borland C++ 5.4
+ . Fixed compilation issues for some distributions of MinGW 3.8
+ . Fixed various Clang/GCC warnings
+ . Enabled move semantics support for XPath objects for MSVC 2010 and above
+
[[v1.7]]
-=== v1.7 ^19.10.2015^
+=== v1.7 ^2015-10-19^
Major release, featuring performance and memory improvements along with some new features. Changes:
@@ -2140,7 +2175,7 @@ Major release, featuring performance and memory improvements along with some new
. Fix saving for custom xml_writer implementations that can throw from write()
[[v1.6]]
-=== v1.6 ^10.04.2015^
+=== v1.6 ^2015-04-10^
Maintenance release. Changes:
@@ -2155,7 +2190,7 @@ Maintenance release. Changes:
. Adjusted processing instruction output to avoid malformed documents if the PI value contains `?>`
[[v1.5]]
-=== v1.5 ^27.11.2014^
+=== v1.5 ^2014-11-27^
Major release, featuring a lot of performance improvements and some new features.
@@ -2188,7 +2223,7 @@ Major release, featuring a lot of performance improvements and some new features
. 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^
+=== v1.4 ^2014-02-27^
Major release, featuring various new features, bug fixes and compatibility improvements.
@@ -2217,7 +2252,7 @@ Major release, featuring various new features, bug fixes and compatibility impro
. Fixed `find_child_by_attribute` assertion for attributes with null name/value
[[v1.2]]
-=== v1.2 ^1.05.2012^
+=== v1.2 ^2012-05-01^
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.
@@ -2246,7 +2281,7 @@ Major release, featuring header-only mode, various interface enhancements (i.e.
. `xml_document::save_file` now checks for file I/O errors during saving
[[v1.0]]
-=== v1.0 ^1.11.2010^
+=== v1.0 ^2010-11-01^
Major release, featuring many XPath enhancements, wide character filename support, miscellaneous performance improvements, bug fixes and more.
@@ -2311,7 +2346,7 @@ Major release, featuring many XPath enhancements, wide character filename suppor
. Removed `as_utf16` function; use `as_wide` instead
[[v0.9]]
-=== v0.9 ^1.07.2010^
+=== v0.9 ^2010-07-01^
Major release, featuring extended and improved Unicode support, miscellaneous performance improvements, bug fixes and more.
@@ -2349,7 +2384,7 @@ Major release, featuring extended and improved Unicode support, miscellaneous pe
. `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^
+=== v0.5 ^2009-11-08^
Major bugfix release. Changes:
@@ -2385,7 +2420,7 @@ Major bugfix release. Changes:
. Added getter accessors for memory-management functions
[[v0.42]]
-=== v0.42 ^17.09.2009^
+=== v0.42 ^2009-09-17^
Maintenance release. Changes:
@@ -2401,7 +2436,7 @@ Maintenance release. Changes:
. Added `xml_attribute::set_value` overloads for different types
[[v0.41]]
-=== v0.41 ^8.02.2009^
+=== v0.41 ^2009-02-08^
Maintenance release. Changes:
@@ -2409,7 +2444,7 @@ Maintenance release. Changes:
. Fixed bug with node printing (occasionally some content was not written to output stream)
[[v0.4]]
-=== v0.4 ^18.01.2009^
+=== v0.4 ^2009-01-18^
Changes:
@@ -2432,7 +2467,7 @@ Changes:
. 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^
+=== v0.34 ^2007-10-31^
Maintenance release. Changes:
@@ -2447,7 +2482,7 @@ Maintenance release. Changes:
. `PUGIXML_NO_EXCEPTION` flag for platforms without exception handling
[[v0.3]]
-=== v0.3 ^21.02.2007^
+=== v0.3 ^2007-02-21^
Refactored, reworked and improved version. Changes:
@@ -2470,7 +2505,7 @@ Refactored, reworked and improved version. Changes:
. Fixed several bugs
[[v0.2]]
-=== v0.2 ^6.11.2006^
+=== v0.2 ^2006-11-06^
First public release. Changes:
@@ -2484,7 +2519,7 @@ First public release. Changes:
. Optimizations of `strconv_t`
[[v0.1]]
-=== v0.1 ^15.07.2006^
+=== v0.1 ^2006-07-15^
First private release for testing purposes
@@ -2591,6 +2626,7 @@ 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_empty_element_tags">format_no_empty_element_tags</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>+++
@@ -2611,10 +2647,11 @@ 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_embed_pcdata">parse_embed_pcdata</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
@@ -2654,6 +2691,8 @@ const unsigned int +++<a href="#parse_wnorm_attribute">parse_wnorm_attribute</a>
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>+++(long rhs);
+ bool +++<a href="#xml_attribute::set_value">set_value</a>+++(unsigned long 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);
@@ -2663,6 +2702,8 @@ const unsigned int +++<a href="#parse_wnorm_attribute">parse_wnorm_attribute</a>
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>+++(long rhs);
+ xml_attribute& +++<a href="#xml_attribute::assign">operator=</a>+++(unsigned long 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);
@@ -2847,6 +2888,8 @@ const unsigned int +++<a href="#parse_wnorm_attribute">parse_wnorm_attribute</a>
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>+++(long rhs);
+ bool +++<a href="#xml_text::set">set</a>+++(unsigned long 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);
@@ -2856,6 +2899,8 @@ const unsigned int +++<a href="#parse_wnorm_attribute">parse_wnorm_attribute</a>
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>+++(long rhs);
+ xml_text& +++<a href="#xml_text::assign">operator=</a>+++(unsigned long 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);
diff --git a/docs/manual.html b/docs/manual.html
index 3034e79..daf5ac7 100644
--- a/docs/manual.html
+++ b/docs/manual.html
@@ -4,21 +4,20 @@
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<meta name="generator" content="Asciidoctor 1.5.2">
+<meta name="generator" content="Asciidoctor 1.5.5">
<meta name="author" content="website, repository">
-<title>pugixml 1.7 manual</title>
-<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400">
+<title>pugixml 1.8 manual</title>
+<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
-/* Remove the comments around the @import statement below when using this as a custom stylesheet */
-/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400";*/
+/* Remove comment around @import statement below when using as a custom stylesheet */
+/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
audio,canvas,video{display:inline-block}
audio:not([controls]){display:none;height:0}
[hidden],template{display:none}
script{display:none!important}
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
-body{margin:0}
a{background:transparent}
a:focus{outline:thin dotted}
a:active,a:hover{outline:0}
@@ -53,12 +52,11 @@ textarea{overflow:auto;vertical-align:top}
table{border-collapse:collapse;border-spacing:0}
*,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
html,body{font-size:100%}
-body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto}
+body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto;tab-size:4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
a:hover{cursor:pointer}
img,object,embed{max-width:100%;height:auto}
object,embed{height:100%}
img{-ms-interpolation-mode:bicubic}
-#map_canvas img,#map_canvas embed,#map_canvas object,.map_canvas img,.map_canvas embed,.map_canvas object{max-width:none!important}
.left{float:left!important}
.right{float:right!important}
.text-left{text-align:left!important}
@@ -66,10 +64,11 @@ img{-ms-interpolation-mode:bicubic}
.text-center{text-align:center!important}
.text-justify{text-align:justify!important}
.hide{display:none}
-.antialiased,body{-webkit-font-smoothing:antialiased}
-img{display:inline-block;vertical-align:middle}
+img,object,svg{display:inline-block;vertical-align:middle}
textarea{height:auto;min-height:50px}
select{width:100%}
+.center{margin-left:auto;margin-right:auto}
+.spread{width:100%}
p.lead,.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{font-size:1.21875em;line-height:1.6}
.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
@@ -112,7 +111,8 @@ blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
h1{font-size:2.75em}
h2{font-size:2.3125em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
-h4{font-size:1.4375em}}table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
+h4{font-size:1.4375em}}
+table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
table thead,table tfoot{background:#f7f8f7;font-weight:bold}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
@@ -122,10 +122,14 @@ h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-s
h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
.clearfix:before,.clearfix:after,.float-group:before,.float-group:after{content:" ";display:table}
.clearfix:after,.float-group:after{clear:both}
-*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
+*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed;word-wrap:break-word}
+*:not(pre)>code.nobreak{word-wrap:normal}
+*:not(pre)>code.nowrap{white-space:nowrap}
pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed}
+em em{font-style:normal}
+strong strong{font-weight:400}
.keyseq{color:rgba(51,51,51,.8)}
-kbd{display:inline-block;color:rgba(0,0,0,.8);font-size:.75em;line-height:1.4;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:-.15em .15em 0 .15em;padding:.2em .6em .2em .5em;vertical-align:middle;white-space:nowrap}
+kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
.keyseq kbd:first-child{margin-left:0}
.keyseq kbd:last-child{margin-right:0}
.menuseq,.menu{color:rgba(0,0,0,.8)}
@@ -156,29 +160,33 @@ p a>code:hover{color:rgba(0,0,0,.9)}
#toc ul.sectlevel0>li>a{font-style:italic}
#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
+#toc li{line-height:1.3334;margin-top:.3334em}
#toc a{text-decoration:none}
#toc a:active{text-decoration:underline}
#toctitle{color:#7a2518;font-size:1.2em}
@media only screen and (min-width:768px){#toctitle{font-size:1.375em}
body.toc2{padding-left:15em;padding-right:0}
#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
-#toc.toc2 #toctitle{margin-top:0;font-size:1.2em}
+#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
#toc.toc2>ul{font-size:.9em;margin-bottom:0}
#toc.toc2 ul ul{margin-left:0;padding-left:1em}
#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
body.toc2.toc-right{padding-left:0;padding-right:15em}
-body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
+body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}
+@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
#toc.toc2{width:20em}
#toc.toc2 #toctitle{font-size:1.375em}
#toc.toc2>ul{font-size:.95em}
#toc.toc2 ul ul{padding-left:1.25em}
-body.toc2.toc-right{padding-left:0;padding-right:20em}}#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
+body.toc2.toc-right{padding-left:0;padding-right:20em}}
+#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
#content #toc>:first-child{margin-top:0}
#content #toc>:last-child{margin-bottom:0}
#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}
#footer-text{color:rgba(255,255,255,.8);line-height:1.44}
.sect1{padding-bottom:.625em}
-@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}.sect1+.sect1{border-top:1px solid #efefed}
+@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}
+.sect1+.sect1{border-top:1px solid #efefed}
#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
#content h1>a.anchor:before,h2>a.anchor:before,h3>a.anchor:before,#toctitle>a.anchor:before,.sidebarblock>.content>.title>a.anchor:before,h4>a.anchor:before,h5>a.anchor:before,h6>a.anchor:before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
@@ -207,7 +215,9 @@ table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inh
.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}
.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em}
.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal}
-@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
+@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}
+@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}
+.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
.listingblock pre.highlightjs{padding:0}
.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
.listingblock pre.prettyprint{border-width:0}
@@ -217,7 +227,7 @@ table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inh
.listingblock.terminal pre .command:before{content:attr(data-prompt);padding-right:.5em;color:#999}
.listingblock.terminal pre .command:not([data-prompt]):before{content:"$"}
table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none}
-table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0}
+table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45}
table.pyhltable td.code{padding-left:.75em;padding-right:0}
pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #ddddd8}
pre.pygments .lineno{display:inline-block;margin-right:.25em}
@@ -238,13 +248,12 @@ table.pyhltable .linenodiv{background:none!important;padding-right:0!important}
.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
.quoteblock .attribution br,.verseblock .attribution br{display:none}
-.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.05em;color:rgba(0,0,0,.6)}
+.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
.quoteblock.abstract{margin:0 0 1.25em 0;display:block}
.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{text-align:left;word-spacing:0}
.quoteblock.abstract blockquote:before,.quoteblock.abstract blockquote p:first-of-type:before{display:none}
table.tableblock{max-width:100%;border-collapse:separate}
table.tableblock td>.paragraph:last-child p>p:last-child,table.tableblock th>p:last-child,table.tableblock td>p:last-child{margin-bottom:0}
-table.spread{width:100%}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all th.tableblock,table.grid-all td.tableblock{border-width:0 1px 1px 0}
table.grid-all tfoot>tr>th.tableblock,table.grid-all tfoot>tr>td.tableblock{border-width:1px 1px 0 0}
@@ -290,8 +299,8 @@ ol.upperroman{list-style-type:upper-roman}
ol.lowergreek{list-style-type:lower-greek}
.hdlist>table,.colist>table{border:0;background:none}
.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
-td.hdlist1{padding-right:.75em;font-weight:bold}
-td.hdlist1,td.hdlist2{vertical-align:top}
+td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
+td.hdlist1{font-weight:bold;padding-bottom:1.25em}
.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
.colist>table tr>td:first-of-type{padding:0 .75em;line-height:1}
.colist>table tr>td:last-of-type{padding:.25em 0}
@@ -304,13 +313,14 @@ td.hdlist1,td.hdlist2{vertical-align:top}
.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
.image.left{margin-right:.625em}
.image.right{margin-left:.625em}
-a.image{text-decoration:none}
-span.footnote,span.footnoteref{vertical-align:super;font-size:.875em}
-span.footnote a,span.footnoteref a{text-decoration:none}
-span.footnote a:active,span.footnoteref a:active{text-decoration:underline}
+a.image{text-decoration:none;display:inline-block}
+a.image object{pointer-events:none}
+sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
+sup.footnote a,sup.footnoteref a{text-decoration:none}
+sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em 0;border-width:1px 0 0 0}
-#footnotes .footnote{padding:0 .375em;line-height:1.3;font-size:.875em;margin-left:1.2em;text-indent:-1.2em;margin-bottom:.2em}
+#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;text-indent:-1.05em;margin-bottom:.2em}
#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none}
#footnotes .footnote:last-of-type{margin-bottom:0}
#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
@@ -368,11 +378,10 @@ span.icon>.fa{cursor:default}
pre .conum[data-value]{position:relative;top:-.125em}
b.conum *{color:inherit!important}
.conum:not([data-value]):empty{display:none}
-h1,h2{letter-spacing:-.01em}
-dt,th.tableblock,td.content{text-rendering:optimizeLegibility}
-p,td.content{letter-spacing:-.01em}
-p strong,td.content strong{letter-spacing:-.005em}
-p,blockquote,dt,td.content{font-size:1.0625rem}
+dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
+h1,h2,p,td.content,span.alt{letter-spacing:-.01em}
+p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
+p,blockquote,dt,td.content,span.alt{font-size:1.0625rem}
p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
@@ -383,9 +392,9 @@ a{color:inherit!important;text-decoration:underline!important}
a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
a[href^="http:"]:not(.bare):after,a[href^="https:"]:not(.bare):after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
abbr[title]:after{content:" (" attr(title) ")"}
-pre,blockquote,tr,img{page-break-inside:avoid}
+pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
thead{display:table-header-group}
-img{max-width:100%!important}
+svg{max-width:100%}
p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
#toc,.sidebarblock,.exampleblock>.content{background:none!important}
@@ -411,7 +420,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</style>
<style>
.listingblock .pygments .hll { background-color: #ffffcc }
-.listingblock .pygments { background: #f8f8f8; }
+.listingblock .pygments, .listingblock .pygments code { background: #f8f8f8; }
.listingblock .pygments .tok-c { color: #408080; font-style: italic } /* Comment */
.listingblock .pygments .tok-err { border: 1px solid #FF0000 } /* Error */
.listingblock .pygments .tok-k { color: #008000; font-weight: bold } /* Keyword */
@@ -477,7 +486,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</head>
<body class="article toc2 toc-right">
<div id="header">
-<h1>pugixml 1.7 manual</h1>
+<h1>pugixml 1.8 manual</h1>
<div class="details">
<span id="author" class="author">website</span><br>
<span id="email" class="email"><a href="http://pugixml.org" class="bare">http://pugixml.org</a></span><br>
@@ -572,21 +581,22 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</li>
<li><a href="#changes">9. Changelog</a>
<ul class="sectlevel2">
-<li><a href="#v1.7">v1.7 <sup>19.10.2015</sup></a></li>
-<li><a href="#v1.6">v1.6 <sup>10.04.2015</sup></a></li>
-<li><a href="#v1.5">v1.5 <sup>27.11.2014</sup></a></li>
-<li><a href="#v1.4">v1.4 <sup>27.02.2014</sup></a></li>
-<li><a href="#v1.2">v1.2 <sup>1.05.2012</sup></a></li>
-<li><a href="#v1.0">v1.0 <sup>1.11.2010</sup></a></li>
-<li><a href="#v0.9">v0.9 <sup>1.07.2010</sup></a></li>
-<li><a href="#v0.5">v0.5 <sup>8.11.2009</sup></a></li>
-<li><a href="#v0.42">v0.42 <sup>17.09.2009</sup></a></li>
-<li><a href="#v0.41">v0.41 <sup>8.02.2009</sup></a></li>
-<li><a href="#v0.4">v0.4 <sup>18.01.2009</sup></a></li>
-<li><a href="#v0.34">v0.34 <sup>31.10.2007</sup></a></li>
-<li><a href="#v0.3">v0.3 <sup>21.02.2007</sup></a></li>
-<li><a href="#v0.2">v0.2 <sup>6.11.2006</sup></a></li>
-<li><a href="#v0.1">v0.1 <sup>15.07.2006</sup></a></li>
+<li><a href="#v1.8">v1.8 <sup>2016-11-24</sup></a></li>
+<li><a href="#v1.7">v1.7 <sup>2015-10-19</sup></a></li>
+<li><a href="#v1.6">v1.6 <sup>2015-04-10</sup></a></li>
+<li><a href="#v1.5">v1.5 <sup>2014-11-27</sup></a></li>
+<li><a href="#v1.4">v1.4 <sup>2014-02-27</sup></a></li>
+<li><a href="#v1.2">v1.2 <sup>2012-05-01</sup></a></li>
+<li><a href="#v1.0">v1.0 <sup>2010-11-01</sup></a></li>
+<li><a href="#v0.9">v0.9 <sup>2010-07-01</sup></a></li>
+<li><a href="#v0.5">v0.5 <sup>2009-11-08</sup></a></li>
+<li><a href="#v0.42">v0.42 <sup>2009-09-17</sup></a></li>
+<li><a href="#v0.41">v0.41 <sup>2009-02-08</sup></a></li>
+<li><a href="#v0.4">v0.4 <sup>2009-01-18</sup></a></li>
+<li><a href="#v0.34">v0.34 <sup>2007-10-31</sup></a></li>
+<li><a href="#v0.3">v0.3 <sup>2007-02-21</sup></a></li>
+<li><a href="#v0.2">v0.2 <sup>2006-11-06</sup></a></li>
+<li><a href="#v0.1">v0.1 <sup>2006-07-15</sup></a></li>
</ul>
</li>
<li><a href="#apiref">10. API Reference</a>
@@ -604,10 +614,10 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div id="content">
<div class="sect1">
-<h2 id="overview"><a class="anchor" href="#overview"></a>1. Overview</h2>
+<h2 id="overview"><a class="anchor" href="#overview"></a><a class="link" href="#overview">1. Overview</a></h2>
<div class="sectionbody">
<div class="sect2">
-<h3 id="overview.introduction"><a class="anchor" href="#overview.introduction"></a>1.1. Introduction</h3>
+<h3 id="overview.introduction"><a class="anchor" href="#overview.introduction"></a><a class="link" href="#overview.introduction">1.1. Introduction</a></h3>
<div class="paragraph">
<p><a href="http://pugixml.org/">pugixml</a> is a light-weight C&#43;&#43; XML processing library. It consists of a DOM-like interface with rich traversal/modification capabilities, an extremely fast XML parser which constructs the DOM tree from an XML file/buffer, and an <a href="#xpath">XPath 1.0 implementation</a> for complex data-driven tree queries. Full Unicode support is also available, with <a href="#dom.unicode">two Unicode interface variants</a> and conversions between different Unicode encodings (which happen automatically during parsing/saving). The library is <a href="#install.portability">extremely portable</a> and easy to integrate and use. pugixml is developed and maintained since 2006 and has many users. All code is distributed under the <a href="#overview.license">MIT license</a>, making it completely free to use in both open-source and proprietary applications.</p>
</div>
@@ -631,7 +641,7 @@ No documentation is perfect; neither is this one. If you find errors or omission
</div>
</div>
<div class="sect2">
-<h3 id="overview.feedback"><a class="anchor" href="#overview.feedback"></a>1.2. Feedback</h3>
+<h3 id="overview.feedback"><a class="anchor" href="#overview.feedback"></a><a class="link" href="#overview.feedback">1.2. Feedback</a></h3>
<div class="paragraph">
<p>If you believe you&#8217;ve found a bug in pugixml (bugs include compilation problems (errors/warnings), crashes, performance degradation and incorrect behavior), please file an issue via <a href="https://github.com/zeux/pugixml/issues/new">issue submission form</a>. Be sure to include the relevant information so that the bug can be reproduced: the version of pugixml, compiler version and target architecture, the code that uses pugixml and exhibits the bug, etc.</p>
</div>
@@ -646,7 +656,7 @@ No documentation is perfect; neither is this one. If you find errors or omission
</div>
</div>
<div class="sect2">
-<h3 id="overview.thanks"><a class="anchor" href="#overview.thanks"></a>1.3. Acknowledgments</h3>
+<h3 id="overview.thanks"><a class="anchor" href="#overview.thanks"></a><a class="link" href="#overview.thanks">1.3. Acknowledgments</a></h3>
<div class="paragraph">
<p>pugixml could not be developed without the help from many people; some of them are listed in this section. If you&#8217;ve played a part in pugixml development and you can not find yourself on this list, I&#8217;m truly sorry; please <a href="#email">send me an e-mail</a> so I can fix this.</p>
</div>
@@ -664,13 +674,13 @@ No documentation is perfect; neither is this one. If you find errors or omission
</div>
</div>
<div class="sect2">
-<h3 id="overview.license"><a class="anchor" href="#overview.license"></a>1.4. License</h3>
+<h3 id="overview.license"><a class="anchor" href="#overview.license"></a><a class="link" href="#overview.license">1.4. License</a></h3>
<div class="paragraph">
<p>The pugixml library is distributed under the MIT license:</p>
</div>
<div class="literalblock">
<div class="content">
-<pre>Copyright (c) 2006-2015 Arseny Kapoulkine
+<pre>Copyright (c) 2006-2016 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -700,29 +710,29 @@ OTHER DEALINGS IN THE SOFTWARE.</pre>
<div class="literalblock">
<div class="content">
<pre>This software is based on pugixml library (http://pugixml.org).
-pugixml is Copyright (C) 2006-2015 Arseny Kapoulkine.</pre>
+pugixml is Copyright (C) 2006-2016 Arseny Kapoulkine.</pre>
</div>
</div>
</div>
</div>
</div>
<div class="sect1">
-<h2 id="install"><a class="anchor" href="#install"></a>2. Installation</h2>
+<h2 id="install"><a class="anchor" href="#install"></a><a class="link" href="#install">2. Installation</a></h2>
<div class="sectionbody">
<div class="sect2">
-<h3 id="install.getting"><a class="anchor" href="#install.getting"></a>2.1. Getting pugixml</h3>
+<h3 id="install.getting"><a class="anchor" href="#install.getting"></a><a class="link" href="#install.getting">2.1. Getting pugixml</a></h3>
<div class="paragraph">
<p>pugixml is distributed in source form. You can either download a source distribution or clone the Git repository.</p>
</div>
<div class="sect3">
-<h4 id="install.getting.source"><a class="anchor" href="#install.getting.source"></a>2.1.1. Source distributions</h4>
+<h4 id="install.getting.source"><a class="anchor" href="#install.getting.source"></a><a class="link" href="#install.getting.source">2.1.1. Source distributions</a></h4>
<div class="paragraph">
<p>You can download the latest source distribution as an archive:</p>
</div>
<div class="paragraph">
-<p><a href="https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.zip">pugixml-1.7.zip</a> (Windows line endings)
+<p><a href="https://github.com/zeux/pugixml/releases/download/v1.8/pugixml-1.8.zip">pugixml-1.8.zip</a> (Windows line endings)
/
-<a href="https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.tar.gz">pugixml-1.7.tar.gz</a> (Unix line endings)</p>
+<a href="https://github.com/zeux/pugixml/releases/download/v1.8/pugixml-1.8.tar.gz">pugixml-1.8.tar.gz</a> (Unix line endings)</p>
</div>
<div class="paragraph">
<p>The distribution contains library source, documentation (the manual you&#8217;re reading now and the quick start guide) and some code examples. After downloading the distribution, install pugixml by extracting all files from the compressed archive.</p>
@@ -732,7 +742,7 @@ pugixml is Copyright (C) 2006-2015 Arseny Kapoulkine.</pre>
</div>
</div>
<div class="sect3">
-<h4 id="install.getting.git"><a class="anchor" href="#install.getting.git"></a>2.1.2. Git repository</h4>
+<h4 id="install.getting.git"><a class="anchor" href="#install.getting.git"></a><a class="link" href="#install.getting.git">2.1.2. Git repository</a></h4>
<div class="paragraph">
<p>The Git repository is located at <a href="https://github.com/zeux/pugixml/" class="bare">https://github.com/zeux/pugixml/</a>. There is a Git tag "v{version}" for each version; also there is the "latest" tag, which always points to the latest stable release.</p>
</div>
@@ -743,7 +753,7 @@ pugixml is Copyright (C) 2006-2015 Arseny Kapoulkine.</pre>
<div class="content">
<pre class="pygments highlight"><code data-lang="bash">git clone https://github.com/zeux/pugixml
cd pugixml
-git checkout v1.7</code></pre>
+git checkout v1.8</code></pre>
</div>
</div>
<div class="paragraph">
@@ -754,18 +764,18 @@ git checkout v1.7</code></pre>
</div>
</div>
<div class="sect3">
-<h4 id="install.getting.subversion"><a class="anchor" href="#install.getting.subversion"></a>2.1.3. Subversion repository</h4>
+<h4 id="install.getting.subversion"><a class="anchor" href="#install.getting.subversion"></a><a class="link" href="#install.getting.subversion">2.1.3. Subversion repository</a></h4>
<div class="paragraph">
<p>You can access the Git repository via Subversion using <a href="https://github.com/zeux/pugixml" class="bare">https://github.com/zeux/pugixml</a> URL. For example, to checkout the current version, you can use this command:</p>
</div>
<div class="listingblock">
<div class="content">
-<pre class="pygments highlight"><code data-lang="bash">svn checkout https://github.com/zeux/pugixml/tags/v1.7 pugixml</code></pre>
+<pre class="pygments highlight"><code data-lang="bash">svn checkout https://github.com/zeux/pugixml/tags/v1.8 pugixml</code></pre>
</div>
</div>
</div>
<div class="sect3">
-<h4 id="install.getting.packages"><a class="anchor" href="#install.getting.packages"></a>2.1.4. Packages</h4>
+<h4 id="install.getting.packages"><a class="anchor" href="#install.getting.packages"></a><a class="link" href="#install.getting.packages">2.1.4. Packages</a></h4>
<div class="paragraph">
<p>pugixml is available as a package via various package managers. Note that most packages are maintained separately from the main repository so they do not necessarily contain the latest version.</p>
</div>
@@ -791,7 +801,7 @@ git checkout v1.7</code></pre>
</div>
</div>
<div class="sect2">
-<h3 id="install.building"><a class="anchor" href="#install.building"></a>2.2. Building pugixml</h3>
+<h3 id="install.building"><a class="anchor" href="#install.building"></a><a class="link" href="#install.building">2.2. Building pugixml</a></h3>
<div class="paragraph">
<p>pugixml is distributed in source form without any pre-built binaries; you have to build them yourself.</p>
</div>
@@ -799,9 +809,9 @@ git checkout v1.7</code></pre>
<p>The complete pugixml source consists of three files - one source file, <code>pugixml.cpp</code>, and two header files, <code>pugixml.hpp</code> and <code>pugiconfig.hpp</code>. <code>pugixml.hpp</code> is the primary header which you need to include in order to use pugixml classes/functions; <code>pugiconfig.hpp</code> is a supplementary configuration file (see <a href="#install.building.config">Additional configuration options</a>). The rest of this guide assumes that <code>pugixml.hpp</code> is either in the current directory or in one of include directories of your projects, so that <code>#include "pugixml.hpp"</code> can find the header; however you can also use relative path (i.e. <code>#include "../libs/pugixml/src/pugixml.hpp"</code>) or include directory-relative path (i.e. <code>#include &lt;xml/thirdparty/pugixml/src/pugixml.hpp&gt;</code>).</p>
</div>
<div class="sect3">
-<h4 id="install.building.embed"><a class="anchor" href="#install.building.embed"></a>2.2.1. Building pugixml as a part of another static library/executable</h4>
+<h4 id="install.building.embed"><a class="anchor" href="#install.building.embed"></a><a class="link" href="#install.building.embed">2.2.1. Building pugixml as a part of another static library/executable</a></h4>
<div class="paragraph">
-<p>The easiest way to build pugixml is to compile the source file, <code>pugixml.cpp</code>, along with the existing library/executable. This process depends on the method of building your application; for example, if you&#8217;re using Microsoft Visual Studio <span class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnote_1" title="View footnote.">1</a>]</span>, Apple Xcode, Code::Blocks or any other IDE, just add <code>pugixml.cpp</code> to one of your projects.</p>
+<p>The easiest way to build pugixml is to compile the source file, <code>pugixml.cpp</code>, along with the existing library/executable. This process depends on the method of building your application; for example, if you&#8217;re using Microsoft Visual Studio <sup class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnote_1" title="View footnote.">1</a>]</sup>, Apple Xcode, Code::Blocks or any other IDE, just add <code>pugixml.cpp</code> to one of your projects.</p>
</div>
<div class="paragraph">
<p>If you&#8217;re using Microsoft Visual Studio and the project has precompiled headers turned on, you&#8217;ll see the following error messages:</p>
@@ -848,7 +858,7 @@ git checkout v1.7</code></pre>
</table>
</div>
<div class="sect3">
-<h4 id="install.building.static"><a class="anchor" href="#install.building.static"></a>2.2.2. Building pugixml as a standalone static library</h4>
+<h4 id="install.building.static"><a class="anchor" href="#install.building.static"></a><a class="link" href="#install.building.static">2.2.2. Building pugixml as a standalone static library</a></h4>
<div class="paragraph">
<p>It&#8217;s possible to compile pugixml as a standalone static library. This process depends on the method of building your application; pugixml distribution comes with project files for several popular IDEs/build systems. There are project files for Apple XCode, Code::Blocks, Codelite, Microsoft Visual Studio 2005, 2008, 2010+, and configuration scripts for CMake and premake4. You&#8217;re welcome to submit project files/build scripts for other software; see <a href="#overview.feedback">Feedback</a>.</p>
</div>
@@ -898,7 +908,7 @@ git checkout v1.7</code></pre>
</table>
</div>
<div class="sect3">
-<h4 id="install.building.shared"><a class="anchor" href="#install.building.shared"></a>2.2.3. Building pugixml as a standalone shared library</h4>
+<h4 id="install.building.shared"><a class="anchor" href="#install.building.shared"></a><a class="link" href="#install.building.shared">2.2.3. Building pugixml as a standalone shared library</a></h4>
<div class="paragraph">
<p>It&#8217;s possible to compile pugixml as a standalone shared library. The process is usually similar to the static library approach; however, no preconfigured projects/scripts are included into pugixml distribution, so you&#8217;ll have to do it yourself. Generally, if you&#8217;re using GCC-based toolchain, the process does not differ from building any other library as DLL (adding -shared to compilation flags should suffice); if you&#8217;re using MSVC-based toolchain, you&#8217;ll have to explicitly mark exported symbols with a declspec attribute. You can do it by defining <a href="#PUGIXML_API">PUGIXML_API</a> macro, i.e. via <code>pugiconfig.hpp</code>:</p>
</div>
@@ -925,7 +935,7 @@ If you&#8217;re using STL-related functions, you should use the shared runtime l
</div>
</div>
<div class="sect3">
-<h4 id="install.building.header"><a class="anchor" href="#install.building.header"></a>2.2.4. Using pugixml in header-only mode</h4>
+<h4 id="install.building.header"><a class="anchor" href="#install.building.header"></a><a class="link" href="#install.building.header">2.2.4. Using pugixml in header-only mode</a></h4>
<div id="PUGIXML_HEADER_ONLY" class="paragraph">
<p>It&#8217;s possible to use pugixml in header-only mode. This means that all source code for pugixml will be included in every translation unit that includes <code>pugixml.hpp</code>. This is how most of Boost and STL libraries work.</p>
</div>
@@ -948,7 +958,7 @@ can include pugixml.cpp in your project (see <a href="#install.building.embed">B
</div>
</div>
<div class="sect3">
-<h4 id="install.building.config"><a class="anchor" href="#install.building.config"></a>2.2.5. Additional configuration options</h4>
+<h4 id="install.building.config"><a class="anchor" href="#install.building.config"></a><a class="link" href="#install.building.config">2.2.5. Additional configuration options</a></h4>
<div class="paragraph">
<p>pugixml uses several defines to control the compilation process. There are two ways to define them: either put the needed definitions to <code>pugiconfig.hpp</code> (it has some examples that are commented out) or provide them via compiler command-line. Consistency is important: the definitions should match in all source files that include <code>pugixml.hpp</code> (including pugixml sources) throughout the application. Adding defines to <code>pugiconfig.hpp</code> lets you guarantee this, unless your macro definition is wrapped in preprocessor <code>#if</code>/<code>#ifdef</code> directive and this directive is not consistent. <code>pugiconfig.hpp</code> will never contain anything but comments, which means that when upgrading to a new version, you can safely leave your modified version intact.</p>
</div>
@@ -991,12 +1001,12 @@ In that example <code>PUGIXML_API</code> is inconsistent between several source
</div>
</div>
<div class="sect2">
-<h3 id="install.portability"><a class="anchor" href="#install.portability"></a>2.3. Portability</h3>
+<h3 id="install.portability"><a class="anchor" href="#install.portability"></a><a class="link" href="#install.portability">2.3. Portability</a></h3>
<div class="paragraph">
<p>pugixml is written in standard-compliant C&#43;&#43; with some compiler-specific workarounds where appropriate. pugixml is compatible with the C&#43;&#43;11 standard, but does not require C&#43;&#43;11 support. Each version is tested with a unit test suite with code coverage exceeding 99%.</p>
</div>
<div class="paragraph">
-<p>pugixml runs on a variety of desktop platforms (including Microsoft Windows, Linux, FreeBSD, Apple MacOSX and Sun Solaris), game consoles (inclusing Microsoft Xbox 360, Microsoft Xbox One, Nintendo Wii, Sony Playstation Portable and Sony Playstation 3) and mobile platforms (including Android, BlackBerry, Samsung bada and Microsoft Windows CE).</p>
+<p>pugixml runs on a variety of desktop platforms (including Microsoft Windows, Linux, FreeBSD, Apple MacOSX and Sun Solaris), game consoles (inclusing Microsoft Xbox 360, Microsoft Xbox One, Nintendo Wii, Sony Playstation Portable and Sony Playstation 3) and mobile platforms (including Android, iOS, BlackBerry, Samsung bada and Microsoft Windows CE).</p>
</div>
<div class="paragraph">
<p>pugixml supports various architectures, such as x86/x86-64, PowerPC, ARM, MIPS and SPARC. In general it should run on any architecture since it does not use architecture-specific code and does not rely on features such as unaligned memory access.</p>
@@ -1011,13 +1021,13 @@ In that example <code>PUGIXML_API</code> is inconsistent between several source
</div>
</div>
<div class="sect1">
-<h2 id="dom"><a class="anchor" href="#dom"></a>3. Document object model</h2>
+<h2 id="dom"><a class="anchor" href="#dom"></a><a class="link" href="#dom">3. Document object model</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>pugixml stores XML data in DOM-like way: the entire XML document (both document structure and element data) is stored in memory as a tree. The tree can be loaded from a character stream (file, string, C&#43;&#43; I/O stream), then traversed with the special API or XPath expressions. The whole tree is mutable: both node structure and node/attribute data can be changed at any time. Finally, the result of document transformations can be saved to a character stream (file, C&#43;&#43; I/O stream or custom transport).</p>
</div>
<div class="sect2">
-<h3 id="dom.tree"><a class="anchor" href="#dom.tree"></a>3.1. Tree structure</h3>
+<h3 id="dom.tree"><a class="anchor" href="#dom.tree"></a><a class="link" href="#dom.tree">3.1. Tree structure</a></h3>
<div class="paragraph">
<p>The XML document is represented with a tree data structure. The root of the tree is the document itself, which corresponds to C&#43;&#43; type <a href="#xml_document">xml_document</a>. Document has one or more child nodes, which correspond to C&#43;&#43; type <a href="#xml_node">xml_node</a>. Nodes have different types; depending on a type, a node can have a collection of child nodes, a collection of attributes, which correspond to C&#43;&#43; type <a href="#xml_attribute">xml_attribute</a>, and some additional data (i.e. name).</p>
</div>
@@ -1055,7 +1065,7 @@ In that example <code>PUGIXML_API</code> is inconsistent between several source
<p>Character data nodes (<a id="node_cdata"></a><code>node_cdata</code>) represent text in XML that is quoted in a special way. CDATA nodes do not differ from PCDATA nodes except in XML representation - the above text example looks like this with CDATA:</p>
<div class="listingblock">
<div class="content">
-<pre>&lt;node&gt; &lt;![CDATA[[text1]]&gt; &lt;child/&gt; &lt;![CDATA[[text2]]&gt; &lt;/node&gt;</pre>
+<pre>&lt;node&gt; &lt;![CDATA[text1]]&gt; &lt;child/&gt; &lt;![CDATA[text2]]&gt; &lt;/node&gt;</pre>
</div>
</div>
<div class="paragraph">
@@ -1144,7 +1154,7 @@ In that example <code>PUGIXML_API</code> is inconsistent between several source
</table>
</div>
<div class="sect2">
-<h3 id="dom.cpp"><a class="anchor" href="#dom.cpp"></a>3.2. C&#43;&#43; interface</h3>
+<h3 id="dom.cpp"><a class="anchor" href="#dom.cpp"></a><a class="link" href="#dom.cpp">3.2. C&#43;&#43; interface</a></h3>
<div class="admonitionblock note">
<table>
<tr>
@@ -1217,7 +1227,7 @@ Finally handles can be implicitly cast to boolean-like objects, so that you can
</div>
</div>
<div class="sect2">
-<h3 id="dom.unicode"><a class="anchor" href="#dom.unicode"></a>3.3. Unicode interface</h3>
+<h3 id="dom.unicode"><a class="anchor" href="#dom.unicode"></a><a class="link" href="#dom.unicode">3.3. Unicode interface</a></h3>
<div class="paragraph">
<p>There are two choices of interface and internal representation when configuring pugixml: you can either choose the UTF-8 (also called char) interface or UTF-16/32 (also called wchar_t) one. The choice is controlled via <a href="#PUGIXML_WCHAR_MODE">PUGIXML_WCHAR_MODE</a> define; you can set it via <code>pugiconfig.hpp</code> or via preprocessor options, as discussed in <a href="#install.building.config">Additional configuration options</a>. If this define is set, the wchar_t interface is used; otherwise (by default) the char interface is used. The exact wide character encoding is assumed to be either UTF-16 or UTF-32 and is determined based on the size of <code>wchar_t</code> type.</p>
</div>
@@ -1302,7 +1312,7 @@ There are cases when you&#8217;ll have to convert string data between UTF-8 and
</div>
</div>
<div class="sect2">
-<h3 id="dom.thread"><a class="anchor" href="#dom.thread"></a>3.4. Thread-safety guarantees</h3>
+<h3 id="dom.thread"><a class="anchor" href="#dom.thread"></a><a class="link" href="#dom.thread">3.4. Thread-safety guarantees</a></h3>
<div class="paragraph">
<p>Almost all functions in pugixml have the following thread-safety guarantees:</p>
</div>
@@ -1327,7 +1337,7 @@ There are cases when you&#8217;ll have to convert string data between UTF-8 and
</div>
</div>
<div class="sect2">
-<h3 id="dom.exception"><a class="anchor" href="#dom.exception"></a>3.5. Exception guarantees</h3>
+<h3 id="dom.exception"><a class="anchor" href="#dom.exception"></a><a class="link" href="#dom.exception">3.5. Exception guarantees</a></h3>
<div class="paragraph">
<p>With the exception of XPath, pugixml itself does not throw any exceptions. Additionally, most pugixml functions have a no-throw exception guarantee.</p>
</div>
@@ -1339,12 +1349,12 @@ There are cases when you&#8217;ll have to convert string data between UTF-8 and
</div>
</div>
<div class="sect2">
-<h3 id="dom.memory"><a class="anchor" href="#dom.memory"></a>3.6. Memory management</h3>
+<h3 id="dom.memory"><a class="anchor" href="#dom.memory"></a><a class="link" href="#dom.memory">3.6. Memory management</a></h3>
<div class="paragraph">
<p>pugixml requests the memory needed for document storage in big chunks, and allocates document data inside those chunks. This section discusses replacing functions used for chunk allocation and internal memory management implementation.</p>
</div>
<div class="sect3">
-<h4 id="dom.memory.custom"><a class="anchor" href="#dom.memory.custom"></a>3.6.1. Custom memory allocation/deallocation functions</h4>
+<h4 id="dom.memory.custom"><a class="anchor" href="#dom.memory.custom"></a><a class="link" href="#dom.memory.custom">3.6.1. Custom memory allocation/deallocation functions</a></h4>
<div class="paragraph">
<p><a id="allocation_function"></a><a id="deallocation_function"></a>
All memory for tree structure, tree data and XPath objects is allocated via globally specified functions, which default to malloc/free. You can set your own allocation functions with set_memory_management function. The function interfaces are the same as that of malloc/free:</p>
@@ -1398,7 +1408,7 @@ You can use the following accessor functions to change or get current memory man
</div>
</div>
<div class="sect3">
-<h4 id="dom.memory.tuning"><a class="anchor" href="#dom.memory.tuning"></a>3.6.2. Memory consumption tuning</h4>
+<h4 id="dom.memory.tuning"><a class="anchor" href="#dom.memory.tuning"></a><a class="link" href="#dom.memory.tuning">3.6.2. Memory consumption tuning</a></h4>
<div class="paragraph">
<p>There are several important buffering optimizations in pugixml that rely on predefined constants. These constants have default values that were tuned for common usage patterns; for some applications, changing these constants might improve memory consumption or increase performance. Changing these constants is not recommended unless their default values result in visible problems.</p>
</div>
@@ -1420,7 +1430,7 @@ You can use the following accessor functions to change or get current memory man
</div>
</div>
<div class="sect3">
-<h4 id="dom.memory.internals"><a class="anchor" href="#dom.memory.internals"></a>3.6.3. Document memory management internals</h4>
+<h4 id="dom.memory.internals"><a class="anchor" href="#dom.memory.internals"></a><a class="link" href="#dom.memory.internals">3.6.3. Document memory management internals</a></h4>
<div class="paragraph">
<p>Constructing a document object using the default constructor does not result in any allocations; document node is stored inside the <a href="#xml_document">xml_document</a> object.</p>
</div>
@@ -1432,7 +1442,7 @@ You can use the following accessor functions to change or get current memory man
</div>
</div>
<div class="sect3">
-<h4 id="dom.memory.compact"><a class="anchor" href="#dom.memory.compact"></a>3.6.4. Compact mode</h4>
+<h4 id="dom.memory.compact"><a class="anchor" href="#dom.memory.compact"></a><a class="link" href="#dom.memory.compact">3.6.4. Compact mode</a></h4>
<div class="paragraph">
<p>By default nodes and attributes are optimized for efficiency of access. This can cause them to take a significant amount of memory - for documents with a lot of nodes and not a lot of contents (short attribute values/node text), and depending on the pointer size, the document structure can take noticeably more memory than the document itself (e.g. on a 64-bit platform in UTF-8 mode a markup-heavy document with the file size of 2.1 Mb can use 2.1 Mb for document buffer and 8.3 Mb for document structure).</p>
</div>
@@ -1450,7 +1460,7 @@ You can use the following accessor functions to change or get current memory man
</div>
</div>
<div class="sect1">
-<h2 id="loading"><a class="anchor" href="#loading"></a>4. Loading document</h2>
+<h2 id="loading"><a class="anchor" href="#loading"></a><a class="link" href="#loading">4. Loading document</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>pugixml provides several functions for loading XML data from various places - files, C&#43;&#43; iostreams, memory buffers. All functions use an extremely fast non-validating parser. This parser is not fully W3C conformant - it can load any valid XML document, but does not perform some well-formedness checks. While considerable effort is made to reject invalid XML documents, some validation is not performed for performance reasons. Also some XML transformations (i.e. EOL handling or attribute value normalization) can impact parsing speed and thus can be disabled. However for vast majority of XML documents there is no performance difference between different parsing options. Parsing options also control whether certain XML nodes are parsed; see <a href="#loading.options">Parsing options</a> for more information.</p>
@@ -1459,7 +1469,7 @@ You can use the following accessor functions to change or get current memory man
<p>XML data is always converted to internal character format (see <a href="#dom.unicode">Unicode interface</a>) before parsing. pugixml supports all popular Unicode encodings (UTF-8, UTF-16 (big and little endian), UTF-32 (big and little endian); UCS-2 is naturally supported since it&#8217;s a strict subset of UTF-16) and handles all encoding conversions automatically. Unless explicit encoding is specified, loading functions perform automatic encoding detection based on first few characters of XML data, so in almost all cases you do not have to specify document encoding. Encoding conversion is described in more detail in <a href="#loading.encoding">Encodings</a>.</p>
</div>
<div class="sect2">
-<h3 id="loading.file"><a class="anchor" href="#loading.file"></a>4.1. Loading document from file</h3>
+<h3 id="loading.file"><a class="anchor" href="#loading.file"></a><a class="link" href="#loading.file">4.1. Loading document from file</a></h3>
<div class="paragraph">
<p><a id="xml_document::load_file"></a><a id="xml_document::load_file_wide"></a>
The most common source of XML data is files; pugixml provides dedicated functions for loading an XML document from file:</p>
@@ -1493,7 +1503,7 @@ The most common source of XML data is files; pugixml provides dedicated function
</div>
</div>
<div class="sect2">
-<h3 id="loading.memory"><a class="anchor" href="#loading.memory"></a>4.2. Loading document from memory</h3>
+<h3 id="loading.memory"><a class="anchor" href="#loading.memory"></a><a class="link" href="#loading.memory">4.2. Loading document from memory</a></h3>
<div class="paragraph">
<p><a id="xml_document::load_buffer"></a><a id="xml_document::load_buffer_inplace"></a><a id="xml_document::load_buffer_inplace_own"></a>
Sometimes XML data should be loaded from some other source than a file, i.e. HTTP URL; also you may want to load XML data from file using non-standard functions, i.e. to use your virtual file system facilities or to load XML from GZip-compressed files. All these scenarios require loading document from memory. First you should prepare a contiguous memory block with all XML data; then you have to invoke one of buffer loading functions. These functions will handle the necessary encoding conversions, if any, and then will parse the data into the corresponding XML tree. There are several buffer loading functions, which differ in the behavior and thus in performance/memory usage:</p>
@@ -1572,7 +1582,7 @@ Sometimes XML data should be loaded from some other source than a file, i.e. HTT
</div>
</div>
<div class="sect2">
-<h3 id="loading.stream"><a class="anchor" href="#loading.stream"></a>4.3. Loading document from C&#43;&#43; IOstreams</h3>
+<h3 id="loading.stream"><a class="anchor" href="#loading.stream"></a><a class="link" href="#loading.stream">4.3. Loading document from C&#43;&#43; IOstreams</a></h3>
<div id="xml_document::load_stream" class="paragraph">
<p>To enhance interoperability, pugixml provides functions for loading document from any object which implements C&#43;&#43; <code>std::istream</code> interface. This allows you to load documents from any standard C&#43;&#43; stream (i.e. file stream) or any third-party compliant implementation (i.e. Boost Iostreams). There are two functions, one works with narrow character streams, another handles wide character ones:</p>
</div>
@@ -1599,7 +1609,7 @@ Sometimes XML data should be loaded from some other source than a file, i.e. HTT
</div>
</div>
<div class="sect2">
-<h3 id="loading.errors"><a class="anchor" href="#loading.errors"></a>4.4. Handling parsing errors</h3>
+<h3 id="loading.errors"><a class="anchor" href="#loading.errors"></a><a class="link" href="#loading.errors">4.4. Handling parsing errors</a></h3>
<div id="xml_parse_result" class="paragraph">
<p>All document loading functions return the parsing result via <code>xml_parse_result</code> object. It contains parsing status, the offset of last successfully parsed character from the beginning of the source stream, and the encoding of the source stream:</p>
</div>
@@ -1712,7 +1722,7 @@ Offset is calculated in the XML buffer in native encoding; if encoding conversio
</div>
</div>
<div class="sect2">
-<h3 id="loading.options"><a class="anchor" href="#loading.options"></a>4.5. Parsing options</h3>
+<h3 id="loading.options"><a class="anchor" href="#loading.options"></a><a class="link" href="#loading.options">4.5. Parsing options</a></h3>
<div class="paragraph">
<p>All document loading functions accept the optional parameter <code>options</code>. This is a bitmask that customizes the parsing process: you can select the node types that are parsed and various transformations that are performed with the XML text. Disabling certain transformations can improve parsing performance for some documents; however, the code for all transformations is very well optimized, and thus the majority of documents won&#8217;t get any performance benefit. As a rule of thumb, only modify parsing flags if you want to get some nodes in the document that are excluded by default (i.e. declaration or comment nodes).</p>
</div>
@@ -1758,6 +1768,10 @@ You should use the usual bitwise arithmetics to manipulate the bitmask: to enabl
<p><a id="parse_ws_pcdata_single"></a><code>parse_ws_pcdata_single</code> determines if whitespace-only PCDATA nodes that have no sibling nodes are to be put in DOM tree. In some cases application needs to parse the whitespace-only contents of nodes, i.e. <code>&lt;node&gt; &lt;/node&gt;</code>, but is not interested in whitespace markup elsewhere. It is possible to use <a href="#parse_ws_pcdata">parse_ws_pcdata</a> flag in this case, but it results in excessive allocations and complicates document processing; this flag can be used to avoid that. As an example, after parsing XML string <code>&lt;node&gt; &lt;a&gt; &lt;/a&gt; &lt;/node&gt;</code> with <code>parse_ws_pcdata_single</code> flag set, <code>&lt;node&gt;</code> element will have one child <code>&lt;a&gt;</code>, and <code>&lt;a&gt;</code> element will have one child with type <a href="#node_pcdata">node_pcdata</a> and value <code>" "</code>. This flag has no effect if <a href="#parse_ws_pcdata">parse_ws_pcdata</a> is enabled. This flag is <strong>off</strong> by default.</p>
</li>
<li>
+<p><a id="parse_embed_pcdata"></a><code>parse_embed_pcdata</code> determines if PCDATA contents is to be saved as element values. Normally element nodes have names but not values; this flag forces the parser to store the contents as a value if PCDATA is the first child of the element node (otherwise PCDATA node is created as usual). This can significantly reduce the memory required for documents with many PCDATA nodes. To retrieve the data you can use <code>xml_node::value()</code> on the element nodes or any of the higher-level functions like <code>child_value</code> or <code>text</code>. This flag is <strong>off</strong> by default.
+Since this flag significantly changes the DOM structure it is only recommended for parsing documents with many PCDATA nodes in memory-constrained environments. This flag is <strong>off</strong> by default.</p>
+</li>
+<li>
<p><a id="parse_fragment"></a><code>parse_fragment</code> determines if document should be treated as a fragment of a valid XML. Parsing document as a fragment leads to top-level PCDATA content (i.e. text that is not located inside a node) to be added to a tree, and additionally treats documents without element nodes as valid. This flag is <strong>off</strong> by default.</p>
</li>
</ul>
@@ -1847,7 +1861,7 @@ Using in-place parsing (<a href="#xml_document::load_buffer_inplace">load_buffer
</div>
</div>
<div class="sect2">
-<h3 id="loading.encoding"><a class="anchor" href="#loading.encoding"></a>4.6. Encodings</h3>
+<h3 id="loading.encoding"><a class="anchor" href="#loading.encoding"></a><a class="link" href="#loading.encoding">4.6. Encodings</a></h3>
<div id="xml_encoding" class="paragraph">
<p>pugixml supports all popular Unicode encodings (UTF-8, UTF-16 (big and little endian), UTF-32 (big and little endian); UCS-2 is naturally supported since it&#8217;s a strict subset of UTF-16) and handles all encoding conversions. Most loading functions accept the optional parameter <code>encoding</code>. This is a value of enumeration type <code>xml_encoding</code>, that can have the following values:</p>
</div>
@@ -1927,7 +1941,7 @@ The current behavior for Unicode conversion is to skip all invalid UTF sequences
</div>
</div>
<div class="sect2">
-<h3 id="loading.w3c"><a class="anchor" href="#loading.w3c"></a>4.7. Conformance to W3C specification</h3>
+<h3 id="loading.w3c"><a class="anchor" href="#loading.w3c"></a><a class="link" href="#loading.w3c">4.7. Conformance to W3C specification</a></h3>
<div class="paragraph">
<p>pugixml is not fully W3C conformant - it can load any valid XML document, but does not perform some well-formedness checks. While considerable effort is made to reject invalid XML documents, some validation is not performed because of performance reasons.</p>
</div>
@@ -1966,13 +1980,13 @@ The current behavior for Unicode conversion is to skip all invalid UTF sequences
</div>
</div>
<div class="sect1">
-<h2 id="access"><a class="anchor" href="#access"></a>5. Accessing document data</h2>
+<h2 id="access"><a class="anchor" href="#access"></a><a class="link" href="#access">5. Accessing document data</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>pugixml features an extensive interface for getting various types of data from the document and for traversing the document. This section provides documentation for all such functions that do not modify the tree except for XPath-related functions; see <a href="#xpath">XPath</a> for XPath reference. As discussed in <a href="#dom.cpp">C&#43;&#43; interface</a>, there are two types of handles to tree data - <a href="#xml_node">xml_node</a> and <a href="#xml_attribute">xml_attribute</a>. The handles have special null (empty) values which propagate through various functions and thus are useful for writing more concise code; see <a href="#node_null">this description</a> for details. The documentation in this section will explicitly state the results of all function in case of null inputs.</p>
</div>
<div class="sect2">
-<h3 id="access.basic"><a class="anchor" href="#access.basic"></a>5.1. Basic traversal functions</h3>
+<h3 id="access.basic"><a class="anchor" href="#access.basic"></a><a class="link" href="#access.basic">5.1. Basic traversal functions</a></h3>
<div class="paragraph">
<p><a id="xml_node::parent"></a><a id="xml_node::first_child"></a><a id="xml_node::last_child"></a><a id="xml_node::next_sibling"></a><a id="xml_node::previous_sibling"></a><a id="xml_node::first_attribute"></a><a id="xml_node::last_attribute"></a><a id="xml_attribute::next_attribute"></a><a id="xml_attribute::previous_attribute"></a>
The internal representation of the document is a tree, where each node has a list of child nodes (the order of children corresponds to their order in the XML representation), and additionally element nodes have a list of attributes, which is also ordered. Several functions are provided in order to let you get from one node in the tree to the other. These functions roughly correspond to the internal representation, and thus are usually building blocks for other methods of traversing (i.e. XPath traversals are based on these functions).</p>
@@ -2029,7 +2043,7 @@ Because of memory consumption reasons, attributes do not have a link to their pa
</div>
</div>
<div class="sect2">
-<h3 id="access.nodedata"><a class="anchor" href="#access.nodedata"></a>5.2. Getting node data</h3>
+<h3 id="access.nodedata"><a class="anchor" href="#access.nodedata"></a><a class="link" href="#access.nodedata">5.2. Getting node data</a></h3>
<div class="paragraph">
<p><a id="xml_node::name"></a><a id="xml_node::value"></a>
Apart from structural information (parent, child nodes, attributes), nodes can have name and value, both of which are strings. Depending on node type, name or value may be absent. <a href="#node_document">node_document</a> nodes do not have a name or value, <a href="#node_element">node_element</a> and <a href="#node_declaration">node_declaration</a> nodes always have a name but never have a value, <a href="#node_pcdata">node_pcdata</a>, <a href="#node_cdata">node_cdata</a>, <a href="#node_comment">node_comment</a> and <a href="#node_doctype">node_doctype</a> nodes never have a name but always have a value (it may be empty though), <a href="#node_pi">node_pi</a> nodes always have a name and a value (again, value may be empty). In order to get node&#8217;s name or value, you can use the following functions:</p>
@@ -2064,7 +2078,7 @@ Apart from structural information (parent, child nodes, attributes), nodes can h
</div>
</div>
<div class="sect2">
-<h3 id="access.attrdata"><a class="anchor" href="#access.attrdata"></a>5.3. Getting attribute data</h3>
+<h3 id="access.attrdata"><a class="anchor" href="#access.attrdata"></a><a class="link" href="#access.attrdata">5.3. Getting attribute data</a></h3>
<div class="paragraph">
<p><a id="xml_attribute::name"></a><a id="xml_attribute::value"></a>
All attributes have name and value, both of which are strings (value may be empty). There are two corresponding accessors, like for <code>xml_node</code>:</p>
@@ -2105,10 +2119,10 @@ In many cases attribute values have types that are not strings - i.e. an attribu
</div>
</div>
<div class="paragraph">
-<p><code>as_int</code>, <code>as_uint</code>, <code>as_llong</code>, <code>as_ullong</code>, <code>as_double</code> and <code>as_float</code> convert attribute values to numbers. If attribute handle is null or attribute value is empty, <code>def</code> argument is returned (which is 0 by default). Otherwise, all leading whitespace characters are truncated, and the remaining string is parsed as an integer number in either decimal or hexadecimal form (applicable to <code>as_int</code>, <code>as_uint</code>, <code>as_llong</code> and <code>as_ullong</code>; hexadecimal format is used if the number has <code>0x</code> or <code>0X</code> prefix) or as a floating point number in either decimal or scientific form (<code>as_double</code> or <code>as_float</code>). Any extra characters are silently discarded, i.e. <code>as_int</code> will return <code>1</code> for string <code>"1abc"</code>.</p>
+<p><code>as_int</code>, <code>as_uint</code>, <code>as_llong</code>, <code>as_ullong</code>, <code>as_double</code> and <code>as_float</code> convert attribute values to numbers. If attribute handle is null <code>def</code> argument is returned (which is 0 by default). Otherwise, all leading whitespace characters are truncated, and the remaining string is parsed as an integer number in either decimal or hexadecimal form (applicable to <code>as_int</code>, <code>as_uint</code>, <code>as_llong</code> and <code>as_ullong</code>; hexadecimal format is used if the number has <code>0x</code> or <code>0X</code> prefix) or as a floating point number in either decimal or scientific form (<code>as_double</code> or <code>as_float</code>).</p>
</div>
<div class="paragraph">
-<p>In case the input string contains a number that is out of the target numeric range, the result is undefined.</p>
+<p>In case the input string contains a non-numeric character sequence or a number that is out of the target numeric range, the result is undefined.</p>
</div>
<div class="admonitionblock caution">
<table>
@@ -2153,7 +2167,7 @@ Number conversion functions depend on current C locale as set with <code>setloca
</div>
</div>
<div class="sect2">
-<h3 id="access.contents"><a class="anchor" href="#access.contents"></a>5.4. Contents-based traversal functions</h3>
+<h3 id="access.contents"><a class="anchor" href="#access.contents"></a><a class="link" href="#access.contents">5.4. Contents-based traversal functions</a></h3>
<div class="paragraph">
<p><a id="xml_node::child"></a><a id="xml_node::attribute"></a><a id="xml_node::next_sibling_name"></a><a id="xml_node::previous_sibling_name"></a>
Since a lot of document traversal consists of finding the node/attribute with the correct name, there are special functions for that purpose:</p>
@@ -2207,7 +2221,7 @@ Since a lot of document traversal consists of finding the node/attribute with th
</div>
</div>
<div class="sect2">
-<h3 id="access.rangefor"><a class="anchor" href="#access.rangefor"></a>5.5. Range-based for-loop support</h3>
+<h3 id="access.rangefor"><a class="anchor" href="#access.rangefor"></a><a class="link" href="#access.rangefor">5.5. Range-based for-loop support</a></h3>
<div class="paragraph">
<p><a id="xml_node::children"></a><a id="xml_node::attributes"></a>
If your C&#43;&#43; compiler supports range-based for-loop (this is a C&#43;&#43;11 feature, at the time of writing it&#8217;s supported by Microsoft Visual Studio 2012+, GCC 4.6+ and Clang 3.0+), you can use it to enumerate nodes/attributes. Additional helpers are provided to support this; note that they are also compatible with <a href="http://www.boost.org/libs/foreach/">Boost Foreach</a>, and possibly other pre-C&#43;&#43;11 foreach facilities.</p>
@@ -2247,7 +2261,7 @@ If your C&#43;&#43; compiler supports range-based for-loop (this is a C&#43;&#43
</div>
</div>
<div class="sect2">
-<h3 id="access.iterators"><a class="anchor" href="#access.iterators"></a>5.6. Traversing node/attribute lists via iterators</h3>
+<h3 id="access.iterators"><a class="anchor" href="#access.iterators"></a><a class="link" href="#access.iterators">5.6. Traversing node/attribute lists via iterators</a></h3>
<div class="paragraph">
<p><a id="xml_node_iterator"></a><a id="xml_attribute_iterator"></a><a id="xml_node::begin"></a><a id="xml_node::end"></a><a id="xml_node::attributes_begin"></a><a id="xml_node::attributes_end"></a>
Child node lists and attribute lists are simply double-linked lists; while you can use <code>previous_sibling</code>/<code>next_sibling</code> and other such functions for iteration, pugixml additionally provides node and attribute iterators, so that you can treat nodes as containers of other nodes or attributes:</p>
@@ -2307,7 +2321,7 @@ Node and attribute iterators are somewhere in the middle between const and non-c
</div>
</div>
<div class="sect2">
-<h3 id="access.walker"><a class="anchor" href="#access.walker"></a>5.7. Recursive traversal with xml_tree_walker</h3>
+<h3 id="access.walker"><a class="anchor" href="#access.walker"></a><a class="link" href="#access.walker">5.7. Recursive traversal with xml_tree_walker</a></h3>
<div id="xml_tree_walker" class="paragraph">
<p>The methods described above allow traversal of immediate children of some node; if you want to do a deep tree traversal, you&#8217;ll have to do it via a recursive function or some equivalent method. However, pugixml provides a helper for depth-first traversal of a subtree. In order to use it, you have to implement <code>xml_tree_walker</code> interface and to call <code>traverse</code> function:</p>
</div>
@@ -2375,7 +2389,7 @@ The traversal is launched by calling <code>traverse</code> function on traversal
</div>
</div>
<div class="sect2">
-<h3 id="access.predicate"><a class="anchor" href="#access.predicate"></a>5.8. Searching for nodes/attributes with predicates</h3>
+<h3 id="access.predicate"><a class="anchor" href="#access.predicate"></a><a class="link" href="#access.predicate">5.8. Searching for nodes/attributes with predicates</a></h3>
<div class="paragraph">
<p><a id="xml_node::find_attribute"></a><a id="xml_node::find_child"></a><a id="xml_node::find_node"></a>
While there are existing functions for getting a node/attribute with known contents, they are often not sufficient for simple queries. As an alternative for manual iteration through nodes/attributes until the needed one is found, you can make a predicate and call one of <code>find_</code> functions:</p>
@@ -2440,7 +2454,7 @@ While there are existing functions for getting a node/attribute with known conte
</div>
</div>
<div class="sect2">
-<h3 id="access.text"><a class="anchor" href="#access.text"></a>5.9. Working with text contents</h3>
+<h3 id="access.text"><a class="anchor" href="#access.text"></a><a class="link" href="#access.text">5.9. Working with text contents</a></h3>
<div id="xml_text" class="paragraph">
<p>It is common to store data as text contents of some node - i.e. <code>&lt;node&gt;&lt;description&gt;This is a node&lt;/description&gt;&lt;/node&gt;</code>. In this case, <code>&lt;description&gt;</code> node does not have a value, but instead has a child of type <a href="#node_pcdata">node_pcdata</a> with value <code>"This is a node"</code>. pugixml provides a special class, <code>xml_text</code>, to work with such data. Working with text objects to modify data is described in <a href="#modify.text">the documentation for modifying document data</a>; this section describes the access interface of <code>xml_text</code>.</p>
</div>
@@ -2518,7 +2532,7 @@ If you need a non-empty string if the text object is empty, or if the text conte
</div>
</div>
<div class="sect2">
-<h3 id="access.misc"><a class="anchor" href="#access.misc"></a>5.10. Miscellaneous functions</h3>
+<h3 id="access.misc"><a class="anchor" href="#access.misc"></a><a class="link" href="#access.misc">5.10. Miscellaneous functions</a></h3>
<div id="xml_node::root" class="paragraph">
<p>If you need to get the document root of some node, you can use the following function:</p>
</div>
@@ -2573,7 +2587,7 @@ While pugixml supports complex XPath expressions, sometimes a simple path handli
</div>
</div>
<div class="sect1">
-<h2 id="modify"><a class="anchor" href="#modify"></a>6. Modifying document data</h2>
+<h2 id="modify"><a class="anchor" href="#modify"></a><a class="link" href="#modify">6. Modifying document data</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>The document in pugixml is fully mutable: you can completely change the document structure and modify the data of nodes/attributes. This section provides documentation for the relevant functions. All functions take care of memory management and structural integrity themselves, so they always result in structurally valid tree - however, it is possible to create an invalid XML tree (for example, by adding two attributes with the same name or by setting attribute/node name to empty/invalid string). Tree modification is optimized for performance and for memory consumption, so if you have enough memory you can create documents from scratch with pugixml and later save them to file/stream instead of relying on error-prone manual text writing and without too much overhead.</p>
@@ -2582,7 +2596,7 @@ While pugixml supports complex XPath expressions, sometimes a simple path handli
<p>All member functions that change node/attribute data or structure are non-constant and thus can not be called on constant handles. However, you can easily convert constant handle to non-constant one by simple assignment: <code>void foo(const pugi::xml_node&amp; n) { pugi::xml_node nc = n; }</code>, so const-correctness here mainly provides additional documentation.</p>
</div>
<div class="sect2">
-<h3 id="modify.nodedata"><a class="anchor" href="#modify.nodedata"></a>6.1. Setting node data</h3>
+<h3 id="modify.nodedata"><a class="anchor" href="#modify.nodedata"></a><a class="link" href="#modify.nodedata">6.1. Setting node data</a></h3>
<div class="paragraph">
<p><a id="xml_node::set_name"></a><a id="xml_node::set_value"></a>
As discussed before, nodes can have name and value, both of which are strings. Depending on node type, name or value may be absent. <a href="#node_document">node_document</a> nodes do not have a name or value, <a href="#node_element">node_element</a> and <a href="#node_declaration">node_declaration</a> nodes always have a name but never have a value, <a href="#node_pcdata">node_pcdata</a>, <a href="#node_cdata">node_cdata</a>, <a href="#node_comment">node_comment</a> and <a href="#node_doctype">node_doctype</a> nodes never have a name but always have a value (it may be empty though), <a href="#node_pi">node_pi</a> nodes always have a name and a value (again, value may be empty). In order to set node&#8217;s name or value, you can use the following functions:</p>
@@ -2617,7 +2631,7 @@ As discussed before, nodes can have name and value, both of which are strings. D
</div>
</div>
<div class="sect2">
-<h3 id="modify.attrdata"><a class="anchor" href="#modify.attrdata"></a>6.2. Setting attribute data</h3>
+<h3 id="modify.attrdata"><a class="anchor" href="#modify.attrdata"></a><a class="link" href="#modify.attrdata">6.2. Setting attribute data</a></h3>
<div class="paragraph">
<p><a id="xml_attribute::set_name"></a><a id="xml_attribute::set_value"></a>
All attributes have name and value, both of which are strings (value may be empty). You can set them with the following functions:</p>
@@ -2638,6 +2652,8 @@ All attributes have name and value, both of which are strings (value may be empt
<div class="content">
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-kt">bool</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-n">set_value</span><span class="tok-p">(</span><span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-n">set_value</span><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+<span class="tok-kt">bool</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-n">set_value</span><span class="tok-p">(</span><span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+<span class="tok-kt">bool</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-n">set_value</span><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-n">set_value</span><span class="tok-p">(</span><span class="tok-kt">double</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-n">set_value</span><span class="tok-p">(</span><span class="tok-kt">float</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-n">set_value</span><span class="tok-p">(</span><span class="tok-kt">bool</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
@@ -2680,6 +2696,8 @@ Number conversion functions depend on current C locale as set with <code>setloca
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-k">const</span> <span class="tok-kt">char_t</span><span class="tok-o">*</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">double</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">float</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_attribute</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">bool</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
@@ -2712,7 +2730,7 @@ Number conversion functions depend on current C locale as set with <code>setloca
</div>
</div>
<div class="sect2">
-<h3 id="modify.add"><a class="anchor" href="#modify.add"></a>6.3. Adding nodes/attributes</h3>
+<h3 id="modify.add"><a class="anchor" href="#modify.add"></a><a class="link" href="#modify.add">6.3. Adding nodes/attributes</a></h3>
<div class="paragraph">
<p><a id="xml_node::prepend_attribute"></a><a id="xml_node::append_attribute"></a><a id="xml_node::insert_attribute_after"></a><a id="xml_node::insert_attribute_before"></a><a id="xml_node::prepend_child"></a><a id="xml_node::append_child"></a><a id="xml_node::insert_child_after"></a><a id="xml_node::insert_child_before"></a>
Nodes and attributes do not exist without a document tree, so you can&#8217;t create them without adding them to some document. A node or attribute can be created at the end of node/attribute list or before/after some other node:</p>
@@ -2807,7 +2825,7 @@ Nodes and attributes do not exist without a document tree, so you can&#8217;t cr
</div>
</div>
<div class="sect2">
-<h3 id="modify.remove"><a class="anchor" href="#modify.remove"></a>6.4. Removing nodes/attributes</h3>
+<h3 id="modify.remove"><a class="anchor" href="#modify.remove"></a><a class="link" href="#modify.remove">6.4. Removing nodes/attributes</a></h3>
<div class="paragraph">
<p><a id="xml_node::remove_attribute"></a><a id="xml_node::remove_child"></a>
If you do not want your document to contain some node or attribute, you can remove it with one of the following functions:</p>
@@ -2869,7 +2887,7 @@ If you do not want your document to contain some node or attribute, you can remo
</div>
</div>
<div class="sect2">
-<h3 id="modify.text"><a class="anchor" href="#modify.text"></a>6.5. Working with text contents</h3>
+<h3 id="modify.text"><a class="anchor" href="#modify.text"></a><a class="link" href="#modify.text">6.5. Working with text contents</a></h3>
<div class="paragraph">
<p>pugixml provides a special class, <code>xml_text</code>, to work with text contents stored as a value of some node, i.e. <code>&lt;node&gt;&lt;description&gt;This is a node&lt;/description&gt;&lt;/node&gt;</code>. Working with text objects to retrieve data is described in <a href="#access.text">the documentation for accessing document data</a>; this section describes the modification interface of <code>xml_text</code>.</p>
</div>
@@ -2891,6 +2909,8 @@ If you do not want your document to contain some node or attribute, you can remo
<div class="content">
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-kt">bool</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-n">set</span><span class="tok-p">(</span><span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-n">set</span><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+<span class="tok-kt">bool</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-n">set</span><span class="tok-p">(</span><span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+<span class="tok-kt">bool</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-n">set</span><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-n">set</span><span class="tok-p">(</span><span class="tok-kt">double</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-n">set</span><span class="tok-p">(</span><span class="tok-kt">float</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-n">set</span><span class="tok-p">(</span><span class="tok-kt">bool</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
@@ -2909,6 +2929,8 @@ If you do not want your document to contain some node or attribute, you can remo
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-k">const</span> <span class="tok-kt">char_t</span><span class="tok-o">*</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">double</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">float</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <span class="tok-n">xml_text</span><span class="tok-o">::</span><span class="tok-k">operator</span><span class="tok-o">=</span><span class="tok-p">(</span><span class="tok-kt">bool</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
@@ -2934,7 +2956,7 @@ If you do not want your document to contain some node or attribute, you can remo
</div>
</div>
<div class="sect2">
-<h3 id="modify.clone"><a class="anchor" href="#modify.clone"></a>6.6. Cloning nodes/attributes</h3>
+<h3 id="modify.clone"><a class="anchor" href="#modify.clone"></a><a class="link" href="#modify.clone">6.6. Cloning nodes/attributes</a></h3>
<div class="paragraph">
<p><a id="xml_node::prepend_copy"></a><a id="xml_node::append_copy"></a><a id="xml_node::insert_copy_after"></a><a id="xml_node::insert_copy_before"></a>
With the help of previously described functions, it is possible to create trees with any contents and structure, including cloning the existing data. However since this is an often needed operation, pugixml provides built-in node/attribute cloning facilities. Since nodes and attributes do not exist without a document tree, you can&#8217;t create a standalone copy - you have to immediately insert it somewhere in the tree. For this, you can use one of the following functions:</p>
@@ -3030,7 +3052,7 @@ With the help of previously described functions, it is possible to create trees
</div>
</div>
<div class="sect2">
-<h3 id="modify.move"><a class="anchor" href="#modify.move"></a>6.7. Moving nodes</h3>
+<h3 id="modify.move"><a class="anchor" href="#modify.move"></a><a class="link" href="#modify.move">6.7. Moving nodes</a></h3>
<div class="paragraph">
<p><a id="xml_node::prepend_move"></a><a id="xml_node::append_move"></a><a id="xml_node::insert_move_after"></a><a id="xml_node::insert_move_before"></a>
Sometimes instead of cloning a node you need to move an existing node to a different position in a tree. This can be accomplished by copying the node and removing the original; however, this is expensive since it results in a lot of extra operations. For moving nodes within the same document tree, you can use of the following functions instead:</p>
@@ -3067,7 +3089,7 @@ Sometimes instead of cloning a node you need to move an existing node to a diffe
</div>
</div>
<div class="sect2">
-<h3 id="modify.fragments"><a class="anchor" href="#modify.fragments"></a>6.8. Assembling document from fragments</h3>
+<h3 id="modify.fragments"><a class="anchor" href="#modify.fragments"></a><a class="link" href="#modify.fragments">6.8. Assembling document from fragments</a></h3>
<div id="xml_node::append_buffer" class="paragraph">
<p>pugixml provides several ways to assemble an XML document from other XML documents. Assuming there is a set of document fragments, represented as in-memory buffers, the implementation choices are as follows:</p>
</div>
@@ -3123,7 +3145,7 @@ Sometimes instead of cloning a node you need to move an existing node to a diffe
</div>
</div>
<div class="sect1">
-<h2 id="saving"><a class="anchor" href="#saving"></a>7. Saving document</h2>
+<h2 id="saving"><a class="anchor" href="#saving"></a><a class="link" href="#saving">7. Saving document</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Often after creating a new document or loading the existing one and processing it, it is necessary to save the result back to file. Also it is occasionally useful to output the whole document or a subtree to some stream; use cases include debug printing, serialization via network or other text-oriented medium, etc. pugixml provides several functions to output any subtree of the document to a file, stream or another generic transport interface; these functions allow to customize the output format (see <a href="#saving.options">Output options</a>), and also perform necessary encoding conversions (see <a href="#saving.encoding">Encodings</a>). This section documents the relevant functionality.</p>
@@ -3135,7 +3157,7 @@ Sometimes instead of cloning a node you need to move an existing node to a diffe
<p>CDATA sections with values that contain <code>"]]&gt;"</code> are split into several sections as follows: section with value <code>"pre]]&gt;post"</code> is written as <code>&lt;![CDATA[pre]]]]&gt;&lt;![CDATA[&gt;post]]&gt;</code>. While this alters the structure of the document (if you load the document after saving it, there will be two CDATA sections instead of one), this is the only way to escape CDATA contents.</p>
</div>
<div class="sect2">
-<h3 id="saving.file"><a class="anchor" href="#saving.file"></a>7.1. Saving document to a file</h3>
+<h3 id="saving.file"><a class="anchor" href="#saving.file"></a><a class="link" href="#saving.file">7.1. Saving document to a file</a></h3>
<div class="paragraph">
<p><a id="xml_document::save_file"></a><a id="xml_document::save_file_wide"></a>
If you want to save the whole document to a file, you can use one of the following functions:</p>
@@ -3166,7 +3188,7 @@ If you want to save the whole document to a file, you can use one of the followi
</div>
</div>
<div class="sect2">
-<h3 id="saving.stream"><a class="anchor" href="#saving.stream"></a>7.2. Saving document to C&#43;&#43; IOstreams</h3>
+<h3 id="saving.stream"><a class="anchor" href="#saving.stream"></a><a class="link" href="#saving.stream">7.2. Saving document to C&#43;&#43; IOstreams</a></h3>
<div id="xml_document::save_stream" class="paragraph">
<p>To enhance interoperability pugixml provides functions for saving document to any object which implements C&#43;&#43; <code>std::ostream</code> interface. This allows you to save documents to any standard C&#43;&#43; stream (i.e. file stream) or any third-party compliant implementation (i.e. Boost Iostreams). Most notably, this allows for easy debug output, since you can use <code>std::cout</code> stream as saving target. There are two functions, one works with narrow character streams, another handles wide character ones:</p>
</div>
@@ -3194,7 +3216,7 @@ If you want to save the whole document to a file, you can use one of the followi
</div>
</div>
<div class="sect2">
-<h3 id="saving.writer"><a class="anchor" href="#saving.writer"></a>7.3. Saving document via writer interface</h3>
+<h3 id="saving.writer"><a class="anchor" href="#saving.writer"></a><a class="link" href="#saving.writer">7.3. Saving document via writer interface</a></h3>
<div class="paragraph">
<p><a id="xml_document::save"></a><a id="xml_writer"></a><a id="xml_writer::write"></a>
All of the above saving functions are implemented in terms of writer interface. This is a simple interface with a single function, which is called several times during output process with chunks of document data as input:</p>
@@ -3234,7 +3256,7 @@ All of the above saving functions are implemented in terms of writer interface.
</div>
</div>
<div class="sect2">
-<h3 id="saving.subtree"><a class="anchor" href="#saving.subtree"></a>7.4. Saving a single subtree</h3>
+<h3 id="saving.subtree"><a class="anchor" href="#saving.subtree"></a><a class="link" href="#saving.subtree">7.4. Saving a single subtree</a></h3>
<div class="paragraph">
<p><a id="xml_node::print"></a><a id="xml_node::print_stream"></a>
While the previously described functions save the whole document to the destination, it is easy to save a single subtree. The following functions are provided:</p>
@@ -3273,7 +3295,7 @@ While the previously described functions save the whole document to the destinat
</div>
</div>
<div class="sect2">
-<h3 id="saving.options"><a class="anchor" href="#saving.options"></a>7.5. Output options</h3>
+<h3 id="saving.options"><a class="anchor" href="#saving.options"></a><a class="link" href="#saving.options">7.5. Output options</a></h3>
<div class="paragraph">
<p>All saving functions accept the optional parameter <code>flags</code>. This is a bitmask that customizes the output format; you can select the way the document nodes are printed and select the needed additional information that is output before the document contents.</p>
</div>
@@ -3306,6 +3328,9 @@ You should use the usual bitwise arithmetics to manipulate the bitmask: to enabl
<li>
<p><a id="format_no_escapes"></a><code>format_no_escapes</code> disables output escaping for attribute values and PCDATA contents. If this flag is off, special symbols (<code>"</code>, <code>&amp;</code>, <code>&lt;</code>, <code>&gt;</code>) and all non-printable characters (those with codepoint values less than 32) are converted to XML escape sequences (i.e. <code>&amp;amp;</code>) during output. If this flag is on, no text processing is performed; therefore, output XML can be malformed if output contents contains invalid symbols (i.e. having a stray <code>&lt;</code> in the PCDATA will make the output malformed). This flag is <strong>off</strong> by default.</p>
</li>
+<li>
+<p><a id="format_no_empty_element_tags"></a><code>format_no_empty_element_tags</code> determines if start/end tags should be output instead of empty element tags for empty elements (that is, elements with no children). This flag is <strong>off</strong> by default.</p>
+</li>
</ul>
</div>
<div class="paragraph">
@@ -3381,7 +3406,7 @@ contain platform-independent newline <code>\n</code> (ASCII 10). If this flag is
</div>
</div>
<div class="sect2">
-<h3 id="saving.encoding"><a class="anchor" href="#saving.encoding"></a>7.6. Encodings</h3>
+<h3 id="saving.encoding"><a class="anchor" href="#saving.encoding"></a><a class="link" href="#saving.encoding">7.6. Encodings</a></h3>
<div class="paragraph">
<p>pugixml supports all popular Unicode encodings (UTF-8, UTF-16 (big and little endian), UTF-32 (big and little endian); UCS-2 is naturally supported since it&#8217;s a strict subset of UTF-16) and handles all encoding conversions during output. The output encoding is set via the <code>encoding</code> parameter of saving functions, which is of type <code>xml_encoding</code>. The possible values for the encoding are documented in <a href="#loading.encoding">Encodings</a>; the only flag that has a different meaning is <code>encoding_auto</code>.</p>
</div>
@@ -3405,7 +3430,7 @@ The current behavior for Unicode conversion is to skip all invalid UTF sequences
</div>
</div>
<div class="sect2">
-<h3 id="saving.declaration"><a class="anchor" href="#saving.declaration"></a>7.7. Customizing document declaration</h3>
+<h3 id="saving.declaration"><a class="anchor" href="#saving.declaration"></a><a class="link" href="#saving.declaration">7.7. Customizing document declaration</a></h3>
<div class="paragraph">
<p>When you are saving the document using <code>xml_document::save()</code> or <code>xml_document::save_file()</code>, a default XML document declaration is output, if <code>format_no_declaration</code> is not specified and if the document does not have a declaration node. However, the default declaration is not customizable. If you want to customize the declaration output, you need to create the declaration node yourself.</p>
</div>
@@ -3451,13 +3476,13 @@ By default the declaration node is not added to the document during parsing. If
</div>
</div>
<div class="sect1">
-<h2 id="xpath"><a class="anchor" href="#xpath"></a>8. XPath</h2>
+<h2 id="xpath"><a class="anchor" href="#xpath"></a><a class="link" href="#xpath">8. XPath</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>If the task at hand is to select a subset of document nodes that match some criteria, it is possible to code a function using the existing traversal functionality for any practical criteria. However, often either a data-driven approach is desirable, in case the criteria are not predefined and come from a file, or it is inconvenient to use traversal interfaces and a higher-level DSL is required. There is a standard language for XML processing, XPath, that can be useful for these cases. pugixml implements an almost complete subset of XPath 1.0. Because of differences in document object model and some performance implications, there are minor violations of the official specifications, which can be found in <a href="#xpath.w3c">Conformance to W3C specification</a>. The rest of this section describes the interface for XPath functionality. Please note that if you wish to learn to use XPath language, you have to look for other tutorials or manuals; for example, you can read <a href="http://www.w3schools.com/xpath/">W3Schools XPath tutorial</a>, <a href="http://www.tizag.com/xmlTutorial/xpathtutorial.php">XPath tutorial at tizag.com</a>, and <a href="http://www.w3.org/TR/xpath/">the XPath 1.0 specification</a>.</p>
</div>
<div class="sect2">
-<h3 id="xpath.types"><a class="anchor" href="#xpath.types"></a>8.1. XPath types</h3>
+<h3 id="xpath.types"><a class="anchor" href="#xpath.types"></a><a class="link" href="#xpath.types">8.1. XPath types</a></h3>
<div class="paragraph">
<p><a id="xpath_value_type"></a><a id="xpath_type_number"></a><a id="xpath_type_string"></a><a id="xpath_type_boolean"></a><a id="xpath_type_node_set"></a><a id="xpath_type_none"></a>
Each XPath expression can have one of the following types: boolean, number, string or node set. Boolean type corresponds to <code>bool</code> type, number type corresponds to <code>double</code> type, string type corresponds to either <code>std::string</code> or <code>std::wstring</code>, depending on whether <a href="#dom.unicode">wide character interface is enabled</a>, and node set corresponds to <a href="#xpath_node_set">xpath_node_set</a> type. There is an enumeration, <code>xpath_value_type</code>, which can take the values <code>xpath_type_boolean</code>, <code>xpath_type_number</code>, <code>xpath_type_string</code> or <code>xpath_type_node_set</code>, accordingly.</p>
@@ -3566,7 +3591,7 @@ The order of iteration depends on the order of nodes inside the set; the order c
</div>
</div>
<div class="sect2">
-<h3 id="xpath.select"><a class="anchor" href="#xpath.select"></a>8.2. Selecting nodes via XPath expression</h3>
+<h3 id="xpath.select"><a class="anchor" href="#xpath.select"></a><a class="link" href="#xpath.select">8.2. Selecting nodes via XPath expression</a></h3>
<div class="paragraph">
<p><a id="xml_node::select_node"></a><a id="xml_node::select_nodes"></a>
If you want to select nodes that match some XPath expression, you can do it with the following functions:</p>
@@ -3619,7 +3644,7 @@ While compiling expressions is fast, the compilation time can introduce a signif
</div>
</div>
<div class="sect2">
-<h3 id="xpath.query"><a class="anchor" href="#xpath.query"></a>8.3. Using query objects</h3>
+<h3 id="xpath.query"><a class="anchor" href="#xpath.query"></a><a class="link" href="#xpath.query">8.3. Using query objects</a></h3>
<div id="xpath_query" class="paragraph">
<p>When you call <code>select_nodes</code> with an expression string as an argument, a query object is created behind the scenes. A query object represents a compiled XPath expression. Query objects can be needed in the following circumstances:</p>
</div>
@@ -3734,7 +3759,7 @@ Calling <code>node.select_nodes("query")</code> is equivalent to calling <code>x
</div>
</div>
<div class="sect2">
-<h3 id="xpath.variables"><a class="anchor" href="#xpath.variables"></a>8.4. Using variables</h3>
+<h3 id="xpath.variables"><a class="anchor" href="#xpath.variables"></a><a class="link" href="#xpath.variables">8.4. Using variables</a></h3>
<div class="paragraph">
<p>XPath queries may contain references to variables; this is useful if you want to use queries that depend on some dynamic parameter without manually preparing the complete query string, or if you want to reuse the same query object for similar queries.</p>
</div>
@@ -3883,7 +3908,7 @@ In order to get variable value, you should use one of the following functions, d
</div>
</div>
<div class="sect2">
-<h3 id="xpath.errors"><a class="anchor" href="#xpath.errors"></a>8.5. Error handling</h3>
+<h3 id="xpath.errors"><a class="anchor" href="#xpath.errors"></a><a class="link" href="#xpath.errors">8.5. Error handling</a></h3>
<div class="paragraph">
<p>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 <a href="#PUGIXML_NO_EXCEPTIONS">PUGIXML_NO_EXCEPTIONS</a> define).</p>
</div>
@@ -3974,7 +3999,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="xpath.w3c"><a class="anchor" href="#xpath.w3c"></a>8.6. Conformance to W3C specification</h3>
+<h3 id="xpath.w3c"><a class="anchor" href="#xpath.w3c"></a><a class="link" href="#xpath.w3c">8.6. Conformance to W3C specification</a></h3>
<div class="paragraph">
<p>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:</p>
</div>
@@ -4001,10 +4026,75 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect1">
-<h2 id="changes"><a class="anchor" href="#changes"></a>9. Changelog</h2>
+<h2 id="changes"><a class="anchor" href="#changes"></a><a class="link" href="#changes">9. Changelog</a></h2>
<div class="sectionbody">
<div class="sect2">
-<h3 id="v1.7"><a class="anchor" href="#v1.7"></a>v1.7 <sup>19.10.2015</sup></h3>
+<h3 id="v1.8"><a class="anchor" href="#v1.8"></a><a class="link" href="#v1.8">v1.8 <sup>2016-11-24</sup></a></h3>
+<div class="paragraph">
+<p>Maintenance release. Changes:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>Specification changes:</p>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p>When printing empty elements, a space is no longer added before / in format_raw mode</p>
+</li>
+</ol>
+</div>
+</li>
+<li>
+<p>New features:</p>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p>Added parse_embed_pcdata parsing mode in which PCDATA value is stored in the element node if possible (significantly reducing memory consumption for some documents)</p>
+</li>
+<li>
+<p>Added auto-detection support for Latin-1 (ISO-8859-1) encoding during parsing</p>
+</li>
+<li>
+<p>Added format_no_empty_element_tags formatting flag that outputs start/end tags instead of empty element tags for empty elements</p>
+</li>
+</ol>
+</div>
+</li>
+<li>
+<p>Performance improvements:</p>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p>Minor memory allocation improvements (yielding up to 1% memory savings in some cases)</p>
+</li>
+</ol>
+</div>
+</li>
+<li>
+<p>Compatibility improvements:</p>
+<div class="olist arabic">
+<ol class="arabic">
+<li>
+<p>Fixed compilation issues for Borland C++ 5.4</p>
+</li>
+<li>
+<p>Fixed compilation issues for some distributions of MinGW 3.8</p>
+</li>
+<li>
+<p>Fixed various Clang/GCC warnings</p>
+</li>
+<li>
+<p>Enabled move semantics support for XPath objects for MSVC 2010 and above</p>
+</li>
+</ol>
+</div>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect2">
+<h3 id="v1.7"><a class="anchor" href="#v1.7"></a><a class="link" href="#v1.7">v1.7 <sup>2015-10-19</sup></a></h3>
<div class="paragraph">
<p>Major release, featuring performance and memory improvements along with some new features. Changes:</p>
</div>
@@ -4078,7 +4168,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v1.6"><a class="anchor" href="#v1.6"></a>v1.6 <sup>10.04.2015</sup></h3>
+<h3 id="v1.6"><a class="anchor" href="#v1.6"></a><a class="link" href="#v1.6">v1.6 <sup>2015-04-10</sup></a></h3>
<div class="paragraph">
<p>Maintenance release. Changes:</p>
</div>
@@ -4120,7 +4210,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v1.5"><a class="anchor" href="#v1.5"></a>v1.5 <sup>27.11.2014</sup></h3>
+<h3 id="v1.5"><a class="anchor" href="#v1.5"></a><a class="link" href="#v1.5">v1.5 <sup>2014-11-27</sup></a></h3>
<div class="paragraph">
<p>Major release, featuring a lot of performance improvements and some new features.</p>
</div>
@@ -4219,7 +4309,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v1.4"><a class="anchor" href="#v1.4"></a>v1.4 <sup>27.02.2014</sup></h3>
+<h3 id="v1.4"><a class="anchor" href="#v1.4"></a><a class="link" href="#v1.4">v1.4 <sup>2014-02-27</sup></a></h3>
<div class="paragraph">
<p>Major release, featuring various new features, bug fixes and compatibility improvements.</p>
</div>
@@ -4305,7 +4395,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v1.2"><a class="anchor" href="#v1.2"></a>v1.2 <sup>1.05.2012</sup></h3>
+<h3 id="v1.2"><a class="anchor" href="#v1.2"></a><a class="link" href="#v1.2">v1.2 <sup>2012-05-01</sup></a></h3>
<div class="paragraph">
<p>Major release, featuring header-only mode, various interface enhancements (i.e. PCDATA manipulation and C&#43;&#43;11 iteration), many other features and compatibility improvements.</p>
</div>
@@ -4390,7 +4480,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v1.0"><a class="anchor" href="#v1.0"></a>v1.0 <sup>1.11.2010</sup></h3>
+<h3 id="v1.0"><a class="anchor" href="#v1.0"></a><a class="link" href="#v1.0">v1.0 <sup>2010-11-01</sup></a></h3>
<div class="paragraph">
<p>Major release, featuring many XPath enhancements, wide character filename support, miscellaneous performance improvements, bug fixes and more.</p>
</div>
@@ -4586,7 +4676,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.9"><a class="anchor" href="#v0.9"></a>v0.9 <sup>1.07.2010</sup></h3>
+<h3 id="v0.9"><a class="anchor" href="#v0.9"></a><a class="link" href="#v0.9">v0.9 <sup>2010-07-01</sup></a></h3>
<div class="paragraph">
<p>Major release, featuring extended and improved Unicode support, miscellaneous performance improvements, bug fixes and more.</p>
</div>
@@ -4701,7 +4791,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.5"><a class="anchor" href="#v0.5"></a>v0.5 <sup>8.11.2009</sup></h3>
+<h3 id="v0.5"><a class="anchor" href="#v0.5"></a><a class="link" href="#v0.5">v0.5 <sup>2009-11-08</sup></a></h3>
<div class="paragraph">
<p>Major bugfix release. Changes:</p>
</div>
@@ -4808,7 +4898,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.42"><a class="anchor" href="#v0.42"></a>v0.42 <sup>17.09.2009</sup></h3>
+<h3 id="v0.42"><a class="anchor" href="#v0.42"></a><a class="link" href="#v0.42">v0.42 <sup>2009-09-17</sup></a></h3>
<div class="paragraph">
<p>Maintenance release. Changes:</p>
</div>
@@ -4853,7 +4943,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.41"><a class="anchor" href="#v0.41"></a>v0.41 <sup>8.02.2009</sup></h3>
+<h3 id="v0.41"><a class="anchor" href="#v0.41"></a><a class="link" href="#v0.41">v0.41 <sup>2009-02-08</sup></a></h3>
<div class="paragraph">
<p>Maintenance release. Changes:</p>
</div>
@@ -4873,7 +4963,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.4"><a class="anchor" href="#v0.4"></a>v0.4 <sup>18.01.2009</sup></h3>
+<h3 id="v0.4"><a class="anchor" href="#v0.4"></a><a class="link" href="#v0.4">v0.4 <sup>2009-01-18</sup></a></h3>
<div class="paragraph">
<p>Changes:</p>
</div>
@@ -4940,7 +5030,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.34"><a class="anchor" href="#v0.34"></a>v0.34 <sup>31.10.2007</sup></h3>
+<h3 id="v0.34"><a class="anchor" href="#v0.34"></a><a class="link" href="#v0.34">v0.34 <sup>2007-10-31</sup></a></h3>
<div class="paragraph">
<p>Maintenance release. Changes:</p>
</div>
@@ -4982,7 +5072,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.3"><a class="anchor" href="#v0.3"></a>v0.3 <sup>21.02.2007</sup></h3>
+<h3 id="v0.3"><a class="anchor" href="#v0.3"></a><a class="link" href="#v0.3">v0.3 <sup>2007-02-21</sup></a></h3>
<div class="paragraph">
<p>Refactored, reworked and improved version. Changes:</p>
</div>
@@ -5048,7 +5138,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.2"><a class="anchor" href="#v0.2"></a>v0.2 <sup>6.11.2006</sup></h3>
+<h3 id="v0.2"><a class="anchor" href="#v0.2"></a><a class="link" href="#v0.2">v0.2 <sup>2006-11-06</sup></a></h3>
<div class="paragraph">
<p>First public release. Changes:</p>
</div>
@@ -5087,7 +5177,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="v0.1"><a class="anchor" href="#v0.1"></a>v0.1 <sup>15.07.2006</sup></h3>
+<h3 id="v0.1"><a class="anchor" href="#v0.1"></a><a class="link" href="#v0.1">v0.1 <sup>2006-07-15</sup></a></h3>
<div class="paragraph">
<p>First private release for testing purposes</p>
</div>
@@ -5095,13 +5185,13 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect1">
-<h2 id="apiref"><a class="anchor" href="#apiref"></a>10. API Reference</h2>
+<h2 id="apiref"><a class="anchor" href="#apiref"></a><a class="link" href="#apiref">10. API Reference</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>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.</p>
</div>
<div class="sect2">
-<h3 id="apiref.macros"><a class="anchor" href="#apiref.macros"></a>10.1. Macros</h3>
+<h3 id="apiref.macros"><a class="anchor" href="#apiref.macros"></a><a class="link" href="#apiref.macros">10.1. Macros</a></h3>
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-cp">#define <a href="#PUGIXML_WCHAR_MODE">PUGIXML_WCHAR_MODE</a></span>
@@ -5121,7 +5211,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="apiref.types"><a class="anchor" href="#apiref.types"></a>10.2. Types</h3>
+<h3 id="apiref.types"><a class="anchor" href="#apiref.types"></a><a class="link" href="#apiref.types">10.2. Types</a></h3>
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-k">typedef</span> <span class="tok-n">configuration</span><span class="tok-o">-</span><span class="tok-n">defined</span><span class="tok-o">-</span><span class="tok-n">type</span> <a href="#char_t">char_t</a><span class="tok-p">;</span>
@@ -5132,7 +5222,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="apiref.enums"><a class="anchor" href="#apiref.enums"></a>10.3. Enumerations</h3>
+<h3 id="apiref.enums"><a class="anchor" href="#apiref.enums"></a><a class="link" href="#apiref.enums">10.3. Enumerations</a></h3>
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-k">enum</span> <a href="#xml_node_type">xml_node_type</a>
@@ -5187,7 +5277,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="apiref.constants"><a class="anchor" href="#apiref.constants"></a>10.4. Constants</h3>
+<h3 id="apiref.constants"><a class="anchor" href="#apiref.constants"></a><a class="link" href="#apiref.constants">10.4. Constants</a></h3>
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-c1">// Formatting options bit flags:</span>
@@ -5195,6 +5285,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#format_indent">format_indent</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#format_indent_attributes">format_indent_attributes</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#format_no_declaration">format_no_declaration</a>
+<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#format_no_empty_element_tags">format_no_empty_element_tags</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#format_no_escapes">format_no_escapes</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#format_raw">format_raw</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#format_save_file_text">format_save_file_text</a>
@@ -5215,13 +5306,14 @@ If exceptions are disabled, then in the event of parsing failure the query is in
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#parse_trim_pcdata">parse_trim_pcdata</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#parse_ws_pcdata">parse_ws_pcdata</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#parse_ws_pcdata_single">parse_ws_pcdata_single</a>
+<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#parse_embed_pcdata">parse_embed_pcdata</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#parse_wconv_attribute">parse_wconv_attribute</a>
<span class="tok-k">const</span> <span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <a href="#parse_wnorm_attribute">parse_wnorm_attribute</a></code></pre>
</div>
</div>
</div>
<div class="sect2">
-<h3 id="apiref.classes"><a class="anchor" href="#apiref.classes"></a>10.5. Classes</h3>
+<h3 id="apiref.classes"><a class="anchor" href="#apiref.classes"></a><a class="link" href="#apiref.classes">10.5. Classes</a></h3>
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-k">class</span> <a href="#xml_attribute">xml_attribute</a>
@@ -5258,6 +5350,8 @@ If exceptions are disabled, then in the event of parsing failure the query is in
<span class="tok-kt">bool</span> <a href="#xml_attribute::set_value">set_value</a><span class="tok-p">(</span><span class="tok-k">const</span> <span class="tok-kt">char_t</span><span class="tok-o">*</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_attribute::set_value">set_value</a><span class="tok-p">(</span><span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_attribute::set_value">set_value</a><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+ <span class="tok-kt">bool</span> <a href="#xml_attribute::set_value">set_value</a><span class="tok-p">(</span><span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+ <span class="tok-kt">bool</span> <a href="#xml_attribute::set_value">set_value</a><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_attribute::set_value">set_value</a><span class="tok-p">(</span><span class="tok-kt">double</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_attribute::set_value">set_value</a><span class="tok-p">(</span><span class="tok-kt">float</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_attribute::set_value">set_value</a><span class="tok-p">(</span><span class="tok-kt">bool</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
@@ -5267,6 +5361,8 @@ If exceptions are disabled, then in the event of parsing failure the query is in
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <a href="#xml_attribute::assign">operator=</a><span class="tok-p">(</span><span class="tok-k">const</span> <span class="tok-kt">char_t</span><span class="tok-o">*</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <a href="#xml_attribute::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <a href="#xml_attribute::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+ <span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <a href="#xml_attribute::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+ <span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <a href="#xml_attribute::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <a href="#xml_attribute::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">double</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <a href="#xml_attribute::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">float</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_attribute</span><span class="tok-o">&amp;</span> <a href="#xml_attribute::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">bool</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
@@ -5451,6 +5547,8 @@ If exceptions are disabled, then in the event of parsing failure the query is in
<span class="tok-kt">bool</span> <a href="#xml_text::set">set</a><span class="tok-p">(</span><span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_text::set">set</a><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+ <span class="tok-kt">bool</span> <a href="#xml_text::set">set</a><span class="tok-p">(</span><span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+ <span class="tok-kt">bool</span> <a href="#xml_text::set">set</a><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_text::set">set</a><span class="tok-p">(</span><span class="tok-kt">double</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_text::set">set</a><span class="tok-p">(</span><span class="tok-kt">float</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-kt">bool</span> <a href="#xml_text::set">set</a><span class="tok-p">(</span><span class="tok-kt">bool</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
@@ -5460,6 +5558,8 @@ If exceptions are disabled, then in the event of parsing failure the query is in
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <a href="#xml_text::assign">operator=</a><span class="tok-p">(</span><span class="tok-k">const</span> <span class="tok-kt">char_t</span><span class="tok-o">*</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <a href="#xml_text::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <a href="#xml_text::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">int</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+ <span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <a href="#xml_text::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
+ <span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <a href="#xml_text::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">unsigned</span> <span class="tok-kt">long</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <a href="#xml_text::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">double</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <a href="#xml_text::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">float</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
<span class="tok-n">xml_text</span><span class="tok-o">&amp;</span> <a href="#xml_text::assign">operator=</a><span class="tok-p">(</span><span class="tok-kt">bool</span> <span class="tok-n">rhs</span><span class="tok-p">);</span>
@@ -5564,7 +5664,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
</div>
<div class="sect2">
-<h3 id="apiref.functions"><a class="anchor" href="#apiref.functions"></a>10.6. Functions</h3>
+<h3 id="apiref.functions"><a class="anchor" href="#apiref.functions"></a><a class="link" href="#apiref.functions">10.6. Functions</a></h3>
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="c++"><span class="tok-n">std</span><span class="tok-o">::</span><span class="tok-n">string</span> <a href="#as_utf8">as_utf8</a><span class="tok-p">(</span><span class="tok-k">const</span> <span class="tok-kt">wchar_t</span><span class="tok-o">*</span> <span class="tok-n">str</span><span class="tok-p">);</span>
@@ -5588,7 +5688,7 @@ If exceptions are disabled, then in the event of parsing failure the query is in
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2015-10-18 21:00:51 PDT
+Last updated 2016-11-24 00:20:49 STD
</div>
</div>
</body>
diff --git a/docs/quickstart.adoc b/docs/quickstart.adoc
index 4807524..fe5eac6 100644
--- a/docs/quickstart.adoc
+++ b/docs/quickstart.adoc
@@ -24,8 +24,8 @@ https://github.com/zeux/pugixml/releases/download/v{version}/pugixml-{version}.t
The distribution contains library source, documentation (the guide you're reading now and the manual) and some code examples. After downloading the distribution, install pugixml by extracting all files from the compressed archive.
The complete pugixml source consists of three files - one source file, `pugixml.cpp`, and two header files, `pugixml.hpp` and `pugiconfig.hpp`. `pugixml.hpp` is the primary header which you need to include in order to use pugixml classes/functions. The rest of this guide assumes that `pugixml.hpp` is either in the current directory or in one of include directories of your projects, so that `#include "pugixml.hpp"` can find the header; however you can also use relative path (i.e. `#include "../libs/pugixml/src/pugixml.hpp"`) or include directory-relative path (i.e. `#include <xml/thirdparty/pugixml/src/pugixml.hpp>`).
-
-The easiest way to build pugixml is to compile the source file, `pugixml.cpp`, along with the existing library/executable. This process depends on the method of building your application; for example, if you're using Microsoft Visual Studio footnote:[All trademarks used are properties of their respective owners.], Apple Xcode, Code::Blocks or any other IDE, just add `pugixml.cpp` to one of your projects. There are other building methods available, including building pugixml as a standalone static/shared library; link:manual/install.html#install.building[read the manual] for further information.
+
+The easiest way to build pugixml is to compile the source file, `pugixml.cpp`, along with the existing library/executable. This process depends on the method of building your application; for example, if you're using Microsoft Visual Studio footnote:[All trademarks used are properties of their respective owners.], Apple Xcode, Code::Blocks or any other IDE, just add `pugixml.cpp` to one of your projects. There are other building methods available, including building pugixml as a standalone static/shared library; link:manual.html#install.building[read the manual] for further information.
[[dom]]
== Document object model
@@ -67,7 +67,7 @@ This is an example of loading XML document from file (link:samples/load_file.cpp
[source,indent=0]
----
-include::samples/load_file.cpp[tags=code]
+include::samples/load_file.cpp[tags=code]
----
`load_file`, as well as other loading functions, destroys the existing document tree and then tries to load the new tree from the specified file. The result of the operation is returned in an `xml_parse_result` object; this object contains the operation status, and the related information (i.e. last successfully parsed position in the input file, if parsing fails).
@@ -78,7 +78,7 @@ This is an example of handling loading errors (link:samples/load_error_handling.
[source,indent=0]
----
-include::samples/load_error_handling.cpp[tags=code]
+include::samples/load_error_handling.cpp[tags=code]
----
Sometimes XML data should be loaded from some other source than file, i.e. HTTP URL; also you may want to load XML data from file using non-standard functions, i.e. to use your virtual file system facilities or to load XML from gzip-compressed files. These scenarios either require loading document from memory, in which case you should prepare a contiguous memory block with all XML data and to pass it to one of buffer loading functions, or loading document from C{plus}{plus} IOstream, in which case you should provide an object which implements `std::istream` or `std::wistream` interface.
@@ -255,7 +255,7 @@ If filing an issue is not possible due to privacy or other concerns, you can con
The pugixml library is distributed under the MIT license:
....
-Copyright (c) 2006-2015 Arseny Kapoulkine
+Copyright (c) 2006-2016 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -280,8 +280,8 @@ OTHER DEALINGS IN THE SOFTWARE.
....
This means that you can freely use pugixml in your applications, both open-source and proprietary. If you use pugixml in a product, it is sufficient to add an acknowledgment like this to the product distribution:
-
+
....
This software is based on pugixml library (http://pugixml.org).
-pugixml is Copyright (C) 2006-2015 Arseny Kapoulkine.
+pugixml is Copyright (C) 2006-2016 Arseny Kapoulkine.
.... \ No newline at end of file
diff --git a/docs/quickstart.html b/docs/quickstart.html
index 79b1906..382fca0 100644
--- a/docs/quickstart.html
+++ b/docs/quickstart.html
@@ -4,21 +4,20 @@
<meta charset="UTF-8">
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge"><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<meta name="generator" content="Asciidoctor 1.5.2">
+<meta name="generator" content="Asciidoctor 1.5.5">
<meta name="author" content="website, repository">
-<title>pugixml 1.7 quick start guide</title>
-<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400">
+<title>pugixml 1.8 quick start guide</title>
+<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700">
<style>
/* Asciidoctor default stylesheet | MIT License | http://asciidoctor.org */
-/* Remove the comments around the @import statement below when using this as a custom stylesheet */
-/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400";*/
+/* Remove comment around @import statement below when using as a custom stylesheet */
+/*@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";*/
article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}
audio,canvas,video{display:inline-block}
audio:not([controls]){display:none;height:0}
[hidden],template{display:none}
script{display:none!important}
html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}
-body{margin:0}
a{background:transparent}
a:focus{outline:thin dotted}
a:active,a:hover{outline:0}
@@ -53,12 +52,11 @@ textarea{overflow:auto;vertical-align:top}
table{border-collapse:collapse;border-spacing:0}
*,*:before,*:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}
html,body{font-size:100%}
-body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto}
+body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;font-weight:400;font-style:normal;line-height:1;position:relative;cursor:auto;tab-size:4;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
a:hover{cursor:pointer}
img,object,embed{max-width:100%;height:auto}
object,embed{height:100%}
img{-ms-interpolation-mode:bicubic}
-#map_canvas img,#map_canvas embed,#map_canvas object,.map_canvas img,.map_canvas embed,.map_canvas object{max-width:none!important}
.left{float:left!important}
.right{float:right!important}
.text-left{text-align:left!important}
@@ -66,10 +64,11 @@ img{-ms-interpolation-mode:bicubic}
.text-center{text-align:center!important}
.text-justify{text-align:justify!important}
.hide{display:none}
-.antialiased,body{-webkit-font-smoothing:antialiased}
-img{display:inline-block;vertical-align:middle}
+img,object,svg{display:inline-block;vertical-align:middle}
textarea{height:auto;min-height:50px}
select{width:100%}
+.center{margin-left:auto;margin-right:auto}
+.spread{width:100%}
p.lead,.paragraph.lead>p,#preamble>.sectionbody>.paragraph:first-of-type p{font-size:1.21875em;line-height:1.6}
.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0;direction:ltr}
@@ -112,7 +111,8 @@ blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
h1{font-size:2.75em}
h2{font-size:2.3125em}
h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
-h4{font-size:1.4375em}}table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
+h4{font-size:1.4375em}}
+table{background:#fff;margin-bottom:1.25em;border:solid 1px #dedede}
table thead,table tfoot{background:#f7f8f7;font-weight:bold}
table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
@@ -122,10 +122,14 @@ h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-s
h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
.clearfix:before,.clearfix:after,.float-group:before,.float-group:after{content:" ";display:table}
.clearfix:after,.float-group:after{clear:both}
-*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
+*:not(pre)>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background-color:#f7f7f8;-webkit-border-radius:4px;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed;word-wrap:break-word}
+*:not(pre)>code.nobreak{word-wrap:normal}
+*:not(pre)>code.nowrap{white-space:nowrap}
pre,pre>code{line-height:1.45;color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;text-rendering:optimizeSpeed}
+em em{font-style:normal}
+strong strong{font-weight:400}
.keyseq{color:rgba(51,51,51,.8)}
-kbd{display:inline-block;color:rgba(0,0,0,.8);font-size:.75em;line-height:1.4;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:-.15em .15em 0 .15em;padding:.2em .6em .2em .5em;vertical-align:middle;white-space:nowrap}
+kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background-color:#f7f7f7;border:1px solid #ccc;-webkit-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em white inset;box-shadow:0 1px 0 rgba(0,0,0,.2),0 0 0 .1em #fff inset;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
.keyseq kbd:first-child{margin-left:0}
.keyseq kbd:last-child{margin-right:0}
.menuseq,.menu{color:rgba(0,0,0,.8)}
@@ -156,29 +160,33 @@ p a>code:hover{color:rgba(0,0,0,.9)}
#toc ul.sectlevel0>li>a{font-style:italic}
#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
+#toc li{line-height:1.3334;margin-top:.3334em}
#toc a{text-decoration:none}
#toc a:active{text-decoration:underline}
#toctitle{color:#7a2518;font-size:1.2em}
@media only screen and (min-width:768px){#toctitle{font-size:1.375em}
body.toc2{padding-left:15em;padding-right:0}
#toc.toc2{margin-top:0!important;background-color:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #efefed;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
-#toc.toc2 #toctitle{margin-top:0;font-size:1.2em}
+#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
#toc.toc2>ul{font-size:.9em;margin-bottom:0}
#toc.toc2 ul ul{margin-left:0;padding-left:1em}
#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
body.toc2.toc-right{padding-left:0;padding-right:15em}
-body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
+body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #efefed;left:auto;right:0}}
+@media only screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
#toc.toc2{width:20em}
#toc.toc2 #toctitle{font-size:1.375em}
#toc.toc2>ul{font-size:.95em}
#toc.toc2 ul ul{padding-left:1.25em}
-body.toc2.toc-right{padding-left:0;padding-right:20em}}#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
+body.toc2.toc-right{padding-left:0;padding-right:20em}}
+#content #toc{border-style:solid;border-width:1px;border-color:#e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;-webkit-border-radius:4px;border-radius:4px}
#content #toc>:first-child{margin-top:0}
#content #toc>:last-child{margin-bottom:0}
#footer{max-width:100%;background-color:rgba(0,0,0,.8);padding:1.25em}
#footer-text{color:rgba(255,255,255,.8);line-height:1.44}
.sect1{padding-bottom:.625em}
-@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}.sect1+.sect1{border-top:1px solid #efefed}
+@media only screen and (min-width:768px){.sect1{padding-bottom:1.25em}}
+.sect1+.sect1{border-top:1px solid #efefed}
#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
#content h1>a.anchor:before,h2>a.anchor:before,h3>a.anchor:before,#toctitle>a.anchor:before,.sidebarblock>.content>.title>a.anchor:before,h4>a.anchor:before,h5>a.anchor:before,h6>a.anchor:before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
@@ -207,7 +215,9 @@ table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inh
.sidebarblock .literalblock pre,.sidebarblock .listingblock pre:not(.highlight),.sidebarblock .listingblock pre[class="highlight"],.sidebarblock .listingblock pre[class^="highlight "],.sidebarblock .listingblock pre.CodeRay,.sidebarblock .listingblock pre.prettyprint{background:#f2f1f1}
.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{-webkit-border-radius:4px;border-radius:4px;word-wrap:break-word;padding:1em;font-size:.8125em}
.literalblock pre.nowrap,.literalblock pre[class].nowrap,.listingblock pre.nowrap,.listingblock pre[class].nowrap{overflow-x:auto;white-space:pre;word-wrap:normal}
-@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
+@media only screen and (min-width:768px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:.90625em}}
+@media only screen and (min-width:1280px){.literalblock pre,.literalblock pre[class],.listingblock pre,.listingblock pre[class]{font-size:1em}}
+.literalblock.output pre{color:#f7f7f8;background-color:rgba(0,0,0,.9)}
.listingblock pre.highlightjs{padding:0}
.listingblock pre.highlightjs>code{padding:1em;-webkit-border-radius:4px;border-radius:4px}
.listingblock pre.prettyprint{border-width:0}
@@ -217,7 +227,7 @@ table.tableblock #preamble>.sectionbody>.paragraph:first-of-type p{font-size:inh
.listingblock.terminal pre .command:before{content:attr(data-prompt);padding-right:.5em;color:#999}
.listingblock.terminal pre .command:not([data-prompt]):before{content:"$"}
table.pyhltable{border-collapse:separate;border:0;margin-bottom:0;background:none}
-table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0}
+table.pyhltable td{vertical-align:top;padding-top:0;padding-bottom:0;line-height:1.45}
table.pyhltable td.code{padding-left:.75em;padding-right:0}
pre.pygments .lineno,table.pyhltable td:not(.code){color:#999;padding-left:0;padding-right:.5em;border-right:1px solid #ddddd8}
pre.pygments .lineno{display:inline-block;margin-right:.25em}
@@ -238,13 +248,12 @@ table.pyhltable .linenodiv{background:none!important;padding-right:0!important}
.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
.quoteblock .attribution br,.verseblock .attribution br{display:none}
-.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.05em;color:rgba(0,0,0,.6)}
+.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
.quoteblock.abstract{margin:0 0 1.25em 0;display:block}
.quoteblock.abstract blockquote,.quoteblock.abstract blockquote p{text-align:left;word-spacing:0}
.quoteblock.abstract blockquote:before,.quoteblock.abstract blockquote p:first-of-type:before{display:none}
table.tableblock{max-width:100%;border-collapse:separate}
table.tableblock td>.paragraph:last-child p>p:last-child,table.tableblock th>p:last-child,table.tableblock td>p:last-child{margin-bottom:0}
-table.spread{width:100%}
table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
table.grid-all th.tableblock,table.grid-all td.tableblock{border-width:0 1px 1px 0}
table.grid-all tfoot>tr>th.tableblock,table.grid-all tfoot>tr>td.tableblock{border-width:1px 1px 0 0}
@@ -290,8 +299,8 @@ ol.upperroman{list-style-type:upper-roman}
ol.lowergreek{list-style-type:lower-greek}
.hdlist>table,.colist>table{border:0;background:none}
.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
-td.hdlist1{padding-right:.75em;font-weight:bold}
-td.hdlist1,td.hdlist2{vertical-align:top}
+td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
+td.hdlist1{font-weight:bold;padding-bottom:1.25em}
.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
.colist>table tr>td:first-of-type{padding:0 .75em;line-height:1}
.colist>table tr>td:last-of-type{padding:.25em 0}
@@ -304,13 +313,14 @@ td.hdlist1,td.hdlist2{vertical-align:top}
.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
.image.left{margin-right:.625em}
.image.right{margin-left:.625em}
-a.image{text-decoration:none}
-span.footnote,span.footnoteref{vertical-align:super;font-size:.875em}
-span.footnote a,span.footnoteref a{text-decoration:none}
-span.footnote a:active,span.footnoteref a:active{text-decoration:underline}
+a.image{text-decoration:none;display:inline-block}
+a.image object{pointer-events:none}
+sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
+sup.footnote a,sup.footnoteref a{text-decoration:none}
+sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em 0;border-width:1px 0 0 0}
-#footnotes .footnote{padding:0 .375em;line-height:1.3;font-size:.875em;margin-left:1.2em;text-indent:-1.2em;margin-bottom:.2em}
+#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;text-indent:-1.05em;margin-bottom:.2em}
#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none}
#footnotes .footnote:last-of-type{margin-bottom:0}
#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
@@ -368,11 +378,10 @@ span.icon>.fa{cursor:default}
pre .conum[data-value]{position:relative;top:-.125em}
b.conum *{color:inherit!important}
.conum:not([data-value]):empty{display:none}
-h1,h2{letter-spacing:-.01em}
-dt,th.tableblock,td.content{text-rendering:optimizeLegibility}
-p,td.content{letter-spacing:-.01em}
-p strong,td.content strong{letter-spacing:-.005em}
-p,blockquote,dt,td.content{font-size:1.0625rem}
+dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
+h1,h2,p,td.content,span.alt{letter-spacing:-.01em}
+p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
+p,blockquote,dt,td.content,span.alt{font-size:1.0625rem}
p{margin-bottom:1.25rem}
.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
.exampleblock>.content{background-color:#fffef7;border-color:#e0e0dc;-webkit-box-shadow:0 1px 4px #e0e0dc;box-shadow:0 1px 4px #e0e0dc}
@@ -383,9 +392,9 @@ a{color:inherit!important;text-decoration:underline!important}
a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
a[href^="http:"]:not(.bare):after,a[href^="https:"]:not(.bare):after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
abbr[title]:after{content:" (" attr(title) ")"}
-pre,blockquote,tr,img{page-break-inside:avoid}
+pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
thead{display:table-header-group}
-img{max-width:100%!important}
+svg{max-width:100%}
p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
#toc,.sidebarblock,.exampleblock>.content{background:none!important}
@@ -411,7 +420,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</style>
<style>
.listingblock .pygments .hll { background-color: #ffffcc }
-.listingblock .pygments { background: #f8f8f8; }
+.listingblock .pygments, .listingblock .pygments code { background: #f8f8f8; }
.listingblock .pygments .tok-c { color: #408080; font-style: italic } /* Comment */
.listingblock .pygments .tok-err { border: 1px solid #FF0000 } /* Error */
.listingblock .pygments .tok-k { color: #008000; font-weight: bold } /* Keyword */
@@ -477,7 +486,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</head>
<body class="article toc2 toc-right">
<div id="header">
-<h1>pugixml 1.7 quick start guide</h1>
+<h1>pugixml 1.8 quick start guide</h1>
<div class="details">
<span id="author" class="author">website</span><br>
<span id="email" class="email"><a href="http://pugixml.org" class="bare">http://pugixml.org</a></span><br>
@@ -501,7 +510,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
</div>
<div id="content">
<div class="sect1">
-<h2 id="introduction"><a class="anchor" href="#introduction"></a>Introduction</h2>
+<h2 id="introduction"><a class="anchor" href="#introduction"></a><a class="link" href="#introduction">Introduction</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="http://pugixml.org/">pugixml</a> is a light-weight C&#43;&#43; XML processing library. It consists of a DOM-like interface with rich traversal/modification capabilities, an extremely fast XML parser which constructs the DOM tree from an XML file/buffer, and an XPath 1.0 implementation for complex data-driven tree queries. Full Unicode support is also available, with two Unicode interface variants and conversions between different Unicode encodings (which happen automatically during parsing/saving). The library is extremely portable and easy to integrate and use. pugixml is developed and maintained since 2006 and has many users. All code is distributed under the <a href="#license">MIT license</a>, making it completely free to use in both open-source and proprietary applications.</p>
@@ -527,15 +536,15 @@ No documentation is perfect; neither is this one. If you find errors or omission
</div>
</div>
<div class="sect1">
-<h2 id="install"><a class="anchor" href="#install"></a>Installation</h2>
+<h2 id="install"><a class="anchor" href="#install"></a><a class="link" href="#install">Installation</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>You can download the latest source distribution as an archive:</p>
</div>
<div class="paragraph">
-<p><a href="https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.zip">pugixml-1.7.zip</a> (Windows line endings)
+<p><a href="https://github.com/zeux/pugixml/releases/download/v1.8/pugixml-1.8.zip">pugixml-1.8.zip</a> (Windows line endings)
/
-<a href="https://github.com/zeux/pugixml/releases/download/v1.7/pugixml-1.7.tar.gz">pugixml-1.7.tar.gz</a> (Unix line endings)</p>
+<a href="https://github.com/zeux/pugixml/releases/download/v1.8/pugixml-1.8.tar.gz">pugixml-1.8.tar.gz</a> (Unix line endings)</p>
</div>
<div class="paragraph">
<p>The distribution contains library source, documentation (the guide you&#8217;re reading now and the manual) and some code examples. After downloading the distribution, install pugixml by extracting all files from the compressed archive.</p>
@@ -544,12 +553,12 @@ No documentation is perfect; neither is this one. If you find errors or omission
<p>The complete pugixml source consists of three files - one source file, <code>pugixml.cpp</code>, and two header files, <code>pugixml.hpp</code> and <code>pugiconfig.hpp</code>. <code>pugixml.hpp</code> is the primary header which you need to include in order to use pugixml classes/functions. The rest of this guide assumes that <code>pugixml.hpp</code> is either in the current directory or in one of include directories of your projects, so that <code>#include "pugixml.hpp"</code> can find the header; however you can also use relative path (i.e. <code>#include "../libs/pugixml/src/pugixml.hpp"</code>) or include directory-relative path (i.e. <code>#include &lt;xml/thirdparty/pugixml/src/pugixml.hpp&gt;</code>).</p>
</div>
<div class="paragraph">
-<p>The easiest way to build pugixml is to compile the source file, <code>pugixml.cpp</code>, along with the existing library/executable. This process depends on the method of building your application; for example, if you&#8217;re using Microsoft Visual Studio <span class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnote_1" title="View footnote.">1</a>]</span>, Apple Xcode, Code::Blocks or any other IDE, just add <code>pugixml.cpp</code> to one of your projects. There are other building methods available, including building pugixml as a standalone static/shared library; <a href="manual/install.html#install.building">read the manual</a> for further information.</p>
+<p>The easiest way to build pugixml is to compile the source file, <code>pugixml.cpp</code>, along with the existing library/executable. This process depends on the method of building your application; for example, if you&#8217;re using Microsoft Visual Studio <sup class="footnote">[<a id="_footnoteref_1" class="footnote" href="#_footnote_1" title="View footnote.">1</a>]</sup>, Apple Xcode, Code::Blocks or any other IDE, just add <code>pugixml.cpp</code> to one of your projects. There are other building methods available, including building pugixml as a standalone static/shared library; <a href="manual.html#install.building">read the manual</a> for further information.</p>
</div>
</div>
</div>
<div class="sect1">
-<h2 id="dom"><a class="anchor" href="#dom"></a>Document object model</h2>
+<h2 id="dom"><a class="anchor" href="#dom"></a><a class="link" href="#dom">Document object model</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>pugixml stores XML data in DOM-like way: the entire XML document (both document structure and element data) is stored in memory as a tree. The tree can be loaded from character stream (file, string, C&#43;&#43; I/O stream), then traversed via special API or XPath expressions. The whole tree is mutable: both node structure and node/attribute data can be changed at any time. Finally, the result of document transformations can be saved to a character stream (file, C&#43;&#43; I/O stream or custom transport).</p>
@@ -606,7 +615,7 @@ All pugixml classes and functions are located in <code>pugi</code> namespace; yo
</div>
</div>
<div class="sect1">
-<h2 id="loading"><a class="anchor" href="#loading"></a>Loading document</h2>
+<h2 id="loading"><a class="anchor" href="#loading"></a><a class="link" href="#loading">Loading document</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>pugixml provides several functions for loading XML data from various places - files, C&#43;&#43; iostreams, memory buffers. All functions use an extremely fast non-validating parser. This parser is not fully W3C conformant - it can load any valid XML document, but does not perform some well-formedness checks. While considerable effort is made to reject invalid XML documents, some validation is not performed because of performance reasons. XML data is always converted to internal character format before parsing. pugixml supports all popular Unicode encodings (UTF-8, UTF-16 (big and little endian), UTF-32 (big and little endian); UCS-2 is naturally supported since it&#8217;s a strict subset of UTF-16) and handles all encoding conversions automatically.</p>
@@ -692,7 +701,7 @@ All pugixml classes and functions are located in <code>pugi</code> namespace; yo
</div>
</div>
<div class="sect1">
-<h2 id="access"><a class="anchor" href="#access"></a>Accessing document data</h2>
+<h2 id="access"><a class="anchor" href="#access"></a><a class="link" href="#access">Accessing document data</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>pugixml features an extensive interface for getting various types of data from the document and for traversing the document. You can use various accessors to get node/attribute data, you can traverse the child node/attribute lists via accessors or iterators, you can do depth-first traversals with <code>xml_tree_walker</code> objects, and you can use XPath for complex data-driven queries.</p>
@@ -847,7 +856,7 @@ XPath functions throw <code>xpath_exception</code> objects on error; the sample
</div>
</div>
<div class="sect1">
-<h2 id="modify"><a class="anchor" href="#modify"></a>Modifying document data</h2>
+<h2 id="modify"><a class="anchor" href="#modify"></a><a class="link" href="#modify">Modifying document data</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>The document in pugixml is fully mutable: you can completely change the document structure and modify the data of nodes/attributes. All functions take care of memory management and structural integrity themselves, so they always result in structurally valid tree - however, it is possible to create an invalid XML tree (for example, by adding two attributes with the same name or by setting attribute/node name to empty/invalid string). Tree modification is optimized for performance and for memory consumption, so if you have enough memory you can create documents from scratch with pugixml and later save them to file/stream instead of relying on error-prone manual text writing and without too much overhead.</p>
@@ -951,7 +960,7 @@ XPath functions throw <code>xpath_exception</code> objects on error; the sample
</div>
</div>
<div class="sect1">
-<h2 id="saving"><a class="anchor" href="#saving"></a>Saving document</h2>
+<h2 id="saving"><a class="anchor" href="#saving"></a><a class="link" href="#saving">Saving document</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>Often after creating a new document or loading the existing one and processing it, it is necessary to save the result back to file. Also it is occasionally useful to output the whole document or a subtree to some stream; use cases include debug printing, serialization via network or other text-oriented medium, etc. pugixml provides several functions to output any subtree of the document to a file, stream or another generic transport interface; these functions allow to customize the output format, and also perform necessary encoding conversions.</p>
@@ -1006,7 +1015,7 @@ XPath functions throw <code>xpath_exception</code> objects on error; the sample
</div>
</div>
<div class="sect1">
-<h2 id="feedback"><a class="anchor" href="#feedback"></a>Feedback</h2>
+<h2 id="feedback"><a class="anchor" href="#feedback"></a><a class="link" href="#feedback">Feedback</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>If you believe you&#8217;ve found a bug in pugixml, please file an issue via <a href="https://github.com/zeux/pugixml/issues/new">issue submission form</a>. Be sure to include the relevant information so that the bug can be reproduced: the version of pugixml, compiler version and target architecture, the code that uses pugixml and exhibits the bug, etc. Feature requests and contributions can be filed as issues, too.</p>
@@ -1017,14 +1026,14 @@ XPath functions throw <code>xpath_exception</code> objects on error; the sample
</div>
</div>
<div class="sect1">
-<h2 id="license"><a class="anchor" href="#license"></a>License</h2>
+<h2 id="license"><a class="anchor" href="#license"></a><a class="link" href="#license">License</a></h2>
<div class="sectionbody">
<div class="paragraph">
<p>The pugixml library is distributed under the MIT license:</p>
</div>
<div class="literalblock">
<div class="content">
-<pre>Copyright (c) 2006-2015 Arseny Kapoulkine
+<pre>Copyright (c) 2006-2016 Arseny Kapoulkine
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -1054,7 +1063,7 @@ OTHER DEALINGS IN THE SOFTWARE.</pre>
<div class="literalblock">
<div class="content">
<pre>This software is based on pugixml library (http://pugixml.org).
-pugixml is Copyright (C) 2006-2015 Arseny Kapoulkine.</pre>
+pugixml is Copyright (C) 2006-2016 Arseny Kapoulkine.</pre>
</div>
</div>
</div>
@@ -1068,7 +1077,7 @@ pugixml is Copyright (C) 2006-2015 Arseny Kapoulkine.</pre>
</div>
<div id="footer">
<div id="footer-text">
-Last updated 2015-10-10 13:43:12 PDT
+Last updated 2016-11-24 00:20:49 STD
</div>
</div>
</body>
diff --git a/docs/samples/include.cpp b/docs/samples/include.cpp
index 39830c5..84f9dd0 100644
--- a/docs/samples/include.cpp
+++ b/docs/samples/include.cpp
@@ -48,7 +48,7 @@ bool preprocess(pugi::xml_node node)
bool load_preprocess(pugi::xml_document& doc, const char* path)
{
pugi::xml_parse_result result = doc.load_file(path, pugi::parse_default | pugi::parse_pi); // for <?include?>
-
+
return result ? preprocess(doc) : false;
}
// end::code[]
diff --git a/docs/samples/save_declaration.cpp b/docs/samples/save_declaration.cpp
index 7ca1e07..ca98dcb 100644
--- a/docs/samples/save_declaration.cpp
+++ b/docs/samples/save_declaration.cpp
@@ -15,7 +15,7 @@ int main()
decl.append_attribute("encoding") = "UTF-8";
decl.append_attribute("standalone") = "no";
- // <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+ // <?xml version="1.0" encoding="UTF-8" standalone="no"?>
// <foo bar="baz">
// <call>hey</call>
// </foo>