From ec7777efd551620e8af9cadb78ae76808dfb98a9 Mon Sep 17 00:00:00 2001 From: "Lee Thomason (grinliz)" Date: Sun, 26 Feb 2012 20:51:27 -0800 Subject: [PATCH] added whitespace description --- readme.txt | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/readme.txt b/readme.txt index 0599f07..1291a70 100755 --- a/readme.txt +++ b/readme.txt @@ -96,6 +96,45 @@ be created by calling the appropriate XMLDocument::NewElement, NewText, etc. method. Although you have pointers to these objects, they are still owned by the Document. When the Document is deleted, so are all the nodes it contains. +

White Space

+ +Microsoft has an excellent article on white space: http://msdn.microsoft.com/en-us/library/ms256097.aspx + +TinyXML-2 preserves white space in a (hopefully) sane way that is almost complient with the spec. +(TinyXML-1 used a completely outdated model.) + +As a first step, all newlines / carriage-returns / line-feeds are normalized to a +line-feed character, as required by the XML spec. + +White space in text is preserved. For example: +@verbatim + Hello, World +@endverbatim + +The leading space before the "Hello" and the double space after the comma are preserved. +Line-feeds are preserved, as in this example: + +@verbatim + Hello again, + World +@endverbatim + +However, white space between elements is *not* preserved. Although not strictly compliant, +tracking and reporting inta-element space is awkward, and not normally valuable. TinyXML-2 +sees these as the same XML: + +@verbatim + +1 +2 +3 + +@endverbatim + +@verbatim +123 +@endverbatim +

Entities

TinyXML-2 recognizes the pre-defined "character entities", meaning special characters. Namely: