pugixml 1.0 manual | Overview | Installation | Document: Object model · Loading · Accessing · Modifying · Saving | XPath | API Reference | Table of Contents |

## Changelog

###### 1.11.2010 - version 1.0

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

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

###### 1.07.2010 - version 0.9

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

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

###### 8.11.2009 - version 0.5

Major bugfix release. Changes:

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

###### 17.09.2009 - version 0.42

Maintenance release. Changes:

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

###### 8.02.2009 - version 0.41

Maintenance release. Changes:

- Bug fixes:
  1. Fixed bug with node printing (occasionally some content was not written to output stream)

###### 18.01.2009 - version 0.4

Changes:

- Bug fixes:
  1. Documentation fix in samples for parse() with manual lifetime control
  2. Fixed document order sorting in XPath (it caused wrong order of nodes after xpath_node_set::sort and wrong results of some XPath queries)
- Node printing changes:
  1. Single quotes are no longer escaped when printing nodes
  2. Symbols in second half of ASCII table are no longer escaped when printing nodes; because of this, format_utf8 flag is deleted as it's no longer needed and format_write_bom is renamed to format_write_bom_utf8.
  3. Reworked node printing - now it works via xml_writer interface; implementations for FILE* and std::ostream are available. As a side-effect, xml_document::save_file now works without STL.
- New features:
  1. Added unsigned integer support for attributes (xml_attribute::as_uint, xml_attribute::operator=)
  2. Now document declaration (<?xml ...?>) is parsed as node with type node_declaration when parse_declaration flag is specified (access to encoding/version is performed as if they were attributes, i.e. doc.child("xml").attribute("version").as_float()); corresponding flags for node printing were also added
  3. Added support for custom memory management (see set_memory_management_functions for details)
  4. Implemented node/attribute copying (see xml_node::insert_copy_* and xml_node::append_copy for details)
  5. Added find_child_by_attribute and find_child_by_attribute_w to simplify parsing code in some cases (i.e. COLLADA files)
  6. Added file offset information querying for debugging purposes (now you're able to determine exact location of any xml_node in parsed file, see xml_node::offset_debug for details)
  7. 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.

###### 31.10.2007 - version 0.34

Maintenance release. Changes:

- Bug fixes:
  1. Fixed bug with loading from text-mode iostreams
  2. Fixed leak when transfer_ownership is true and parsing is failing
  3. Fixed bug in saving (\r and \n are now escaped in attribute values)
  4. Renamed free() to destroy() - some macro conflicts were reported
- New features:
  1. Improved compatibility (supported Digital Mars C++, MSVC 6, CodeWarrior 8, PGI C++, Comeau, supported PS3 and XBox360)
  2. PUGIXML_NO_EXCEPTION flag for platforms without exception handling

###### 21.02.2007 - version 0.3

Refactored, reworked and improved version. Changes:

- Interface:
  1. Added XPath
  2. Added tree modification functions
  3. Added no STL compilation mode
  4. Added saving document to file
  5. Refactored parsing flags
  6. Removed xml_parser class in favor of xml_document
  7. Added transfer ownership parsing mode
  8. Modified the way xml_tree_walker works
  9. Iterators are now non-constant
- Implementation:
  1. Support of several compilers and platforms
  2. Refactored and sped up parsing core
  3. Improved standard compliancy
  4. Added XPath implementation
  5. Fixed several bugs

###### 6.11.2006 - version 0.2

First public release. Changes:

- Bug fixes:
  1. Fixed child_value() (for empty nodes)
  2. Fixed xml_parser_impl warning at W4
- New features:
  1. Introduced child_value(name) and child_value_w(name)
  2. parse_eol_pcdata and parse_eol_attribute flags + parse_minimal optimizations
  3. Optimizations of strconv_t

###### 15.07.2006 - version 0.1

First private release for testing purposes

pugixml 1.0 manual | Overview | Installation | Document: Object model · Loading · Accessing · Modifying · Saving | XPath | API Reference | Table of Contents |