diff --git a/readme.txt b/readme.md old mode 100755 new mode 100644 similarity index 85% rename from readme.txt rename to readme.md index 29226f7..2727c70 --- a/readme.txt +++ b/readme.md @@ -1,19 +1,19 @@ -/** @mainpage - -

TinyXML-2

+TinyXML-2 +========= TinyXML is a simple, small, efficient, C++ XML parser that can be easily integrated into other programs. The master is hosted on github: -github.com/leethomason/tinyxml2 +https://github.com/leethomason/tinyxml2 The online HTML version of these docs: http://grinninglizard.com/tinyxml2docs/index.html Examples are in the "related pages" tab of the HTML docs. -

What it does.

+What it does. +------------- In brief, TinyXML parses an XML document, and builds from that a Document Object Model (DOM) that can be read, modified, and saved. @@ -45,7 +45,8 @@ TinyXML-2 attempts to be a flexible parser, but with truly correct and compliant XML output. TinyXML-2 should compile on any reasonably C++ compliant system. It does not rely on exceptions, RTTI, or the STL. -

What it doesn't do.

+What it doesn’t do. +------------------- TinyXML-2 doesn't parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) There are other parsers out there @@ -55,7 +56,8 @@ your project, have a higher learning curve, and often have a more restrictive license. If you are working with browsers or have more complete XML needs, TinyXML-2 is not the parser for you. -

TinyXML-1 vs. TinyXML-2

+TinyXML-1 vs. TinyXML-2 +----------------------- Which should you use? TinyXML-2 uses a similar API to TinyXML-1 and the same rich test cases. But the implementation of the parser is completely re-written @@ -67,31 +69,30 @@ strings are query and set as 'const char*'. This allows the use of internal allocators, and keeps the code much simpler. Both parsers: -
    -
  1. Simple to use with similar APIs.
  2. -
  3. DOM based parser.
  4. -
  5. UTF-8 Unicode support. http://en.wikipedia.org/wiki/UTF-8
  6. -
+ +1. Simple to use with similar APIs. +2. DOM based parser. +3. UTF-8 Unicode support. http://en.wikipedia.org/wiki/UTF-8 Advantages of TinyXML-2 -
    -
  1. The focus of all future dev.
  2. -
  3. Many fewer memory allocation (1/10th to 1/100th), uses less memory (about 40% of TinyXML-1), and faster.
  4. -
  5. No STL requirement.
  6. -
  7. More modern C++, including a proper namespace.
  8. -
  9. Proper and useful handling of whitespace
  10. -
+ +1. The focus of all future dev. +2. Many fewer memory allocation (1/10th to 1/100th), uses less memory + (about 40% of TinyXML-1), and faster. +3. No STL requirement. +4. More modern C++, including a proper namespace. +5. Proper and useful handling of whitespace Advantages of TinyXML-1 -
    -
  1. Can report the location of parsing errors.
  2. -
  3. Support for some C++ STL conventions: streams and strings
  4. -
  5. Very mature and well debugged code base.
  6. -
- -

Features

-

Memory Model

+1. Can report the location of parsing errors. +2. Support for some C++ STL conventions: streams and strings +3. Very mature and well debugged code base. + +Features +-------- + +### Memory Model An XMLDocument is a C++ object like any other, that can be on the stack, or new'd and deleted on the heap. @@ -101,7 +102,7 @@ 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

+### White Space Microsoft has an excellent article on white space: http://msdn.microsoft.com/en-us/library/ms256097.aspx @@ -121,19 +122,20 @@ preserved. Line-feeds are preserved, as in this example: Hello again, World -However, white space between elements is *not* preserved. Although not strictly +However, white space between elements is **not** preserved. Although not strictly compliant, tracking and reporting inter-element space is awkward, and not normally valuable. TinyXML-2 sees these as the same XML: - 1 - 2 - 3 + 1 + 2 + 3 123 -

Entities

+### Entities + TinyXML-2 recognizes the pre-defined "character entities", meaning special characters. Namely: @@ -157,9 +159,9 @@ This is called a 'numeric character reference'. Any numeric character reference that isn't one of the special entities above, will be read, but written as a regular code point. The output is correct, but the entity syntax isn't preserved. -

Printing

+### Printing -

Print to file

+#### Print to file You can directly use the convenience function: XMLDocument doc; @@ -171,14 +173,14 @@ Or the XMLPrinter class: XMLPrinter printer( fp ); doc.Print( &printer ); -

Print to memory

+#### Print to memory Printing to memory is supported by the XMLPrinter. XMLPrinter printer; doc->Print( &printer ); // printer.CStr() has a const char* to the XML -

Print without an XMLDocument

+#### Print without an XMLDocument When loading, an XML parser is very useful. However, sometimes when saving, it just gets in the way. The code is often set up @@ -193,19 +195,19 @@ an XML document. printer.PushAttribute( "foo", "bar" ); printer.CloseElement(); -

Examples

+Examples +-------- + +#### Load and parse an XML file. -

Load and parse an XML file.

-@verbatim /* ------ Example 1: Load and parse an XML file. ---- */ { XMLDocument doc; doc.LoadFile( "dream.xml" ); } -@endverbatim -

Lookup information.

-@verbatim +#### Lookup information. + /* ------ Example 2: Lookup information. ---- */ { XMLDocument doc; @@ -228,30 +230,29 @@ an XML document. title = textNode->Value(); printf( "Name of play (2): %s\n", title ); } -@endverbatim -

Using and Installing

+Using and Installing +-------------------- There are 2 files in TinyXML-2: -
    -
  1. tinyxml2.cpp
  2. -
  3. tinyxml2.h
  4. -
+* tinyxml2.cpp +* tinyxml2.h + And additionally a test file: -
    -
  1. xmltest.cpp
  2. -
+* xmltest.cpp Simply compile and run. There is a visual studio 2010 project included, a simple Makefile, an XCode project, and a cmake CMakeLists.txt included to help you. The top of tinyxml.h even has a simple g++ command line if you are are *nix and don't want to use a build system. -

Documentation

+Documentation +------------- The documentation is build with Doxygen, using the 'dox' configuration file. -

License

+License +------- TinyXML-2 is released under the zlib license: @@ -267,14 +268,13 @@ redistribute it freely, subject to the following restrictions: not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -

Contributors

+Contributors +------------ Thanks very much to everyone who sends suggestions, bugs, ideas, and encouragement. It all helps, and makes this project fun. @@ -285,5 +285,4 @@ Berquin and Andrew Ellerton who were key contributors. TinyXML-2 grew from that effort. Lee Thomason is the original author of TinyXML-2 (and TinyXML-1) but hopefully TinyXML-2 will be improved -by many contributors. -*/ +by many contributors. \ No newline at end of file