Skip to content
Snippets Groups Projects
manual.html 534 KiB
Newer Older
<li>
<p>Consecutive text nodes sharing the same parent are not merged, i.e. in <code>&lt;node&gt;text1 &lt;![CDATA[data]]&gt; text2&lt;/node&gt;</code> node should have one text node child, but instead has three.</p>
</li>
<li>
<p>Since the document type declaration is not used for parsing, <code>id()</code> function always returns an empty node set.</p>
</li>
<li>
<p>Namespace nodes are not supported (affects <code>namespace::</code> axis).</p>
</li>
<li>
<p>Name tests are performed on QNames in XML document instead of expanded names; for <code>&lt;foo xmlns:ns1='uri' xmlns:ns2='uri'&gt;&lt;ns1:child/&gt;&lt;ns2:child/&gt;&lt;/foo&gt;</code>, query <code>foo/ns1:*</code> will return only the first child, not both of them. Compliant XPath implementations can return both nodes if the user provides appropriate namespace declarations.</p>
</li>
<li>
<p>String functions consider a character to be either a single <code>char</code> value or a single <code>wchar_t</code> value, depending on the library configuration; this means that some string functions are not fully Unicode-aware. This affects <code>substring()</code>, <code>string-length()</code> and <code>translate()</code> functions.</p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="changes"><a class="anchor" href="#changes"></a>9. Changelog</h2>
<div class="sectionbody">
<div class="sect2">
<h3 id="v1.6"><a class="anchor" href="#v1.6"></a>v1.6 <sup>10.04.2015</sup></h3>
4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000
<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>Attribute/text values now use more digits when printing floating point numbers to guarantee round-tripping.</p>
</li>
<li>
<p>Text nodes no longer get extra surrounding whitespace when pretty-printing nodes with mixed contents</p>
</li>
</ol>
</div>
</li>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed translate and normalize-space XPath functions to no longer return internal NUL characters</p>
</li>
<li>
<p>Fixed buffer overrun on malformed comments inside DOCTYPE sections</p>
</li>
<li>
<p>DOCTYPE parsing can no longer run out of stack space on malformed inputs (XML parsing is now using bounded stack space)</p>
</li>
<li>
<p>Adjusted processing instruction output to avoid malformed documents if the PI value contains <code>?&gt;</code></p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v1.5"><a class="anchor" href="#v1.5"></a>v1.5 <sup>27.11.2014</sup></h3>
<div class="paragraph">
<p>Major release, featuring a lot of performance improvements and some new features.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Specification changes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><code>xml_document::load(const char_t*)</code> was renamed to <code>load_string</code>; the old method is still available and will be deprecated in a future release</p>
</li>
<li>
<p><code>xml_node::select_single_node</code> was renamed to <code>select_node</code>; the old method is still available and will be deprecated in a future release.</p>
</li>
</ol>
</div>
</li>
<li>
<p>New features:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Added <code>xml_node::append_move</code> and other functions for moving nodes within a document</p>
</li>
<li>
<p>Added <code>xpath_query::evaluate_node</code> for evaluating queries with a single node as a result</p>
</li>
</ol>
</div>
</li>
<li>
<p>Performance improvements:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Optimized XML parsing (10-40% faster with clang/gcc, up to 10% faster with MSVC)</p>
</li>
<li>
<p>Optimized memory consumption when copying nodes in the same document (string contents is now shared)</p>
</li>
<li>
<p>Optimized node copying (10% faster for cross-document copies, 3x faster for inter-document copies; also it now consumes a constant amount of stack space)</p>
</li>
<li>
<p>Optimized node output (60% faster; also it now consumes a constant amount of stack space)</p>
</li>
<li>
<p>Optimized XPath allocation (query evaluation now results in fewer temporary allocations)</p>
</li>
<li>
<p>Optimized XPath sorting (node set sorting is 2-3x faster in some cases)</p>
</li>
<li>
<p>Optimized XPath evaluation (XPathMark suite is 100x faster; some commonly used queries are 3-4x faster)</p>
</li>
</ol>
</div>
</li>
<li>
<p>Compatibility improvements:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed <code>xml_node::offset_debug</code> for corner cases</p>
</li>
<li>
<p>Fixed undefined behavior while calling memcpy in some cases</p>
</li>
<li>
<p>Fixed MSVC 2015 compilation warnings</p>
</li>
<li>
<p>Fixed <code>contrib/foreach.hpp</code> for Boost 1.56.0</p>
</li>
</ol>
</div>
</li>
<li>
<p>Bug fixes</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Adjusted comment output to avoid malformed documents if the comment value contains <code>--</code></p>
</li>
<li>
<p>Fix XPath sorting for documents that were constructed using append_buffer</p>
</li>
<li>
<p>Fix <code>load_file</code> for wide-character paths with non-ASCII characters in MinGW with C&#43;&#43;11 mode enabled</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v1.4"><a class="anchor" href="#v1.4"></a>v1.4 <sup>27.02.2014</sup></h3>
<div class="paragraph">
<p>Major release, featuring various new features, bug fixes and compatibility improvements.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Specification changes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Documents without element nodes are now rejected with <code>status_no_document_element</code> error, unless <code>parse_fragment</code> option is used</p>
</li>
</ol>
</div>
</li>
<li>
<p>New features:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Added XML fragment parsing (<code>parse_fragment</code> flag)</p>
</li>
<li>
<p>Added PCDATA whitespace trimming (<code>parse_trim_pcdata</code> flag)</p>
</li>
<li>
<p>Added long long support for <code>xml_attribute</code> and <code>xml_text</code> (<code>as_llong</code>, <code>as_ullong</code> and <code>set_value</code>/<code>set</code> overloads)</p>
</li>
<li>
<p>Added hexadecimal integer parsing support for <code>as_int</code>/<code>as_uint</code>/<code>as_llong</code>/<code>as_ullong</code></p>
</li>
<li>
<p>Added <code>xml_node::append_buffer</code> to improve performance of assembling documents from fragments</p>
</li>
<li>
<p><code>xml_named_node_iterator</code> is now bidirectional</p>
</li>
<li>
<p>Reduced XPath stack consumption during compilation and evaluation (useful for embedded systems)</p>
</li>
</ol>
</div>
</li>
<li>
<p>Compatibility improvements:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Improved support for platforms without wchar_t support</p>
</li>
<li>
<p>Fixed several false positives in clang static analysis</p>
</li>
<li>
<p>Fixed several compilation warnings for various GCC versions</p>
</li>
</ol>
</div>
</li>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed undefined pointer arithmetic in XPath implementation</p>
</li>
<li>
<p>Fixed non-seekable iostream support for certain stream types, i.e. Boost <code>file_source</code> with pipe input</p>
</li>
<li>
<p>Fixed <code>xpath_query::return_type</code> for some expressions</p>
</li>
<li>
<p>Fixed dllexport issues with <code>xml_named_node_iterator</code></p>
</li>
<li>
<p>Fixed <code>find_child_by_attribute</code> assertion for attributes with null name/value</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v1.2"><a class="anchor" href="#v1.2"></a>v1.2 <sup>1.05.2012</sup></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>
<div class="ulist">
<ul>
<li>
<p>New features:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Added <code>xml_text</code> helper class for working with PCDATA/CDATA contents of an element node</p>
</li>
<li>
<p>Added optional header-only mode (controlled by <code>PUGIXML_HEADER_ONLY</code> define)</p>
</li>
<li>
<p>Added <code>xml_node::children()</code> and <code>xml_node::attributes()</code> for C&#43;&#43;11 ranged for loop or <code>BOOST_FOREACH</code></p>
</li>
<li>
<p>Added support for Latin-1 (ISO-8859-1) encoding conversion during loading and saving</p>
</li>
<li>
<p>Added custom default values for <code>xml_attribute::as_*</code> (they are returned if the attribute does not exist)</p>
</li>
<li>
<p>Added <code>parse_ws_pcdata_single</code> flag for preserving whitespace-only PCDATA in case it&#8217;s the only child</p>
</li>
<li>
<p>Added <code>format_save_file_text</code> for <code>xml_document::save_file</code> to open files as text instead of binary (changes newlines on Windows)</p>
</li>
<li>
<p>Added <code>format_no_escapes</code> flag to disable special symbol escaping (complements <code>~parse_escapes</code>)</p>
</li>
<li>
<p>Added support for loading document from streams that do not support seeking</p>
</li>
<li>
<p>Added <code>PUGIXML_MEMORY_*</code> constants for tweaking allocation behavior (useful for embedded systems)</p>
</li>
<li>
<p>Added <code>PUGIXML_VERSION</code> preprocessor define</p>
</li>
</ol>
</div>
</li>
<li>
<p>Compatibility improvements:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Parser does not require setjmp support (improves compatibility with some embedded platforms, enables <code>/clr:pure</code> compilation)</p>
</li>
<li>
<p>STL forward declarations are no longer used (fixes SunCC/RWSTL compilation, fixes clang compilation in C&#43;&#43;11 mode)</p>
</li>
<li>
<p>Fixed AirPlay SDK, Android, Windows Mobile (WinCE) and C&#43;&#43;/CLI compilation</p>
</li>
<li>
<p>Fixed several compilation warnings for various GCC versions, Intel C&#43;&#43; compiler and Clang</p>
</li>
</ol>
</div>
</li>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed unsafe bool conversion to avoid problems on C&#43;&#43;/CLI</p>
</li>
<li>
<p>Iterator dereference operator is const now (fixes Boost <code>filter_iterator</code> support)</p>
</li>
<li>
<p><code>xml_document::save_file</code> now checks for file I/O errors during saving</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v1.0"><a class="anchor" href="#v1.0"></a>v1.0 <sup>1.11.2010</sup></h3>
<div class="paragraph">
<p>Major release, featuring many XPath enhancements, wide character filename support, miscellaneous performance improvements, bug fixes and more.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>XPath:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>XPath implementation is moved to <code>pugixml.cpp</code> (which is the only source file now); use <code>PUGIXML_NO_XPATH</code> if you want to disable XPath to reduce code size</p>
</li>
<li>
<p>XPath is now supported without exceptions (<code>PUGIXML_NO_EXCEPTIONS</code>); the error handling mechanism depends on the presence of exception support</p>
</li>
<li>
<p>XPath is now supported without STL (<code>PUGIXML_NO_STL</code>)</p>
</li>
<li>
<p>Introduced variable support</p>
</li>
<li>
<p>Introduced new <code>xpath_query::evaluate_string</code>, which works without STL</p>
</li>
<li>
<p>Introduced new <code>xpath_node_set</code> constructor (from an iterator range)</p>
</li>
<li>
<p>Evaluation function now accept attribute context nodes</p>
</li>
<li>
<p>All internal allocations use custom allocation functions</p>
</li>
<li>
<p>Improved error reporting; now a last parsed offset is returned together with the parsing error</p>
</li>
</ol>
</div>
</li>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed memory leak for loading from streams with stream exceptions turned on</p>
</li>
<li>
<p>Fixed custom deallocation function calling with null pointer in one case</p>
</li>
<li>
<p>Fixed missing attributes for iterator category functions; all functions/classes can now be DLL-exported</p>
</li>
<li>
<p>Worked around Digital Mars compiler bug, which lead to minor read overfetches in several functions</p>
</li>
<li>
<p><code>load_file</code> now works with 2+ Gb files in MSVC/MinGW</p>
</li>
<li>
<p>XPath: fixed memory leaks for incorrect queries</p>
</li>
<li>
<p>XPath: fixed <code>xpath_node()</code> attribute constructor with empty attribute argument</p>
</li>
<li>
<p>XPath: fixed <code>lang()</code> function for non-ASCII arguments</p>
</li>
</ol>
</div>
</li>
<li>
<p>Specification changes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>CDATA nodes containing <code>]]&gt;</code> are printed as several nodes; while this changes the internal structure, this is the only way to escape CDATA contents</p>
</li>
<li>
<p>Memory allocation errors during parsing now preserve last parsed offset (to give an idea about parsing progress)</p>
</li>
<li>
<p>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)</p>
</li>
</ol>
</div>
</li>
<li>
<p>Additional functionality:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Added <code>xml_parse_result</code> default constructor</p>
</li>
<li>
<p>Added <code>xml_document::load_file</code> and <code>xml_document::save_file</code> with wide character paths</p>
</li>
<li>
<p>Added <code>as_utf8</code> and <code>as_wide</code> overloads for <code>std::wstring</code>/<code>std::string</code> arguments</p>
</li>
<li>
<p>Added DOCTYPE node type (<code>node_doctype</code>) and a special parse flag, <code>parse_doctype</code>, to add such nodes to the document during parsing</p>
</li>
<li>
<p>Added <code>parse_full</code> parse flag mask, which extends <code>parse_default</code> with all node type parsing flags except <code>parse_ws_pcdata</code></p>
</li>
<li>
<p>Added <code>xml_node::hash_value()</code> and <code>xml_attribute::hash_value()</code> functions for use in hash-based containers</p>
</li>
<li>
<p>Added <code>internal_object()</code> and additional constructor for both <code>xml_node</code> and <code>xml_attribute</code> for easier marshalling (useful for language bindings)</p>
</li>
<li>
<p>Added <code>xml_document::document_element()</code> function</p>
</li>
<li>
<p>Added <code>xml_node::prepend_attribute</code>, <code>xml_node::prepend_child</code> and <code>xml_node::prepend_copy</code> functions</p>
</li>
<li>
<p>Added <code>xml_node::append_child</code>, <code>xml_node::prepend_child</code>, <code>xml_node::insert_child_before</code> and <code>xml_node::insert_child_after</code> overloads for element nodes (with name instead of type)</p>
</li>
<li>
<p>Added <code>xml_document::reset()</code> function</p>
</li>
</ol>
</div>
</li>
<li>
<p>Performance improvements:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><code>xml_node::root()</code> and <code>xml_node::offset_debug()</code> are now O(1) instead of O(logN)</p>
</li>
<li>
<p>Minor parsing optimizations</p>
</li>
<li>
<p>Minor memory optimization for strings in DOM tree (<code>set_name</code>/<code>set_value</code>)</p>
</li>
<li>
<p>Memory optimization for string memory reclaiming in DOM tree (<code>set_name</code>/<code>set_value</code> now reallocate the buffer if memory waste is too big)</p>
</li>
<li>
<p>XPath: optimized document order sorting</p>
</li>
<li>
<p>XPath: optimized child/attribute axis step</p>
</li>
<li>
<p>XPath: optimized number-to-string conversions in MSVC</p>
</li>
<li>
<p>XPath: optimized concat for many arguments</p>
</li>
<li>
<p>XPath: optimized evaluation allocation mechanism: constant and document strings are not heap-allocated</p>
</li>
<li>
<p>XPath: optimized evaluation allocation mechanism: all temporaries' allocations use fast stack-like allocator</p>
</li>
</ol>
</div>
</li>
<li>
<p>Compatibility:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Removed wildcard functions (<code>xml_node::child_w</code>, <code>xml_node::attribute_w</code>, etc.)</p>
</li>
<li>
<p>Removed <code>xml_node::all_elements_by_name</code></p>
</li>
<li>
<p>Removed <code>xpath_type_t</code> enumeration; use <code>xpath_value_type</code> instead</p>
</li>
<li>
<p>Removed <code>format_write_bom_utf8</code> enumeration; use <code>format_write_bom</code> instead</p>
</li>
<li>
<p>Removed <code>xml_document::precompute_document_order</code>, <code>xml_attribute::document_order</code> and <code>xml_node::document_order</code> functions; document order sort optimization is now automatic</p>
</li>
<li>
<p>Removed <code>xml_document::parse</code> functions and <code>transfer_ownership</code> struct; use <code>xml_document::load_buffer_inplace</code> and <code>xml_document::load_buffer_inplace_own</code> instead</p>
</li>
<li>
<p>Removed <code>as_utf16</code> function; use <code>as_wide</code> instead</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v0.9"><a class="anchor" href="#v0.9"></a>v0.9 <sup>1.07.2010</sup></h3>
<div class="paragraph">
<p>Major release, featuring extended and improved Unicode support, miscellaneous performance improvements, bug fixes and more.</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Major Unicode improvements:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Introduced encoding support (automatic/manual encoding detection on load, manual encoding selection on save, conversion from/to UTF8, UTF16 LE/BE, UTF32 LE/BE)</p>
</li>
<li>
<p>Introduced <code>wchar_t</code> mode (you can set <code>PUGIXML_WCHAR_MODE</code> define to switch pugixml internal encoding from UTF8 to <code>wchar_t</code>; all functions are switched to their Unicode variants)</p>
</li>
<li>
<p>Load/save functions now support wide streams</p>
</li>
</ol>
</div>
</li>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed document corruption on failed parsing bug</p>
</li>
<li>
<p>XPath string/number conversion improvements (increased precision, fixed crash for huge numbers)</p>
</li>
<li>
<p>Improved DOCTYPE parsing: now parser recognizes all well-formed DOCTYPE declarations</p>
</li>
<li>
<p>Fixed <code>xml_attribute::as_uint()</code> for large numbers (i.e. 2<sup>32</sup>-1)</p>
</li>
<li>
<p>Fixed <code>xml_node::first_element_by_path</code> for path components that are prefixes of node names, but are not exactly equal to them.</p>
</li>
</ol>
</div>
</li>
<li>
<p>Specification changes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><code>parse()</code> API changed to <code>load_buffer</code>/<code>load_buffer_inplace</code>/<code>load_buffer_inplace_own</code>; <code>load_buffer</code> APIs do not require zero-terminated strings.</p>
</li>
<li>
<p>Renamed <code>as_utf16</code> to <code>as_wide</code></p>
</li>
<li>
<p>Changed <code>xml_node::offset_debug</code> return type and <code>xml_parse_result::offset</code> type to <code>ptrdiff_t</code></p>
</li>
<li>
<p>Nodes/attributes with empty names are now printed as <code>:anonymous</code></p>
</li>
</ol>
</div>
</li>
<li>
<p>Performance improvements:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Optimized document parsing and saving</p>
</li>
<li>
<p>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</p>
</li>
<li>
<p>Optimized memory consumption: <code>sizeof(xml_node_struct)</code> reduced from 40 bytes to 32 bytes on x86</p>
</li>
<li>
<p>Optimized debug mode parsing/saving by order of magnitude</p>
</li>
</ol>
</div>
</li>
<li>
<p>Miscellaneous:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>All STL includes except <code>&lt;exception&gt;</code> in <code>pugixml.hpp</code> are replaced with forward declarations</p>
</li>
<li>
<p><code>xml_node::remove_child</code> and <code>xml_node::remove_attribute</code> now return the operation result</p>
</li>
</ol>
</div>
</li>
<li>
<p>Compatibility:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><code>parse()</code> and <code>as_utf16</code> are left for compatibility (these functions are deprecated and will be removed in version 1.0)</p>
</li>
<li>
<p>Wildcard functions, <code>document_order</code>/<code>precompute_document_order</code> functions, <code>all_elements_by_name</code> function and <code>format_write_bom_utf8</code> flag are deprecated and will be removed in version 1.0</p>
</li>
<li>
<p><code>xpath_type_t</code> enumeration was renamed to <code>xpath_value_type</code>; <code>xpath_type_t</code> is deprecated and will be removed in version 1.0</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v0.5"><a class="anchor" href="#v0.5"></a>v0.5 <sup>8.11.2009</sup></h3>
<div class="paragraph">
<p>Major bugfix release. Changes:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>XPath bugfixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed <code>translate()</code>, <code>lang()</code> and <code>concat()</code> functions (infinite loops/crashes)</p>
</li>
<li>
<p>Fixed compilation of queries with empty literal strings (<code>""</code>)</p>
</li>
<li>
<p>Fixed axis tests: they never add empty nodes/attributes to the resulting node set now</p>
</li>
<li>
<p>Fixed string-value evaluation for node-set (the result excluded some text descendants)</p>
</li>
<li>
<p>Fixed <code>self::</code> axis (it behaved like <code>ancestor-or-self::</code>)</p>
</li>
<li>
<p>Fixed <code>following::</code> and <code>preceding::</code> axes (they included descendent and ancestor nodes, respectively)</p>
</li>
<li>
<p>Minor fix for <code>namespace-uri()</code> function (namespace declaration scope includes the parent element of namespace declaration attribute)</p>
</li>
<li>
<p>Some incorrect queries are no longer parsed now (i.e. <code>foo: *</code>)</p>
</li>
<li>
<p>Fixed <code>text()</code>/etc. node test parsing bug (i.e. <code>foo[text()]</code> failed to compile)</p>
</li>
<li>
<p>Fixed root step (<code>/</code>) - it now selects empty node set if query is evaluated on empty node</p>
</li>
<li>
<p>Fixed string to number conversion (<code>"123 "</code> converted to NaN, <code>"123 .456"</code> converted to 123.456 - now the results are 123 and NaN, respectively)</p>
</li>
<li>
<p>Node set copying now preserves sorted type; leads to better performance on some queries</p>
</li>
</ol>
</div>
</li>
<li>
<p>Miscellaneous bugfixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed <code>xml_node::offset_debug</code> for PI nodes</p>
</li>
<li>
<p>Added empty attribute checks to <code>xml_node::remove_attribute</code></p>
</li>
<li>
<p>Fixed <code>node_pi</code> and <code>node_declaration</code> copying</p>
</li>
<li>
<p>Const-correctness fixes</p>
</li>
</ol>
</div>
</li>
<li>
<p>Specification changes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p><code>xpath_node::select_nodes()</code> and related functions now throw exception if expression return type is not node set (instead of assertion)</p>
</li>
<li>
<p><code>xml_node::traverse()</code> now sets depth to -1 for both <code>begin()</code> and <code>end()</code> callbacks (was 0 at <code>begin()</code> and -1 at <code>end()</code>)</p>
</li>
<li>
<p>In case of non-raw node printing a newline is output after PCDATA inside nodes if the PCDATA has siblings</p>
</li>
<li>
<p>UTF8 &#8594; <code>wchar_t</code> conversion now considers 5-byte UTF8-like sequences as invalid</p>
</li>
</ol>
</div>
</li>
<li>
<p>New features:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Added <code>xpath_node_set::operator[]</code> for index-based iteration</p>
</li>
<li>
<p>Added <code>xpath_query::return_type()</code></p>
</li>
<li>
<p>Added getter accessors for memory-management functions</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v0.42"><a class="anchor" href="#v0.42"></a>v0.42 <sup>17.09.2009</sup></h3>
<div class="paragraph">
<p>Maintenance release. Changes:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed deallocation in case of custom allocation functions or if <code>delete[]</code> / <code>free</code> are incompatible</p>
</li>
<li>
<p>XPath parser fixed for incorrect queries (i.e. incorrect XPath queries should now always fail to compile)</p>
</li>
<li>
<p>Const-correctness fixes for <code>find_child_by_attribute</code></p>
</li>
<li>
<p>Improved compatibility (miscellaneous warning fixes, fixed <code>&lt;cstring&gt;</code> include dependency for GCC)</p>
</li>
<li>
<p>Fixed iterator begin/end and print function to work correctly for empty nodes</p>
</li>
</ol>
</div>
</li>
<li>
<p>New features:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Added <code>PUGIXML_API</code>/<code>PUGIXML_CLASS</code>/<code>PUGIXML_FUNCTION</code> configuration macros to control class/function attributes</p>
</li>
<li>
<p>Added <code>xml_attribute::set_value</code> overloads for different types</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v0.41"><a class="anchor" href="#v0.41"></a>v0.41 <sup>8.02.2009</sup></h3>
<div class="paragraph">
<p>Maintenance release. Changes:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed bug with node printing (occasionally some content was not written to output stream)</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v0.4"><a class="anchor" href="#v0.4"></a>v0.4 <sup>18.01.2009</sup></h3>
<div class="paragraph">
<p>Changes:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Documentation fix in samples for <code>parse()</code> with manual lifetime control</p>
</li>
<li>
<p>Fixed document order sorting in XPath (it caused wrong order of nodes after <code>xpath_node_set::sort</code> and wrong results of some XPath queries)</p>
</li>
</ol>
</div>
</li>
<li>
<p>Node printing changes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Single quotes are no longer escaped when printing nodes</p>
</li>
<li>
<p>Symbols in second half of ASCII table are no longer escaped when printing nodes; because of this, <code>format_utf8</code> flag is deleted as it&#8217;s no longer needed and <code>format_write_bom</code> is renamed to <code>format_write_bom_utf8</code>.</p>
</li>
<li>
<p>Reworked node printing - now it works via <code>xml_writer</code> interface; implementations for <code>FILE*</code> and <code>std::ostream</code> are available. As a side-effect, <code>xml_document::save_file</code> now works without STL.</p>
</li>
</ol>
</div>
</li>
<li>
<p>New features:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Added unsigned integer support for attributes (<code>xml_attribute::as_uint</code>, <code>xml_attribute::operator=</code>)</p>
</li>
<li>
<p>Now document declaration (<code>&lt;?xml &#8230;&#8203;?&gt;</code>) is parsed as node with type <code>node_declaration</code> when <code>parse_declaration</code> flag is specified (access to encoding/version is performed as if they were attributes, i.e. <code>doc.child("xml").attribute("version").as_float()</code>); corresponding flags for node printing were also added</p>
</li>
<li>
<p>Added support for custom memory management (see <code>set_memory_management_functions</code> for details)</p>
</li>
<li>
<p>Implemented node/attribute copying (see <code>xml_node::insert_copy_*</code> and <code>xml_node::append_copy</code> for details)</p>
</li>
<li>
<p>Added <code>find_child_by_attribute</code> and <code>find_child_by_attribute_w</code> to simplify parsing code in some cases (i.e. COLLADA files)</p>
</li>
<li>
<p>Added file offset information querying for debugging purposes (now you&#8217;re able to determine exact location of any <code>xml_node</code> in parsed file, see <code>xml_node::offset_debug</code> for details)</p>
</li>
<li>
<p>Improved error handling for parsing - now <code>load()</code>, <code>load_file()</code> and <code>parse()</code> return <code>xml_parse_result</code>, which contains error code and last parsed offset; this does not break old interface as <code>xml_parse_result</code> can be implicitly casted to <code>bool</code>.</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v0.34"><a class="anchor" href="#v0.34"></a>v0.34 <sup>31.10.2007</sup></h3>
<div class="paragraph">
<p>Maintenance release. Changes:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Bug fixes:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Fixed bug with loading from text-mode iostreams</p>
</li>
<li>
<p>Fixed leak when <code>transfer_ownership</code> is true and parsing is failing</p>
</li>
<li>
<p>Fixed bug in saving (<code>\r</code> and <code>\n</code> are now escaped in attribute values)</p>
</li>
<li>
<p>Renamed <code>free()</code> to <code>destroy()</code> - some macro conflicts were reported</p>
</li>
</ol>
</div>
</li>
<li>
<p>New features:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Improved compatibility (supported Digital Mars C&#43;&#43;, MSVC 6, CodeWarrior 8, PGI C&#43;&#43;, Comeau, supported PS3 and XBox360)</p>
</li>
<li>
<p><code>PUGIXML_NO_EXCEPTION</code> flag for platforms without exception handling</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v0.3"><a class="anchor" href="#v0.3"></a>v0.3 <sup>21.02.2007</sup></h3>
<div class="paragraph">
<p>Refactored, reworked and improved version. Changes:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Interface:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Added XPath</p>
</li>
<li>
<p>Added tree modification functions</p>
</li>
<li>
<p>Added no STL compilation mode</p>
</li>
<li>
<p>Added saving document to file</p>
</li>
<li>
<p>Refactored parsing flags</p>
</li>
<li>
<p>Removed <code>xml_parser</code> class in favor of <code>xml_document</code></p>
</li>
<li>
<p>Added transfer ownership parsing mode</p>
</li>
<li>
<p>Modified the way <code>xml_tree_walker</code> works</p>
</li>
<li>
<p>Iterators are now non-constant</p>
</li>
</ol>
</div>
</li>
<li>
<p>Implementation:</p>
<div class="olist arabic">
<ol class="arabic">
<li>
<p>Support of several compilers and platforms</p>
</li>
<li>
<p>Refactored and sped up parsing core</p>
</li>
<li>
<p>Improved standard compliancy</p>
</li>
<li>
<p>Added XPath implementation</p>
</li>
<li>
<p>Fixed several bugs</p>
</li>
</ol>
</div>
</li>
</ul>
</div>
</div>
<div class="sect2">
<h3 id="v0.2"><a class="anchor" href="#v0.2"></a>v0.2 <sup>6.11.2006</sup></h3>
<div class="paragraph">
<p>First public release. Changes:</p>
</div>
<div class="ulist">
<ul>