update the docs
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.18"/>
|
||||
<meta name="generator" content="Doxygen 1.9.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TinyXML-2: TinyXML-2</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
@@ -22,7 +22,7 @@
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">TinyXML-2
|
||||
 <span id="projectnumber">8.0.0</span>
|
||||
 <span id="projectnumber">8.1.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -30,10 +30,10 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.18 -->
|
||||
<!-- Generated by Doxygen 1.9.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
@@ -67,7 +67,7 @@ $(function() {
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock"><p><a class="anchor" id="md_readme"></a></p>
|
||||
<p><a href="https://travis-ci.org/leethomason/tinyxml2"><img src="https://travis-ci.org/leethomason/tinyxml2.svg?branch=master" alt="TravisCI Status" style="pointer-events: none;" class="inline"/></a> <a href="https://ci.appveyor.com/project/leethomason/tinyxml2"><img src="https://ci.appveyor.com/api/projects/status/github/leethomason/tinyxml2?branch=master&svg=true" alt="AppVeyor Status" class="inline"/></a></p>
|
||||
<p><img src="https://github.com/leethomason/tinyxml2/actions/workflows/test.yml/badge.svg" alt="Build" style="pointer-events: none;" class="inline"/></p>
|
||||
<p><img src="http://www.grinninglizard.com/tinyxml2/TinyXML2_small.png" alt="TinyXML-2 Logo" class="inline"/></p>
|
||||
<p>TinyXML-2 is a simple, small, efficient, C++ XML parser that can be easily integrated into other programs.</p>
|
||||
<p>The master is hosted on github: <a href="https://github.com/leethomason/tinyxml2">https://github.com/leethomason/tinyxml2</a></p>
|
||||
@@ -84,9 +84,9 @@ $(function() {
|
||||
<h1>What it doesn't do. </h1>
|
||||
<p>TinyXML-2 doesn't parse or use DTDs (Document Type Definitions) or XSLs (eXtensible Stylesheet Language.) There are other parsers out there that are much more fully featured. But they are generally bigger and more difficult to use. If you are working with browsers or have more complete XML needs, TinyXML-2 is not the parser for you.</p>
|
||||
<h1>TinyXML-1 vs. TinyXML-2 </h1>
|
||||
<p>TinyXML-2 is now the focus of all development, well tested, and your best choice between the two APIs. At this point, unless you are maintaining legacy code, you should choose TinyXML-2.</p>
|
||||
<p>TinyXML-2 long been the focus of all development. It is well tested and should be used instead of TinyXML-1.</p>
|
||||
<p>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 to make it more appropriate for use in a game. It uses less memory, is faster, and uses far fewer memory allocations.</p>
|
||||
<p>TinyXML-2 has no requirement or support for STL. By returning <code>const char*</code> TinyXML-2 can be much more efficient with memory usage. (TinyXML-1 did support and use STL, but consumed much more memory for the DOM representation.)</p>
|
||||
<p>TinyXML-2 has no requirement or support for STL.</p>
|
||||
<h1>Features </h1>
|
||||
<h2>Code Page</h2>
|
||||
<p>TinyXML-2 uses UTF-8 exclusively when interpreting XML. All XML is assumed to be UTF-8.</p>
|
||||
@@ -100,16 +100,16 @@ $(function() {
|
||||
<p>By default, TinyXML-2 preserves white space in a (hopefully) sane way that is almost compliant with the spec. (TinyXML-1 used a completely different model, much more similar to 'collapse', below.)</p>
|
||||
<p>As a first step, all newlines / carriage-returns / line-feeds are normalized to a line-feed character, as required by the XML spec.</p>
|
||||
<p>White space in text is preserved. For example: </p><pre class="fragment"><element> Hello, World</element>
|
||||
</pre><p>The leading space before the "Hello" and the double space after the comma are preserved. Line-feeds are preserved, as in this example: </p><pre class="fragment"><element> Hello again,
|
||||
</pre><p> The leading space before the "Hello" and the double space after the comma are preserved. Line-feeds are preserved, as in this example: </p><pre class="fragment"><element> Hello again,
|
||||
World</element>
|
||||
</pre><p>However, white space between elements is <b>not</b> 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: </p><pre class="fragment"><document>
|
||||
</pre><p> However, white space between elements is <b>not</b> 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: </p><pre class="fragment"><document>
|
||||
<data>1</data>
|
||||
<data>2</data>
|
||||
<data>3</data>
|
||||
</document>
|
||||
|
||||
<document><data>1</data><data>2</data><data>3</data></document>
|
||||
</pre><h3>Whitespace Collapse</h3>
|
||||
</pre> <h3>Whitespace Collapse</h3>
|
||||
<p>For some applications, it is preferable to collapse whitespace. Collapsing whitespace gives you "HTML-like" behavior, which is sometimes more suitable for hand typed documents.</p>
|
||||
<p>TinyXML-2 supports this with the 'whitespace' parameter to the XMLDocument constructor. (The default is to preserve whitespace, as described above.)</p>
|
||||
<p>However, you may also use COLLAPSE_WHITESPACE, which will:</p>
|
||||
@@ -127,34 +127,34 @@ $(function() {
|
||||
&gt; >
|
||||
&quot; "
|
||||
&apos; '
|
||||
</pre><p>These are recognized when the XML document is read, and translated to their UTF-8 equivalents. For instance, text with the XML of: </p><pre class="fragment">Far &amp; Away
|
||||
</pre><p>will have the Value() of "Far & Away" when queried from the XMLText object, and will be written back to the XML stream/file as an ampersand.</p>
|
||||
</pre><p> These are recognized when the XML document is read, and translated to their UTF-8 equivalents. For instance, text with the XML of: </p><pre class="fragment">Far &amp; Away
|
||||
</pre><p> will have the Value() of "Far & Away" when queried from the XMLText object, and will be written back to the XML stream/file as an ampersand.</p>
|
||||
<p>Additionally, any character can be specified by its Unicode code point: The syntax <code>&#xA0;</code> or <code>&#160;</code> are both to the non-breaking space character. 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.</p>
|
||||
<h2>Printing</h2>
|
||||
<h3>Print to file</h3>
|
||||
<p>You can directly use the convenience function: </p><pre class="fragment">XMLDocument doc;
|
||||
...
|
||||
doc.SaveFile( "foo.xml" );
|
||||
</pre><p>Or the XMLPrinter class: </p><pre class="fragment">XMLPrinter printer( fp );
|
||||
</pre><p> Or the XMLPrinter class: </p><pre class="fragment">XMLPrinter printer( fp );
|
||||
doc.Print( &printer );
|
||||
</pre><h3>Print to memory</h3>
|
||||
</pre> <h3>Print to memory</h3>
|
||||
<p>Printing to memory is supported by the XMLPrinter. </p><pre class="fragment">XMLPrinter printer;
|
||||
doc.Print( &printer );
|
||||
// printer.CStr() has a const char* to the XML
|
||||
</pre><h3>Print without an XMLDocument</h3>
|
||||
</pre> <h3>Print without an XMLDocument</h3>
|
||||
<p>When loading, an XML parser is very useful. However, sometimes when saving, it just gets in the way. The code is often set up for streaming, and constructing the DOM is just overhead.</p>
|
||||
<p>The Printer supports the streaming case. The following code prints out a trivially simple XML file without ever creating an XML document. </p><pre class="fragment">XMLPrinter printer( fp );
|
||||
printer.OpenElement( "foo" );
|
||||
printer.PushAttribute( "foo", "bar" );
|
||||
printer.CloseElement();
|
||||
</pre><h1>Examples </h1>
|
||||
</pre> <h1>Examples </h1>
|
||||
<h3>Load and parse an XML file.</h3>
|
||||
<pre class="fragment">/* ------ Example 1: Load and parse an XML file. ---- */
|
||||
{
|
||||
XMLDocument doc;
|
||||
doc.LoadFile( "dream.xml" );
|
||||
}
|
||||
</pre><h3>Lookup information.</h3>
|
||||
</pre> <h3>Lookup information.</h3>
|
||||
<pre class="fragment">/* ------ Example 2: Lookup information. ---- */
|
||||
{
|
||||
XMLDocument doc;
|
||||
@@ -177,7 +177,7 @@ printer.CloseElement();
|
||||
title = textNode->Value();
|
||||
printf( "Name of play (2): %s\n", title );
|
||||
}
|
||||
</pre><h1>Using and Installing </h1>
|
||||
</pre> <h1>Using and Installing </h1>
|
||||
<p>There are 2 files in TinyXML-2:</p><ul>
|
||||
<li>tinyxml2.cpp</li>
|
||||
<li><a class="el" href="tinyxml2_8h_source.html">tinyxml2.h</a></li>
|
||||
@@ -185,19 +185,19 @@ printer.CloseElement();
|
||||
<p>And additionally a test file:</p><ul>
|
||||
<li>xmltest.cpp</li>
|
||||
</ul>
|
||||
<p>Simply compile and run. There is a visual studio 2019 project included, a simple Makefile, an Xcode project, a Code::Blocks 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 using Unix/Linux/BSD and don't want to use a build system.</p>
|
||||
<p>Generally speaking, the intent is that you simply include the tinyxml2.cpp and <a class="el" href="tinyxml2_8h_source.html">tinyxml2.h</a> files in your project and build with your other source code.</p>
|
||||
<p>There is also a CMake build included. CMake is the general build for TinyXML-2. Additional build systems are costly to maintain, and tend to bit-rot.</p>
|
||||
<p>A Visual Studio project is included, but that is largely for developer convenience, and is not intended to integrate well with other builds.</p>
|
||||
<h1>Building TinyXML-2 - Using vcpkg </h1>
|
||||
<p>You can download and install TinyXML-2 using the <a href="https://github.com/Microsoft/vcpkg">vcpkg</a> dependency manager: </p><pre class="fragment">git clone https://github.com/Microsoft/vcpkg.git
|
||||
cd vcpkg
|
||||
./bootstrap-vcpkg.sh
|
||||
./vcpkg integrate install
|
||||
./vcpkg install tinyxml2
|
||||
</pre><p>The TinyXML-2 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please <a href="https://github.com/Microsoft/vcpkg">create an issue or pull request</a> on the vcpkg repository.</p>
|
||||
</pre><p> The TinyXML-2 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please <a href="https://github.com/Microsoft/vcpkg">create an issue or pull request</a> on the vcpkg repository.</p>
|
||||
<h1>Versioning </h1>
|
||||
<p>TinyXML-2 uses semantic versioning. <a href="http://semver.org/">http://semver.org/</a> Releases are now tagged in github.</p>
|
||||
<p>Note that the major version will (probably) change fairly rapidly. API changes are fairly common.</p>
|
||||
<h1>Documentation </h1>
|
||||
<p>The documentation is built with Doxygen, using the 'dox' configuration file.</p>
|
||||
<h1>License </h1>
|
||||
<p>TinyXML-2 is released under the zlib license:</p>
|
||||
<p>This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.</p>
|
||||
@@ -216,9 +216,7 @@ cd vcpkg
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated on Sat Jun 13 2020 19:01:41 for TinyXML-2 by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.18
|
||||
Generated on Sat May 15 2021 20:26:18 for TinyXML-2 by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user