Imported Upstream version 3.0.0 upstream/3.0.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 3 Sep 2019 01:25:48 +0000 (10:25 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 3 Sep 2019 01:25:48 +0000 (10:25 +0900)
24 files changed:
.gitignore [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
Makefile [new file with mode: 0644]
TinyXML2_small.png [new file with mode: 0644]
contrib/html5-printer.cpp [new file with mode: 0644]
dox [new file with mode: 0644]
readme.md [new file with mode: 0644]
resources/dream.xml [new file with mode: 0755]
resources/empty.xml [new file with mode: 0644]
resources/utf8test.xml [new file with mode: 0755]
resources/utf8testverify.xml [new file with mode: 0755]
setversion.py [new file with mode: 0755]
tinyxml2.cpp [new file with mode: 0755]
tinyxml2.h [new file with mode: 0755]
tinyxml2.pc.in [new file with mode: 0644]
tinyxml2/test.vcxproj [new file with mode: 0644]
tinyxml2/test.vcxproj.filters [new file with mode: 0644]
tinyxml2/tinyxml2-cbp/README [new file with mode: 0644]
tinyxml2/tinyxml2-cbp/tinyxml2-cbp.cbp [new file with mode: 0644]
tinyxml2/tinyxml2.sln [new file with mode: 0755]
tinyxml2/tinyxml2.vcxproj [new file with mode: 0755]
tinyxml2/tinyxml2.vcxproj.filters [new file with mode: 0755]
tinyxml2/tinyxml2.xcodeproj/project.pbxproj [new file with mode: 0644]
xmltest.cpp [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..a765577
--- /dev/null
@@ -0,0 +1,13 @@
+# intermediate files
+Win32/
+x64/
+ipch/
+resources/out/
+tinyxml2/tinyxml2-cbp/bin/
+tinyxml2/tinyxml2-cbp/obj/
+*.sdf
+*.suo
+*.opensdf
+*.user
+*.depend
+*.layout
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..16f2ccd
--- /dev/null
@@ -0,0 +1,79 @@
+cmake_minimum_required(VERSION 2.6 FATAL_ERROR)\r
+cmake_policy(VERSION 2.6)\r
+\r
+project(tinyxml2)\r
+include(GNUInstallDirs)\r
+#enable_testing()\r
+\r
+#CMAKE_BUILD_TOOL\r
+\r
+################################\r
+# set lib version here\r
+\r
+set(GENERIC_LIB_VERSION "3.0.0")
+set(GENERIC_LIB_SOVERSION "3")
+\r
+\r
+################################\r
+# Add common source \r
+\r
+include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.")\r
+\r
+################################\r
+# Add custom target to copy all data\r
+\r
+set(TARGET_DATA_COPY DATA_COPY)\r
+if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})\r
+       add_custom_target(\r
+               ${TARGET_DATA_COPY}\r
+               COMMAND ${CMAKE_COMMAND} -E echo "In source build")\r
+else(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})\r
+       make_directory(${CMAKE_CURRENT_BINARY_DIR}/resources/)\r
+       add_custom_target(\r
+               ${TARGET_DATA_COPY}\r
+               COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/dream.xml ${CMAKE_CURRENT_BINARY_DIR}/resources/\r
+               COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/empty.xml ${CMAKE_CURRENT_BINARY_DIR}/resources/\r
+               COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/utf8test.xml ${CMAKE_CURRENT_BINARY_DIR}/resources/\r
+               COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/resources/utf8testverify.xml ${CMAKE_CURRENT_BINARY_DIR}/resources/)\r
+endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})\r
+\r
+################################\r
+# Add definitions\r
+\r
+if(MSVC)\r
+       add_definitions(-D_CRT_SECURE_NO_WARNINGS)\r
+endif(MSVC)\r
+\r
+################################\r
+# Add targets\r
+option(BUILD_SHARED_LIBS "build shared or static libraries" ON)\r
+add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)\r
+set_target_properties(tinyxml2 PROPERTIES\r
+        COMPILE_DEFINITIONS "TINYXML2_EXPORT"\r
+       VERSION "${GENERIC_LIB_VERSION}"\r
+       SOVERSION "${GENERIC_LIB_SOVERSION}")\r
+\r
+add_executable(xmltest xmltest.cpp)\r
+add_dependencies(xmltest tinyxml2)\r
+add_dependencies(xmltest ${TARGET_DATA_COPY})\r
+target_link_libraries(xmltest tinyxml2)\r
+\r
+\r
+install(TARGETS tinyxml2\r
+        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\r
+        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\r
+        ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\r
+\r
+install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\r
+\r
+foreach(p LIB INCLUDE)\r
+       set(var CMAKE_INSTALL_${p}DIR)\r
+       if(NOT IS_ABSOLUTE "${${var}}")\r
+               set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")\r
+       endif()\r
+endforeach()\r
+\r
+configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)\r
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)\r
+\r
+#add_test(xmltest ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)\r
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..aab6293
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+all: xmltest
+xmltest: xmltest.cpp tinyxml2.cpp tinyxml2.h
+test: clean xmltest
+       ./xmltest
+clean:
+       rm -f *.o xmltest
diff --git a/TinyXML2_small.png b/TinyXML2_small.png
new file mode 100644 (file)
index 0000000..6e84b35
Binary files /dev/null and b/TinyXML2_small.png differ
diff --git a/contrib/html5-printer.cpp b/contrib/html5-printer.cpp
new file mode 100644 (file)
index 0000000..3205ccd
--- /dev/null
@@ -0,0 +1,108 @@
+//  g++ -Wall -O2 contrib/html5-printer.cpp -o html5-printer -ltinyxml2
+
+//  This program demonstrates how to use "tinyxml2" to generate conformant HTML5
+//  by deriving from the "tinyxml2::XMLPrinter" class.
+
+//  http://dev.w3.org/html5/markup/syntax.html
+
+//  In HTML5, there are 16 so-called "void" elements.  "void elements" NEVER have
+//  inner content (but they MAY have attributes), and are assumed to be self-closing.
+//  An example of a self-closig HTML5 element is "<br/>" (line break)
+//  All other elements are called "non-void" and MUST never self-close.
+//  Examples: "<div class='lolcats'></div>".
+
+//  tinyxml2::XMLPrinter will emit _ALL_ XML elements with no inner content as
+//  self-closing.  This behavior produces space-effeceint XML, but incorrect HTML5.
+
+//  Author: Dennis Jenkins,  dennis (dot) jenkins (dot) 75 (at) gmail (dot) com.
+//  License: Same as tinyxml2 (zlib, see below)
+//  This example is a small contribution to the world!  Enjoy it!
+
+/*
+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.
+
+Permission is granted to anyone to use this software for any
+purpose, including commercial applications, and to alter it and
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must
+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.
+*/
+
+
+#include <tinyxml2.h>
+#include <iostream>
+
+#if defined (_MSC_VER)
+#define strcasecmp stricmp
+#endif
+
+using namespace tinyxml2;
+
+// Contrived input containing a mix of void and non-void HTML5 elements.
+// When printed via XMLPrinter, some non-void elements will self-close (not valid HTML5).
+static const char input[] =
+"<html><body><p style='a'></p><br/>&copy;<col a='1' b='2'/><div a='1'></div></body></html>";
+
+// XMLPrinterHTML5 is small enough, just put the entire implementation inline.
+class  XMLPrinterHTML5 : public XMLPrinter
+{
+public:
+    XMLPrinterHTML5 (FILE* file=0, bool compact = false, int depth = 0) :
+        XMLPrinter (file, compact, depth)
+    {}
+
+protected:
+    virtual void CloseElement () {
+        if (_elementJustOpened && !isVoidElement (_stack.PeekTop())) {
+            SealElement();
+            }
+        XMLPrinter::CloseElement();
+    }
+
+    virtual bool isVoidElement (const char *name) {
+// Complete list of all HTML5 "void elements",
+// http://dev.w3.org/html5/markup/syntax.html
+        static const char *list[] = {
+            "area", "base", "br", "col", "command", "embed", "hr", "img",
+            "input", "keygen", "link", "meta", "param", "source", "track", "wbr",
+            NULL
+        };
+
+// I could use 'bsearch', but I don't have MSVC to test on (it would work with gcc/libc).
+        for (const char **p = list; *p; ++p) {
+            if (!strcasecmp (name, *p)) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+};
+
+int    main (void) {
+    XMLDocument doc (false);
+    doc.Parse (input);
+
+    std::cout << "INPUT:\n" << input << "\n\n";
+
+    XMLPrinter prn (NULL, true);
+    doc.Print (&prn);
+    std::cout << "XMLPrinter (not valid HTML5):\n" << prn.CStr() << "\n\n";
+
+    XMLPrinterHTML5 html5 (NULL, true);
+    doc.Print (&html5);
+    std::cout << "XMLPrinterHTML5:\n" << html5.CStr() << "\n";
+
+    return 0;
+}
diff --git a/dox b/dox
new file mode 100644 (file)
index 0000000..7c3cd78
--- /dev/null
+++ b/dox
@@ -0,0 +1,2324 @@
+# Doxyfile 1.8.6\r
+\r
+# This file describes the settings to be used by the documentation system\r
+# doxygen (www.doxygen.org) for a project.\r
+#\r
+# All text after a double hash (##) is considered a comment and is placed in\r
+# front of the TAG it is preceding.\r
+#\r
+# All text after a single hash (#) is considered a comment and will be ignored.\r
+# The format is:\r
+# TAG = value [value, ...]\r
+# For lists, items can also be appended using:\r
+# TAG += value [value, ...]\r
+# Values that contain spaces should be placed between quotes (\" \").\r
+\r
+#---------------------------------------------------------------------------\r
+# Project related configuration options\r
+#---------------------------------------------------------------------------\r
+\r
+# This tag specifies the encoding used for all characters in the config file\r
+# that follow. The default is UTF-8 which is also the encoding used for all text\r
+# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv\r
+# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv\r
+# for the list of possible encodings.\r
+# The default value is: UTF-8.\r
+\r
+DOXYFILE_ENCODING      = UTF-8\r
+\r
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by\r
+# double-quotes, unless you are using Doxywizard) that should identify the\r
+# project for which the documentation is generated. This name is used in the\r
+# title of most generated pages and in a few other places.\r
+# The default value is: My Project.\r
+\r
+PROJECT_NAME           = "TinyXML-2"\r
+\r
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. This\r
+# could be handy for archiving the generated documentation or if some version\r
+# control system is used.\r
+\r
+PROJECT_NUMBER = 3.0.0
+\r
+# Using the PROJECT_BRIEF tag one can provide an optional one line description\r
+# for a project that appears at the top of each page and should give viewer a\r
+# quick idea about the purpose of the project. Keep the description short.\r
+\r
+PROJECT_BRIEF          =\r
+\r
+# With the PROJECT_LOGO tag one can specify an logo or icon that is included in\r
+# the documentation. The maximum height of the logo should not exceed 55 pixels\r
+# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo\r
+# to the output directory.\r
+\r
+PROJECT_LOGO           =\r
+\r
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path\r
+# into which the generated documentation will be written. If a relative path is\r
+# entered, it will be relative to the location where doxygen was started. If\r
+# left blank the current directory will be used.\r
+\r
+OUTPUT_DIRECTORY       = .\r
+\r
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-\r
+# directories (in 2 levels) under the output directory of each output format and\r
+# will distribute the generated files over these directories. Enabling this\r
+# option can be useful when feeding doxygen a huge amount of source files, where\r
+# putting all generated files in the same directory would otherwise causes\r
+# performance problems for the file system.\r
+# The default value is: NO.\r
+\r
+CREATE_SUBDIRS         = NO\r
+\r
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all\r
+# documentation generated by doxygen is written. Doxygen will use this\r
+# information to generate all constant output in the proper language.\r
+# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,\r
+# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),\r
+# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,\r
+# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),\r
+# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,\r
+# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,\r
+# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,\r
+# Ukrainian and Vietnamese.\r
+# The default value is: English.\r
+\r
+OUTPUT_LANGUAGE        = English\r
+\r
+# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member\r
+# descriptions after the members that are listed in the file and class\r
+# documentation (similar to Javadoc). Set to NO to disable this.\r
+# The default value is: YES.\r
+\r
+BRIEF_MEMBER_DESC      = YES\r
+\r
+# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief\r
+# description of a member or function before the detailed description\r
+#\r
+# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the\r
+# brief descriptions will be completely suppressed.\r
+# The default value is: YES.\r
+\r
+REPEAT_BRIEF           = YES\r
+\r
+# This tag implements a quasi-intelligent brief description abbreviator that is\r
+# used to form the text in various listings. Each string in this list, if found\r
+# as the leading text of the brief description, will be stripped from the text\r
+# and the result, after processing the whole list, is used as the annotated\r
+# text. Otherwise, the brief description is used as-is. If left blank, the\r
+# following values are used ($name is automatically replaced with the name of\r
+# the entity):The $name class, The $name widget, The $name file, is, provides,\r
+# specifies, contains, represents, a, an and the.\r
+\r
+ABBREVIATE_BRIEF       =\r
+\r
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then\r
+# doxygen will generate a detailed section even if there is only a brief\r
+# description.\r
+# The default value is: NO.\r
+\r
+ALWAYS_DETAILED_SEC    = NO\r
+\r
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all\r
+# inherited members of a class in the documentation of that class as if those\r
+# members were ordinary class members. Constructors, destructors and assignment\r
+# operators of the base classes will not be shown.\r
+# The default value is: NO.\r
+\r
+INLINE_INHERITED_MEMB  = NO\r
+\r
+# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path\r
+# before files name in the file list and in the header files. If set to NO the\r
+# shortest path that makes the file name unique will be used\r
+# The default value is: YES.\r
+\r
+FULL_PATH_NAMES        = YES\r
+\r
+# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.\r
+# Stripping is only done if one of the specified strings matches the left-hand\r
+# part of the path. The tag can be used to show relative paths in the file list.\r
+# If left blank the directory from which doxygen is run is used as the path to\r
+# strip.\r
+#\r
+# Note that you can specify absolute paths here, but also relative paths, which\r
+# will be relative from the directory where doxygen is started.\r
+# This tag requires that the tag FULL_PATH_NAMES is set to YES.\r
+\r
+STRIP_FROM_PATH        =\r
+\r
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the\r
+# path mentioned in the documentation of a class, which tells the reader which\r
+# header file to include in order to use a class. If left blank only the name of\r
+# the header file containing the class definition is used. Otherwise one should\r
+# specify the list of include paths that are normally passed to the compiler\r
+# using the -I flag.\r
+\r
+STRIP_FROM_INC_PATH    =\r
+\r
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but\r
+# less readable) file names. This can be useful is your file systems doesn't\r
+# support long names like on DOS, Mac, or CD-ROM.\r
+# The default value is: NO.\r
+\r
+SHORT_NAMES            = NO\r
+\r
+# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the\r
+# first line (until the first dot) of a Javadoc-style comment as the brief\r
+# description. If set to NO, the Javadoc-style will behave just like regular Qt-\r
+# style comments (thus requiring an explicit @brief command for a brief\r
+# description.)\r
+# The default value is: NO.\r
+\r
+JAVADOC_AUTOBRIEF      = NO\r
+\r
+# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first\r
+# line (until the first dot) of a Qt-style comment as the brief description. If\r
+# set to NO, the Qt-style will behave just like regular Qt-style comments (thus\r
+# requiring an explicit \brief command for a brief description.)\r
+# The default value is: NO.\r
+\r
+QT_AUTOBRIEF           = NO\r
+\r
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a\r
+# multi-line C++ special comment block (i.e. a block of //! or /// comments) as\r
+# a brief description. This used to be the default behavior. The new default is\r
+# to treat a multi-line C++ comment block as a detailed description. Set this\r
+# tag to YES if you prefer the old behavior instead.\r
+#\r
+# Note that setting this tag to YES also means that rational rose comments are\r
+# not recognized any more.\r
+# The default value is: NO.\r
+\r
+MULTILINE_CPP_IS_BRIEF = NO\r
+\r
+# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the\r
+# documentation from any documented member that it re-implements.\r
+# The default value is: YES.\r
+\r
+INHERIT_DOCS           = YES\r
+\r
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a\r
+# new page for each member. If set to NO, the documentation of a member will be\r
+# part of the file/class/namespace that contains it.\r
+# The default value is: NO.\r
+\r
+SEPARATE_MEMBER_PAGES  = NO\r
+\r
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen\r
+# uses this value to replace tabs by spaces in code fragments.\r
+# Minimum value: 1, maximum value: 16, default value: 4.\r
+\r
+TAB_SIZE               = 4\r
+\r
+# This tag can be used to specify a number of aliases that act as commands in\r
+# the documentation. An alias has the form:\r
+# name=value\r
+# For example adding\r
+# "sideeffect=@par Side Effects:\n"\r
+# will allow you to put the command \sideeffect (or @sideeffect) in the\r
+# documentation, which will result in a user-defined paragraph with heading\r
+# "Side Effects:". You can put \n's in the value part of an alias to insert\r
+# newlines.\r
+\r
+ALIASES                =\r
+\r
+# This tag can be used to specify a number of word-keyword mappings (TCL only).\r
+# A mapping has the form "name=value". For example adding "class=itcl::class"\r
+# will allow you to use the command class in the itcl::class meaning.\r
+\r
+TCL_SUBST              =\r
+\r
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources\r
+# only. Doxygen will then generate output that is more tailored for C. For\r
+# instance, some of the names that are used will be different. The list of all\r
+# members will be omitted, etc.\r
+# The default value is: NO.\r
+\r
+OPTIMIZE_OUTPUT_FOR_C  = NO\r
+\r
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or\r
+# Python sources only. Doxygen will then generate output that is more tailored\r
+# for that language. For instance, namespaces will be presented as packages,\r
+# qualified scopes will look different, etc.\r
+# The default value is: NO.\r
+\r
+OPTIMIZE_OUTPUT_JAVA   = NO\r
+\r
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran\r
+# sources. Doxygen will then generate output that is tailored for Fortran.\r
+# The default value is: NO.\r
+\r
+OPTIMIZE_FOR_FORTRAN   = NO\r
+\r
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL\r
+# sources. Doxygen will then generate output that is tailored for VHDL.\r
+# The default value is: NO.\r
+\r
+OPTIMIZE_OUTPUT_VHDL   = NO\r
+\r
+# Doxygen selects the parser to use depending on the extension of the files it\r
+# parses. With this tag you can assign which parser to use for a given\r
+# extension. Doxygen has a built-in mapping, but you can override or extend it\r
+# using this tag. The format is ext=language, where ext is a file extension, and\r
+# language is one of the parsers supported by doxygen: IDL, Java, Javascript,\r
+# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make\r
+# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C\r
+# (default is Fortran), use: inc=Fortran f=C.\r
+#\r
+# Note For files without extension you can use no_extension as a placeholder.\r
+#\r
+# Note that for custom extensions you also need to set FILE_PATTERNS otherwise\r
+# the files are not read by doxygen.\r
+\r
+EXTENSION_MAPPING      =\r
+\r
+# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments\r
+# according to the Markdown format, which allows for more readable\r
+# documentation. See http://daringfireball.net/projects/markdown/ for details.\r
+# The output of markdown processing is further processed by doxygen, so you can\r
+# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in\r
+# case of backward compatibilities issues.\r
+# The default value is: YES.\r
+\r
+MARKDOWN_SUPPORT       = YES\r
+\r
+# When enabled doxygen tries to link words that correspond to documented\r
+# classes, or namespaces to their corresponding documentation. Such a link can\r
+# be prevented in individual cases by by putting a % sign in front of the word\r
+# or globally by setting AUTOLINK_SUPPORT to NO.\r
+# The default value is: YES.\r
+\r
+AUTOLINK_SUPPORT       = YES\r
+\r
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want\r
+# to include (a tag file for) the STL sources as input, then you should set this\r
+# tag to YES in order to let doxygen match functions declarations and\r
+# definitions whose arguments contain STL classes (e.g. func(std::string);\r
+# versus func(std::string) {}). This also make the inheritance and collaboration\r
+# diagrams that involve STL classes more complete and accurate.\r
+# The default value is: NO.\r
+\r
+BUILTIN_STL_SUPPORT    = NO\r
+\r
+# If you use Microsoft's C++/CLI language, you should set this option to YES to\r
+# enable parsing support.\r
+# The default value is: NO.\r
+\r
+CPP_CLI_SUPPORT        = NO\r
+\r
+# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:\r
+# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen\r
+# will parse them like normal C++ but will assume all classes use public instead\r
+# of private inheritance when no explicit protection keyword is present.\r
+# The default value is: NO.\r
+\r
+SIP_SUPPORT            = NO\r
+\r
+# For Microsoft's IDL there are propget and propput attributes to indicate\r
+# getter and setter methods for a property. Setting this option to YES will make\r
+# doxygen to replace the get and set methods by a property in the documentation.\r
+# This will only work if the methods are indeed getting or setting a simple\r
+# type. If this is not the case, or you want to show the methods anyway, you\r
+# should set this option to NO.\r
+# The default value is: YES.\r
+\r
+IDL_PROPERTY_SUPPORT   = YES\r
+\r
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC\r
+# tag is set to YES, then doxygen will reuse the documentation of the first\r
+# member in the group (if any) for the other members of the group. By default\r
+# all members of a group must be documented explicitly.\r
+# The default value is: NO.\r
+\r
+DISTRIBUTE_GROUP_DOC   = NO\r
+\r
+# Set the SUBGROUPING tag to YES to allow class member groups of the same type\r
+# (for instance a group of public functions) to be put as a subgroup of that\r
+# type (e.g. under the Public Functions section). Set it to NO to prevent\r
+# subgrouping. Alternatively, this can be done per class using the\r
+# \nosubgrouping command.\r
+# The default value is: YES.\r
+\r
+SUBGROUPING            = YES\r
+\r
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions\r
+# are shown inside the group in which they are included (e.g. using \ingroup)\r
+# instead of on a separate page (for HTML and Man pages) or section (for LaTeX\r
+# and RTF).\r
+#\r
+# Note that this feature does not work in combination with\r
+# SEPARATE_MEMBER_PAGES.\r
+# The default value is: NO.\r
+\r
+INLINE_GROUPED_CLASSES = NO\r
+\r
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions\r
+# with only public data fields or simple typedef fields will be shown inline in\r
+# the documentation of the scope in which they are defined (i.e. file,\r
+# namespace, or group documentation), provided this scope is documented. If set\r
+# to NO, structs, classes, and unions are shown on a separate page (for HTML and\r
+# Man pages) or section (for LaTeX and RTF).\r
+# The default value is: NO.\r
+\r
+INLINE_SIMPLE_STRUCTS  = NO\r
+\r
+# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or\r
+# enum is documented as struct, union, or enum with the name of the typedef. So\r
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct\r
+# with name TypeT. When disabled the typedef will appear as a member of a file,\r
+# namespace, or class. And the struct will be named TypeS. This can typically be\r
+# useful for C code in case the coding convention dictates that all compound\r
+# types are typedef'ed and only the typedef is referenced, never the tag name.\r
+# The default value is: NO.\r
+\r
+TYPEDEF_HIDES_STRUCT   = NO\r
+\r
+# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This\r
+# cache is used to resolve symbols given their name and scope. Since this can be\r
+# an expensive process and often the same symbol appears multiple times in the\r
+# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small\r
+# doxygen will become slower. If the cache is too large, memory is wasted. The\r
+# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range\r
+# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536\r
+# symbols. At the end of a run doxygen will report the cache usage and suggest\r
+# the optimal cache size from a speed point of view.\r
+# Minimum value: 0, maximum value: 9, default value: 0.\r
+\r
+LOOKUP_CACHE_SIZE      = 0\r
+\r
+#---------------------------------------------------------------------------\r
+# Build related configuration options\r
+#---------------------------------------------------------------------------\r
+\r
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in\r
+# documentation are documented, even if no documentation was available. Private\r
+# class members and static file members will be hidden unless the\r
+# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.\r
+# Note: This will also disable the warnings about undocumented members that are\r
+# normally produced when WARNINGS is set to YES.\r
+# The default value is: NO.\r
+\r
+EXTRACT_ALL            = NO\r
+\r
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will\r
+# be included in the documentation.\r
+# The default value is: NO.\r
+\r
+EXTRACT_PRIVATE        = NO\r
+\r
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal\r
+# scope will be included in the documentation.\r
+# The default value is: NO.\r
+\r
+EXTRACT_PACKAGE        = NO\r
+\r
+# If the EXTRACT_STATIC tag is set to YES all static members of a file will be\r
+# included in the documentation.\r
+# The default value is: NO.\r
+\r
+EXTRACT_STATIC         = NO\r
+\r
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined\r
+# locally in source files will be included in the documentation. If set to NO\r
+# only classes defined in header files are included. Does not have any effect\r
+# for Java sources.\r
+# The default value is: YES.\r
+\r
+EXTRACT_LOCAL_CLASSES  = YES\r
+\r
+# This flag is only useful for Objective-C code. When set to YES local methods,\r
+# which are defined in the implementation section but not in the interface are\r
+# included in the documentation. If set to NO only methods in the interface are\r
+# included.\r
+# The default value is: NO.\r
+\r
+EXTRACT_LOCAL_METHODS  = NO\r
+\r
+# If this flag is set to YES, the members of anonymous namespaces will be\r
+# extracted and appear in the documentation as a namespace called\r
+# 'anonymous_namespace{file}', where file will be replaced with the base name of\r
+# the file that contains the anonymous namespace. By default anonymous namespace\r
+# are hidden.\r
+# The default value is: NO.\r
+\r
+EXTRACT_ANON_NSPACES   = NO\r
+\r
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all\r
+# undocumented members inside documented classes or files. If set to NO these\r
+# members will be included in the various overviews, but no documentation\r
+# section is generated. This option has no effect if EXTRACT_ALL is enabled.\r
+# The default value is: NO.\r
+\r
+HIDE_UNDOC_MEMBERS     = YES\r
+\r
+# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all\r
+# undocumented classes that are normally visible in the class hierarchy. If set\r
+# to NO these classes will be included in the various overviews. This option has\r
+# no effect if EXTRACT_ALL is enabled.\r
+# The default value is: NO.\r
+\r
+HIDE_UNDOC_CLASSES     = YES\r
+\r
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend\r
+# (class|struct|union) declarations. If set to NO these declarations will be\r
+# included in the documentation.\r
+# The default value is: NO.\r
+\r
+HIDE_FRIEND_COMPOUNDS  = NO\r
+\r
+# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any\r
+# documentation blocks found inside the body of a function. If set to NO these\r
+# blocks will be appended to the function's detailed documentation block.\r
+# The default value is: NO.\r
+\r
+HIDE_IN_BODY_DOCS      = NO\r
+\r
+# The INTERNAL_DOCS tag determines if documentation that is typed after a\r
+# \internal command is included. If the tag is set to NO then the documentation\r
+# will be excluded. Set it to YES to include the internal documentation.\r
+# The default value is: NO.\r
+\r
+INTERNAL_DOCS          = NO\r
+\r
+# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file\r
+# names in lower-case letters. If set to YES upper-case letters are also\r
+# allowed. This is useful if you have classes or files whose names only differ\r
+# in case and if your file system supports case sensitive file names. Windows\r
+# and Mac users are advised to set this option to NO.\r
+# The default value is: system dependent.\r
+\r
+CASE_SENSE_NAMES       = NO\r
+\r
+# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with\r
+# their full class and namespace scopes in the documentation. If set to YES the\r
+# scope will be hidden.\r
+# The default value is: NO.\r
+\r
+HIDE_SCOPE_NAMES       = NO\r
+\r
+# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of\r
+# the files that are included by a file in the documentation of that file.\r
+# The default value is: YES.\r
+\r
+SHOW_INCLUDE_FILES     = YES\r
+\r
+# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each\r
+# grouped member an include statement to the documentation, telling the reader\r
+# which file to include in order to use the member.\r
+# The default value is: NO.\r
+\r
+SHOW_GROUPED_MEMB_INC  = NO\r
+\r
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include\r
+# files with double quotes in the documentation rather than with sharp brackets.\r
+# The default value is: NO.\r
+\r
+FORCE_LOCAL_INCLUDES   = NO\r
+\r
+# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the\r
+# documentation for inline members.\r
+# The default value is: YES.\r
+\r
+INLINE_INFO            = YES\r
+\r
+# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the\r
+# (detailed) documentation of file and class members alphabetically by member\r
+# name. If set to NO the members will appear in declaration order.\r
+# The default value is: YES.\r
+\r
+SORT_MEMBER_DOCS       = YES\r
+\r
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief\r
+# descriptions of file, namespace and class members alphabetically by member\r
+# name. If set to NO the members will appear in declaration order. Note that\r
+# this will also influence the order of the classes in the class list.\r
+# The default value is: NO.\r
+\r
+SORT_BRIEF_DOCS        = NO\r
+\r
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the\r
+# (brief and detailed) documentation of class members so that constructors and\r
+# destructors are listed first. If set to NO the constructors will appear in the\r
+# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.\r
+# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief\r
+# member documentation.\r
+# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting\r
+# detailed member documentation.\r
+# The default value is: NO.\r
+\r
+SORT_MEMBERS_CTORS_1ST = NO\r
+\r
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy\r
+# of group names into alphabetical order. If set to NO the group names will\r
+# appear in their defined order.\r
+# The default value is: NO.\r
+\r
+SORT_GROUP_NAMES       = NO\r
+\r
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by\r
+# fully-qualified names, including namespaces. If set to NO, the class list will\r
+# be sorted only by class name, not including the namespace part.\r
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.\r
+# Note: This option applies only to the class list, not to the alphabetical\r
+# list.\r
+# The default value is: NO.\r
+\r
+SORT_BY_SCOPE_NAME     = NO\r
+\r
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper\r
+# type resolution of all parameters of a function it will reject a match between\r
+# the prototype and the implementation of a member function even if there is\r
+# only one candidate or it is obvious which candidate to choose by doing a\r
+# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still\r
+# accept a match between prototype and implementation in such cases.\r
+# The default value is: NO.\r
+\r
+STRICT_PROTO_MATCHING  = NO\r
+\r
+# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the\r
+# todo list. This list is created by putting \todo commands in the\r
+# documentation.\r
+# The default value is: YES.\r
+\r
+GENERATE_TODOLIST      = NO\r
+\r
+# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the\r
+# test list. This list is created by putting \test commands in the\r
+# documentation.\r
+# The default value is: YES.\r
+\r
+GENERATE_TESTLIST      = NO\r
+\r
+# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug\r
+# list. This list is created by putting \bug commands in the documentation.\r
+# The default value is: YES.\r
+\r
+GENERATE_BUGLIST       = NO\r
+\r
+# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)\r
+# the deprecated list. This list is created by putting \deprecated commands in\r
+# the documentation.\r
+# The default value is: YES.\r
+\r
+GENERATE_DEPRECATEDLIST= YES\r
+\r
+# The ENABLED_SECTIONS tag can be used to enable conditional documentation\r
+# sections, marked by \if <section_label> ... \endif and \cond <section_label>\r
+# ... \endcond blocks.\r
+\r
+ENABLED_SECTIONS       =\r
+\r
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the\r
+# initial value of a variable or macro / define can have for it to appear in the\r
+# documentation. If the initializer consists of more lines than specified here\r
+# it will be hidden. Use a value of 0 to hide initializers completely. The\r
+# appearance of the value of individual variables and macros / defines can be\r
+# controlled using \showinitializer or \hideinitializer command in the\r
+# documentation regardless of this setting.\r
+# Minimum value: 0, maximum value: 10000, default value: 30.\r
+\r
+MAX_INITIALIZER_LINES  = 30\r
+\r
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at\r
+# the bottom of the documentation of classes and structs. If set to YES the list\r
+# will mention the files that were used to generate the documentation.\r
+# The default value is: YES.\r
+\r
+SHOW_USED_FILES        = YES\r
+\r
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This\r
+# will remove the Files entry from the Quick Index and from the Folder Tree View\r
+# (if specified).\r
+# The default value is: YES.\r
+\r
+SHOW_FILES             = YES\r
+\r
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces\r
+# page. This will remove the Namespaces entry from the Quick Index and from the\r
+# Folder Tree View (if specified).\r
+# The default value is: YES.\r
+\r
+SHOW_NAMESPACES        = YES\r
+\r
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that\r
+# doxygen should invoke to get the current version for each file (typically from\r
+# the version control system). Doxygen will invoke the program by executing (via\r
+# popen()) the command command input-file, where command is the value of the\r
+# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided\r
+# by doxygen. Whatever the program writes to standard output is used as the file\r
+# version. For an example see the documentation.\r
+\r
+FILE_VERSION_FILTER    =\r
+\r
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed\r
+# by doxygen. The layout file controls the global structure of the generated\r
+# output files in an output format independent way. To create the layout file\r
+# that represents doxygen's defaults, run doxygen with the -l option. You can\r
+# optionally specify a file name after the option, if omitted DoxygenLayout.xml\r
+# will be used as the name of the layout file.\r
+#\r
+# Note that if you run doxygen from a directory containing a file called\r
+# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE\r
+# tag is left empty.\r
+\r
+LAYOUT_FILE            =\r
+\r
+# The CITE_BIB_FILES tag can be used to specify one or more bib files containing\r
+# the reference definitions. This must be a list of .bib files. The .bib\r
+# extension is automatically appended if omitted. This requires the bibtex tool\r
+# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.\r
+# For LaTeX the style of the bibliography can be controlled using\r
+# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the\r
+# search path. Do not use file names with spaces, bibtex cannot handle them. See\r
+# also \cite for info how to create references.\r
+\r
+CITE_BIB_FILES         =\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to warning and progress messages\r
+#---------------------------------------------------------------------------\r
+\r
+# The QUIET tag can be used to turn on/off the messages that are generated to\r
+# standard output by doxygen. If QUIET is set to YES this implies that the\r
+# messages are off.\r
+# The default value is: NO.\r
+\r
+QUIET                  = NO\r
+\r
+# The WARNINGS tag can be used to turn on/off the warning messages that are\r
+# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES\r
+# this implies that the warnings are on.\r
+#\r
+# Tip: Turn warnings on while writing the documentation.\r
+# The default value is: YES.\r
+\r
+WARNINGS               = YES\r
+\r
+# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate\r
+# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag\r
+# will automatically be disabled.\r
+# The default value is: YES.\r
+\r
+WARN_IF_UNDOCUMENTED   = NO\r
+\r
+# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for\r
+# potential errors in the documentation, such as not documenting some parameters\r
+# in a documented function, or documenting parameters that don't exist or using\r
+# markup commands wrongly.\r
+# The default value is: YES.\r
+\r
+WARN_IF_DOC_ERROR      = YES\r
+\r
+# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that\r
+# are documented, but have no documentation for their parameters or return\r
+# value. If set to NO doxygen will only warn about wrong or incomplete parameter\r
+# documentation, but not about the absence of documentation.\r
+# The default value is: NO.\r
+\r
+WARN_NO_PARAMDOC       = NO\r
+\r
+# The WARN_FORMAT tag determines the format of the warning messages that doxygen\r
+# can produce. The string should contain the $file, $line, and $text tags, which\r
+# will be replaced by the file and line number from which the warning originated\r
+# and the warning text. Optionally the format may contain $version, which will\r
+# be replaced by the version of the file (if it could be obtained via\r
+# FILE_VERSION_FILTER)\r
+# The default value is: $file:$line: $text.\r
+\r
+WARN_FORMAT            = "$file:$line: $text"\r
+\r
+# The WARN_LOGFILE tag can be used to specify a file to which warning and error\r
+# messages should be written. If left blank the output is written to standard\r
+# error (stderr).\r
+\r
+WARN_LOGFILE           =\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the input files\r
+#---------------------------------------------------------------------------\r
+\r
+# The INPUT tag is used to specify the files and/or directories that contain\r
+# documented source files. You may enter file names like myfile.cpp or\r
+# directories like /usr/src/myproject. Separate the files or directories with\r
+# spaces.\r
+# Note: If this tag is empty the current directory is searched.\r
+\r
+INPUT                  = tinyxml2.h \\r
+                         xmltest.cpp \\r
+                         readme.md\r
+\r
+# This tag can be used to specify the character encoding of the source files\r
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses\r
+# libiconv (or the iconv built into libc) for the transcoding. See the libiconv\r
+# documentation (see: http://www.gnu.org/software/libiconv) for the list of\r
+# possible encodings.\r
+# The default value is: UTF-8.\r
+\r
+INPUT_ENCODING         = UTF-8\r
+\r
+# If the value of the INPUT tag contains directories, you can use the\r
+# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and\r
+# *.h) to filter out the source-files in the directories. If left blank the\r
+# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,\r
+# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,\r
+# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,\r
+# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,\r
+# *.qsf, *.as and *.js.\r
+\r
+FILE_PATTERNS          =\r
+\r
+# The RECURSIVE tag can be used to specify whether or not subdirectories should\r
+# be searched for input files as well.\r
+# The default value is: NO.\r
+\r
+RECURSIVE              = NO\r
+\r
+# The EXCLUDE tag can be used to specify files and/or directories that should be\r
+# excluded from the INPUT source files. This way you can easily exclude a\r
+# subdirectory from a directory tree whose root is specified with the INPUT tag.\r
+#\r
+# Note that relative paths are relative to the directory from which doxygen is\r
+# run.\r
+\r
+EXCLUDE                =\r
+\r
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or\r
+# directories that are symbolic links (a Unix file system feature) are excluded\r
+# from the input.\r
+# The default value is: NO.\r
+\r
+EXCLUDE_SYMLINKS       = NO\r
+\r
+# If the value of the INPUT tag contains directories, you can use the\r
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude\r
+# certain files from those directories.\r
+#\r
+# Note that the wildcards are matched against the file with absolute path, so to\r
+# exclude all test directories for example use the pattern */test/*\r
+\r
+EXCLUDE_PATTERNS       =\r
+\r
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names\r
+# (namespaces, classes, functions, etc.) that should be excluded from the\r
+# output. The symbol name can be a fully qualified name, a word, or if the\r
+# wildcard * is used, a substring. Examples: ANamespace, AClass,\r
+# AClass::ANamespace, ANamespace::*Test\r
+#\r
+# Note that the wildcards are matched against the file with absolute path, so to\r
+# exclude all test directories use the pattern */test/*\r
+\r
+EXCLUDE_SYMBOLS        =\r
+\r
+# The EXAMPLE_PATH tag can be used to specify one or more files or directories\r
+# that contain example code fragments that are included (see the \include\r
+# command).\r
+\r
+EXAMPLE_PATH           = .\r
+\r
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the\r
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and\r
+# *.h) to filter out the source-files in the directories. If left blank all\r
+# files are included.\r
+\r
+EXAMPLE_PATTERNS       =\r
+\r
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be\r
+# searched for input files to be used with the \include or \dontinclude commands\r
+# irrespective of the value of the RECURSIVE tag.\r
+# The default value is: NO.\r
+\r
+EXAMPLE_RECURSIVE      = NO\r
+\r
+# The IMAGE_PATH tag can be used to specify one or more files or directories\r
+# that contain images that are to be included in the documentation (see the\r
+# \image command).\r
+\r
+IMAGE_PATH             =\r
+\r
+# The INPUT_FILTER tag can be used to specify a program that doxygen should\r
+# invoke to filter for each input file. Doxygen will invoke the filter program\r
+# by executing (via popen()) the command:\r
+#\r
+# <filter> <input-file>\r
+#\r
+# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the\r
+# name of an input file. Doxygen will then use the output that the filter\r
+# program writes to standard output. If FILTER_PATTERNS is specified, this tag\r
+# will be ignored.\r
+#\r
+# Note that the filter must not add or remove lines; it is applied before the\r
+# code is scanned, but not when the output code is generated. If lines are added\r
+# or removed, the anchors will not be placed correctly.\r
+\r
+INPUT_FILTER           =\r
+\r
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern\r
+# basis. Doxygen will compare the file name with each pattern and apply the\r
+# filter if there is a match. The filters are a list of the form: pattern=filter\r
+# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how\r
+# filters are used. If the FILTER_PATTERNS tag is empty or if none of the\r
+# patterns match the file name, INPUT_FILTER is applied.\r
+\r
+FILTER_PATTERNS        =\r
+\r
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using\r
+# INPUT_FILTER ) will also be used to filter the input files that are used for\r
+# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).\r
+# The default value is: NO.\r
+\r
+FILTER_SOURCE_FILES    = NO\r
+\r
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file\r
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and\r
+# it is also possible to disable source filtering for a specific pattern using\r
+# *.ext= (so without naming a filter).\r
+# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.\r
+\r
+FILTER_SOURCE_PATTERNS =\r
+\r
+# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that\r
+# is part of the input, its contents will be placed on the main page\r
+# (index.html). This can be useful if you have a project on for instance GitHub\r
+# and want to reuse the introduction page also for the doxygen output.\r
+\r
+USE_MDFILE_AS_MAINPAGE = readme.md\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to source browsing\r
+#---------------------------------------------------------------------------\r
+\r
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will be\r
+# generated. Documented entities will be cross-referenced with these sources.\r
+#\r
+# Note: To get rid of all source code in the generated output, make sure that\r
+# also VERBATIM_HEADERS is set to NO.\r
+# The default value is: NO.\r
+\r
+SOURCE_BROWSER         = NO\r
+\r
+# Setting the INLINE_SOURCES tag to YES will include the body of functions,\r
+# classes and enums directly into the documentation.\r
+# The default value is: NO.\r
+\r
+INLINE_SOURCES         = NO\r
+\r
+# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any\r
+# special comment blocks from generated source code fragments. Normal C, C++ and\r
+# Fortran comments will always remain visible.\r
+# The default value is: YES.\r
+\r
+STRIP_CODE_COMMENTS    = YES\r
+\r
+# If the REFERENCED_BY_RELATION tag is set to YES then for each documented\r
+# function all documented functions referencing it will be listed.\r
+# The default value is: NO.\r
+\r
+REFERENCED_BY_RELATION = NO\r
+\r
+# If the REFERENCES_RELATION tag is set to YES then for each documented function\r
+# all documented entities called/used by that function will be listed.\r
+# The default value is: NO.\r
+\r
+REFERENCES_RELATION    = NO\r
+\r
+# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set\r
+# to YES, then the hyperlinks from functions in REFERENCES_RELATION and\r
+# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will\r
+# link to the documentation.\r
+# The default value is: YES.\r
+\r
+REFERENCES_LINK_SOURCE = YES\r
+\r
+# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the\r
+# source code will show a tooltip with additional information such as prototype,\r
+# brief description and links to the definition and documentation. Since this\r
+# will make the HTML file larger and loading of large files a bit slower, you\r
+# can opt to disable this feature.\r
+# The default value is: YES.\r
+# This tag requires that the tag SOURCE_BROWSER is set to YES.\r
+\r
+SOURCE_TOOLTIPS        = YES\r
+\r
+# If the USE_HTAGS tag is set to YES then the references to source code will\r
+# point to the HTML generated by the htags(1) tool instead of doxygen built-in\r
+# source browser. The htags tool is part of GNU's global source tagging system\r
+# (see http://www.gnu.org/software/global/global.html). You will need version\r
+# 4.8.6 or higher.\r
+#\r
+# To use it do the following:\r
+# - Install the latest version of global\r
+# - Enable SOURCE_BROWSER and USE_HTAGS in the config file\r
+# - Make sure the INPUT points to the root of the source tree\r
+# - Run doxygen as normal\r
+#\r
+# Doxygen will invoke htags (and that will in turn invoke gtags), so these\r
+# tools must be available from the command line (i.e. in the search path).\r
+#\r
+# The result: instead of the source browser generated by doxygen, the links to\r
+# source code will now point to the output of htags.\r
+# The default value is: NO.\r
+# This tag requires that the tag SOURCE_BROWSER is set to YES.\r
+\r
+USE_HTAGS              = NO\r
+\r
+# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a\r
+# verbatim copy of the header file for each class for which an include is\r
+# specified. Set to NO to disable this.\r
+# See also: Section \class.\r
+# The default value is: YES.\r
+\r
+VERBATIM_HEADERS       = YES\r
+\r
+# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the\r
+# clang parser (see: http://clang.llvm.org/) for more acurate parsing at the\r
+# cost of reduced performance. This can be particularly helpful with template\r
+# rich C++ code for which doxygen's built-in parser lacks the necessary type\r
+# information.\r
+# Note: The availability of this option depends on whether or not doxygen was\r
+# compiled with the --with-libclang option.\r
+# The default value is: NO.\r
+\r
+CLANG_ASSISTED_PARSING = NO\r
+\r
+# If clang assisted parsing is enabled you can provide the compiler with command\r
+# line options that you would normally use when invoking the compiler. Note that\r
+# the include paths will already be set by doxygen for the files and directories\r
+# specified with INPUT and INCLUDE_PATH.\r
+# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.\r
+\r
+CLANG_OPTIONS          =\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the alphabetical class index\r
+#---------------------------------------------------------------------------\r
+\r
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all\r
+# compounds will be generated. Enable this if the project contains a lot of\r
+# classes, structs, unions or interfaces.\r
+# The default value is: YES.\r
+\r
+ALPHABETICAL_INDEX     = YES\r
+\r
+# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in\r
+# which the alphabetical index list will be split.\r
+# Minimum value: 1, maximum value: 20, default value: 5.\r
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\r
+\r
+COLS_IN_ALPHA_INDEX    = 5\r
+\r
+# In case all classes in a project start with a common prefix, all classes will\r
+# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag\r
+# can be used to specify a prefix (or a list of prefixes) that should be ignored\r
+# while generating the index headers.\r
+# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.\r
+\r
+IGNORE_PREFIX          =\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the HTML output\r
+#---------------------------------------------------------------------------\r
+\r
+# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output\r
+# The default value is: YES.\r
+\r
+GENERATE_HTML          = YES\r
+\r
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a\r
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\r
+# it.\r
+# The default directory is: html.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_OUTPUT            = docs\r
+\r
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each\r
+# generated HTML page (for example: .htm, .php, .asp).\r
+# The default value is: .html.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_FILE_EXTENSION    = .html\r
+\r
+# The HTML_HEADER tag can be used to specify a user-defined HTML header file for\r
+# each generated HTML page. If the tag is left blank doxygen will generate a\r
+# standard header.\r
+#\r
+# To get valid HTML the header file that includes any scripts and style sheets\r
+# that doxygen needs, which is dependent on the configuration options used (e.g.\r
+# the setting GENERATE_TREEVIEW). It is highly recommended to start with a\r
+# default header using\r
+# doxygen -w html new_header.html new_footer.html new_stylesheet.css\r
+# YourConfigFile\r
+# and then modify the file new_header.html. See also section "Doxygen usage"\r
+# for information on how to generate the default header that doxygen normally\r
+# uses.\r
+# Note: The header is subject to change so you typically have to regenerate the\r
+# default header when upgrading to a newer version of doxygen. For a description\r
+# of the possible markers and block names see the documentation.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_HEADER            =\r
+\r
+# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each\r
+# generated HTML page. If the tag is left blank doxygen will generate a standard\r
+# footer. See HTML_HEADER for more information on how to generate a default\r
+# footer and what special commands can be used inside the footer. See also\r
+# section "Doxygen usage" for information on how to generate the default footer\r
+# that doxygen normally uses.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_FOOTER            =\r
+\r
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style\r
+# sheet that is used by each HTML page. It can be used to fine-tune the look of\r
+# the HTML output. If left blank doxygen will generate a default style sheet.\r
+# See also section "Doxygen usage" for information on how to generate the style\r
+# sheet that doxygen normally uses.\r
+# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as\r
+# it is more robust and this tag (HTML_STYLESHEET) will in the future become\r
+# obsolete.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_STYLESHEET        =\r
+\r
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-\r
+# defined cascading style sheet that is included after the standard style sheets\r
+# created by doxygen. Using this option one can overrule certain style aspects.\r
+# This is preferred over using HTML_STYLESHEET since it does not replace the\r
+# standard style sheet and is therefor more robust against future updates.\r
+# Doxygen will copy the style sheet file to the output directory. For an example\r
+# see the documentation.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_EXTRA_STYLESHEET  =\r
+\r
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or\r
+# other source files which should be copied to the HTML output directory. Note\r
+# that these files will be copied to the base HTML output directory. Use the\r
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these\r
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that the\r
+# files will be copied as-is; there are no commands or markers available.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_EXTRA_FILES       =\r
+\r
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen\r
+# will adjust the colors in the stylesheet and background images according to\r
+# this color. Hue is specified as an angle on a colorwheel, see\r
+# http://en.wikipedia.org/wiki/Hue for more information. For instance the value\r
+# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300\r
+# purple, and 360 is red again.\r
+# Minimum value: 0, maximum value: 359, default value: 220.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_COLORSTYLE_HUE    = 220\r
+\r
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors\r
+# in the HTML output. For a value of 0 the output will use grayscales only. A\r
+# value of 255 will produce the most vivid colors.\r
+# Minimum value: 0, maximum value: 255, default value: 100.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_COLORSTYLE_SAT    = 100\r
+\r
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the\r
+# luminance component of the colors in the HTML output. Values below 100\r
+# gradually make the output lighter, whereas values above 100 make the output\r
+# darker. The value divided by 100 is the actual gamma applied, so 80 represents\r
+# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not\r
+# change the gamma.\r
+# Minimum value: 40, maximum value: 240, default value: 80.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_COLORSTYLE_GAMMA  = 80\r
+\r
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\r
+# page will contain the date and time when the page was generated. Setting this\r
+# to NO can help when comparing the output of multiple runs.\r
+# The default value is: YES.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_TIMESTAMP         = YES\r
+\r
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML\r
+# documentation will contain sections that can be hidden and shown after the\r
+# page has loaded.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_DYNAMIC_SECTIONS  = NO\r
+\r
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries\r
+# shown in the various tree structured indices initially; the user can expand\r
+# and collapse entries dynamically later on. Doxygen will expand the tree to\r
+# such a level that at most the specified number of entries are visible (unless\r
+# a fully collapsed tree already exceeds this amount). So setting the number of\r
+# entries 1 will produce a full collapsed tree by default. 0 is a special value\r
+# representing an infinite number of entries and will result in a full expanded\r
+# tree by default.\r
+# Minimum value: 0, maximum value: 9999, default value: 100.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+HTML_INDEX_NUM_ENTRIES = 100\r
+\r
+# If the GENERATE_DOCSET tag is set to YES, additional index files will be\r
+# generated that can be used as input for Apple's Xcode 3 integrated development\r
+# environment (see: http://developer.apple.com/tools/xcode/), introduced with\r
+# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a\r
+# Makefile in the HTML output directory. Running make will produce the docset in\r
+# that directory and running make install will install the docset in\r
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at\r
+# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html\r
+# for more information.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+GENERATE_DOCSET        = NO\r
+\r
+# This tag determines the name of the docset feed. A documentation feed provides\r
+# an umbrella under which multiple documentation sets from a single provider\r
+# (such as a company or product suite) can be grouped.\r
+# The default value is: Doxygen generated docs.\r
+# This tag requires that the tag GENERATE_DOCSET is set to YES.\r
+\r
+DOCSET_FEEDNAME        = "Doxygen generated docs"\r
+\r
+# This tag specifies a string that should uniquely identify the documentation\r
+# set bundle. This should be a reverse domain-name style string, e.g.\r
+# com.mycompany.MyDocSet. Doxygen will append .docset to the name.\r
+# The default value is: org.doxygen.Project.\r
+# This tag requires that the tag GENERATE_DOCSET is set to YES.\r
+\r
+DOCSET_BUNDLE_ID       = org.doxygen.Project\r
+\r
+# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify\r
+# the documentation publisher. This should be a reverse domain-name style\r
+# string, e.g. com.mycompany.MyDocSet.documentation.\r
+# The default value is: org.doxygen.Publisher.\r
+# This tag requires that the tag GENERATE_DOCSET is set to YES.\r
+\r
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher\r
+\r
+# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.\r
+# The default value is: Publisher.\r
+# This tag requires that the tag GENERATE_DOCSET is set to YES.\r
+\r
+DOCSET_PUBLISHER_NAME  = Publisher\r
+\r
+# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three\r
+# additional HTML index files: index.hhp, index.hhc, and index.hhk. The\r
+# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop\r
+# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on\r
+# Windows.\r
+#\r
+# The HTML Help Workshop contains a compiler that can convert all HTML output\r
+# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML\r
+# files are now used as the Windows 98 help format, and will replace the old\r
+# Windows help format (.hlp) on all Windows platforms in the future. Compressed\r
+# HTML files also contain an index, a table of contents, and you can search for\r
+# words in the documentation. The HTML workshop also contains a viewer for\r
+# compressed HTML files.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+GENERATE_HTMLHELP      = NO\r
+\r
+# The CHM_FILE tag can be used to specify the file name of the resulting .chm\r
+# file. You can add a path in front of the file if the result should not be\r
+# written to the html output directory.\r
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\r
+\r
+CHM_FILE               =\r
+\r
+# The HHC_LOCATION tag can be used to specify the location (absolute path\r
+# including file name) of the HTML help compiler ( hhc.exe). If non-empty\r
+# doxygen will try to run the HTML help compiler on the generated index.hhp.\r
+# The file has to be specified with full path.\r
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\r
+\r
+HHC_LOCATION           =\r
+\r
+# The GENERATE_CHI flag controls if a separate .chi index file is generated (\r
+# YES) or that it should be included in the master .chm file ( NO).\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\r
+\r
+GENERATE_CHI           = NO\r
+\r
+# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)\r
+# and project file content.\r
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\r
+\r
+CHM_INDEX_ENCODING     =\r
+\r
+# The BINARY_TOC flag controls whether a binary table of contents is generated (\r
+# YES) or a normal table of contents ( NO) in the .chm file.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\r
+\r
+BINARY_TOC             = NO\r
+\r
+# The TOC_EXPAND flag can be set to YES to add extra items for group members to\r
+# the table of contents of the HTML help documentation and to the tree view.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTMLHELP is set to YES.\r
+\r
+TOC_EXPAND             = YES\r
+\r
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and\r
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that\r
+# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help\r
+# (.qch) of the generated HTML documentation.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+GENERATE_QHP           = NO\r
+\r
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify\r
+# the file name of the resulting .qch file. The path specified is relative to\r
+# the HTML output folder.\r
+# This tag requires that the tag GENERATE_QHP is set to YES.\r
+\r
+QCH_FILE               =\r
+\r
+# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help\r
+# Project output. For more information please see Qt Help Project / Namespace\r
+# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).\r
+# The default value is: org.doxygen.Project.\r
+# This tag requires that the tag GENERATE_QHP is set to YES.\r
+\r
+QHP_NAMESPACE          = org.doxygen.Project\r
+\r
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt\r
+# Help Project output. For more information please see Qt Help Project / Virtual\r
+# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-\r
+# folders).\r
+# The default value is: doc.\r
+# This tag requires that the tag GENERATE_QHP is set to YES.\r
+\r
+QHP_VIRTUAL_FOLDER     = doc\r
+\r
+# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom\r
+# filter to add. For more information please see Qt Help Project / Custom\r
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\r
+# filters).\r
+# This tag requires that the tag GENERATE_QHP is set to YES.\r
+\r
+QHP_CUST_FILTER_NAME   =\r
+\r
+# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the\r
+# custom filter to add. For more information please see Qt Help Project / Custom\r
+# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-\r
+# filters).\r
+# This tag requires that the tag GENERATE_QHP is set to YES.\r
+\r
+QHP_CUST_FILTER_ATTRS  =\r
+\r
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this\r
+# project's filter section matches. Qt Help Project / Filter Attributes (see:\r
+# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).\r
+# This tag requires that the tag GENERATE_QHP is set to YES.\r
+\r
+QHP_SECT_FILTER_ATTRS  =\r
+\r
+# The QHG_LOCATION tag can be used to specify the location of Qt's\r
+# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the\r
+# generated .qhp file.\r
+# This tag requires that the tag GENERATE_QHP is set to YES.\r
+\r
+QHG_LOCATION           =\r
+\r
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be\r
+# generated, together with the HTML files, they form an Eclipse help plugin. To\r
+# install this plugin and make it available under the help contents menu in\r
+# Eclipse, the contents of the directory containing the HTML and XML files needs\r
+# to be copied into the plugins directory of eclipse. The name of the directory\r
+# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.\r
+# After copying Eclipse needs to be restarted before the help appears.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+GENERATE_ECLIPSEHELP   = NO\r
+\r
+# A unique identifier for the Eclipse help plugin. When installing the plugin\r
+# the directory name containing the HTML and XML files should also have this\r
+# name. Each documentation set should have its own identifier.\r
+# The default value is: org.doxygen.Project.\r
+# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.\r
+\r
+ECLIPSE_DOC_ID         = org.doxygen.Project\r
+\r
+# If you want full control over the layout of the generated HTML pages it might\r
+# be necessary to disable the index and replace it with your own. The\r
+# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top\r
+# of each HTML page. A value of NO enables the index and the value YES disables\r
+# it. Since the tabs in the index contain the same information as the navigation\r
+# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+DISABLE_INDEX          = NO\r
+\r
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\r
+# structure should be generated to display hierarchical information. If the tag\r
+# value is set to YES, a side panel will be generated containing a tree-like\r
+# index structure (just like the one that is generated for HTML Help). For this\r
+# to work a browser that supports JavaScript, DHTML, CSS and frames is required\r
+# (i.e. any modern browser). Windows users are probably better off using the\r
+# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can\r
+# further fine-tune the look of the index. As an example, the default style\r
+# sheet generated by doxygen has an example that shows how to put an image at\r
+# the root of the tree instead of the PROJECT_NAME. Since the tree basically has\r
+# the same information as the tab index, you could consider setting\r
+# DISABLE_INDEX to YES when enabling this option.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+GENERATE_TREEVIEW      = NO\r
+\r
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that\r
+# doxygen will group on one line in the generated HTML documentation.\r
+#\r
+# Note that a value of 0 will completely suppress the enum values from appearing\r
+# in the overview section.\r
+# Minimum value: 0, maximum value: 20, default value: 4.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+ENUM_VALUES_PER_LINE   = 4\r
+\r
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used\r
+# to set the initial width (in pixels) of the frame in which the tree is shown.\r
+# Minimum value: 0, maximum value: 1500, default value: 250.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+TREEVIEW_WIDTH         = 250\r
+\r
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to\r
+# external symbols imported via tag files in a separate window.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+EXT_LINKS_IN_WINDOW    = NO\r
+\r
+# Use this tag to change the font size of LaTeX formulas included as images in\r
+# the HTML documentation. When you change the font size after a successful\r
+# doxygen run you need to manually remove any form_*.png images from the HTML\r
+# output directory to force them to be regenerated.\r
+# Minimum value: 8, maximum value: 50, default value: 10.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+FORMULA_FONTSIZE       = 10\r
+\r
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images\r
+# generated for formulas are transparent PNGs. Transparent PNGs are not\r
+# supported properly for IE 6.0, but are supported on all modern browsers.\r
+#\r
+# Note that when changing this option you need to delete any form_*.png files in\r
+# the HTML output directory before the changes have effect.\r
+# The default value is: YES.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+FORMULA_TRANSPARENT    = YES\r
+\r
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see\r
+# http://www.mathjax.org) which uses client side Javascript for the rendering\r
+# instead of using prerendered bitmaps. Use this if you do not have LaTeX\r
+# installed or if you want to formulas look prettier in the HTML output. When\r
+# enabled you may also need to install MathJax separately and configure the path\r
+# to it using the MATHJAX_RELPATH option.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+USE_MATHJAX            = NO\r
+\r
+# When MathJax is enabled you can set the default output format to be used for\r
+# the MathJax output. See the MathJax site (see:\r
+# http://docs.mathjax.org/en/latest/output.html) for more details.\r
+# Possible values are: HTML-CSS (which is slower, but has the best\r
+# compatibility), NativeMML (i.e. MathML) and SVG.\r
+# The default value is: HTML-CSS.\r
+# This tag requires that the tag USE_MATHJAX is set to YES.\r
+\r
+MATHJAX_FORMAT         = HTML-CSS\r
+\r
+# When MathJax is enabled you need to specify the location relative to the HTML\r
+# output directory using the MATHJAX_RELPATH option. The destination directory\r
+# should contain the MathJax.js script. For instance, if the mathjax directory\r
+# is located at the same level as the HTML output directory, then\r
+# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax\r
+# Content Delivery Network so you can quickly see the result without installing\r
+# MathJax. However, it is strongly recommended to install a local copy of\r
+# MathJax from http://www.mathjax.org before deployment.\r
+# The default value is: http://cdn.mathjax.org/mathjax/latest.\r
+# This tag requires that the tag USE_MATHJAX is set to YES.\r
+\r
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest\r
+\r
+# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax\r
+# extension names that should be enabled during MathJax rendering. For example\r
+# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols\r
+# This tag requires that the tag USE_MATHJAX is set to YES.\r
+\r
+MATHJAX_EXTENSIONS     =\r
+\r
+# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces\r
+# of code that will be used on startup of the MathJax code. See the MathJax site\r
+# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an\r
+# example see the documentation.\r
+# This tag requires that the tag USE_MATHJAX is set to YES.\r
+\r
+MATHJAX_CODEFILE       =\r
+\r
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for\r
+# the HTML output. The underlying search engine uses javascript and DHTML and\r
+# should work on any modern browser. Note that when using HTML help\r
+# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)\r
+# there is already a search function so this one should typically be disabled.\r
+# For large projects the javascript based search engine can be slow, then\r
+# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to\r
+# search using the keyboard; to jump to the search box use <access key> + S\r
+# (what the <access key> is depends on the OS and browser, but it is typically\r
+# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down\r
+# key> to jump into the search results window, the results can be navigated\r
+# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel\r
+# the search. The filter options can be selected when the cursor is inside the\r
+# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>\r
+# to select a filter and <Enter> or <escape> to activate or cancel the filter\r
+# option.\r
+# The default value is: YES.\r
+# This tag requires that the tag GENERATE_HTML is set to YES.\r
+\r
+SEARCHENGINE           = YES\r
+\r
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be\r
+# implemented using a web server instead of a web client using Javascript. There\r
+# are two flavours of web server based searching depending on the\r
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for\r
+# searching and an index file used by the script. When EXTERNAL_SEARCH is\r
+# enabled the indexing and searching needs to be provided by external tools. See\r
+# the section "External Indexing and Searching" for details.\r
+# The default value is: NO.\r
+# This tag requires that the tag SEARCHENGINE is set to YES.\r
+\r
+SERVER_BASED_SEARCH    = NO\r
+\r
+# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP\r
+# script for searching. Instead the search results are written to an XML file\r
+# which needs to be processed by an external indexer. Doxygen will invoke an\r
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain the\r
+# search results.\r
+#\r
+# Doxygen ships with an example indexer ( doxyindexer) and search engine\r
+# (doxysearch.cgi) which are based on the open source search engine library\r
+# Xapian (see: http://xapian.org/).\r
+#\r
+# See the section "External Indexing and Searching" for details.\r
+# The default value is: NO.\r
+# This tag requires that the tag SEARCHENGINE is set to YES.\r
+\r
+EXTERNAL_SEARCH        = NO\r
+\r
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server\r
+# which will return the search results when EXTERNAL_SEARCH is enabled.\r
+#\r
+# Doxygen ships with an example indexer ( doxyindexer) and search engine\r
+# (doxysearch.cgi) which are based on the open source search engine library\r
+# Xapian (see: http://xapian.org/). See the section "External Indexing and\r
+# Searching" for details.\r
+# This tag requires that the tag SEARCHENGINE is set to YES.\r
+\r
+SEARCHENGINE_URL       =\r
+\r
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed\r
+# search data is written to a file for indexing by an external tool. With the\r
+# SEARCHDATA_FILE tag the name of this file can be specified.\r
+# The default file is: searchdata.xml.\r
+# This tag requires that the tag SEARCHENGINE is set to YES.\r
+\r
+SEARCHDATA_FILE        = searchdata.xml\r
+\r
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the\r
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is\r
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple\r
+# projects and redirect the results back to the right project.\r
+# This tag requires that the tag SEARCHENGINE is set to YES.\r
+\r
+EXTERNAL_SEARCH_ID     =\r
+\r
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen\r
+# projects other than the one defined by this configuration file, but that are\r
+# all added to the same external search index. Each project needs to have a\r
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of\r
+# to a relative location where the documentation can be found. The format is:\r
+# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...\r
+# This tag requires that the tag SEARCHENGINE is set to YES.\r
+\r
+EXTRA_SEARCH_MAPPINGS  =\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the LaTeX output\r
+#---------------------------------------------------------------------------\r
+\r
+# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.\r
+# The default value is: YES.\r
+\r
+GENERATE_LATEX         = NO\r
+\r
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a\r
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\r
+# it.\r
+# The default directory is: latex.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_OUTPUT           = latex\r
+\r
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be\r
+# invoked.\r
+#\r
+# Note that when enabling USE_PDFLATEX this option is only used for generating\r
+# bitmaps for formulas in the HTML output, but not in the Makefile that is\r
+# written to the output directory.\r
+# The default file is: latex.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_CMD_NAME         = latex\r
+\r
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate\r
+# index for LaTeX.\r
+# The default file is: makeindex.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+MAKEINDEX_CMD_NAME     = makeindex\r
+\r
+# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX\r
+# documents. This may be useful for small projects and may help to save some\r
+# trees in general.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+COMPACT_LATEX          = NO\r
+\r
+# The PAPER_TYPE tag can be used to set the paper type that is used by the\r
+# printer.\r
+# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x\r
+# 14 inches) and executive (7.25 x 10.5 inches).\r
+# The default value is: a4.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+PAPER_TYPE             = a4\r
+\r
+# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names\r
+# that should be included in the LaTeX output. To get the times font for\r
+# instance you can specify\r
+# EXTRA_PACKAGES=times\r
+# If left blank no extra packages will be included.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+EXTRA_PACKAGES         =\r
+\r
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the\r
+# generated LaTeX document. The header should contain everything until the first\r
+# chapter. If it is left blank doxygen will generate a standard header. See\r
+# section "Doxygen usage" for information on how to let doxygen write the\r
+# default header to a separate file.\r
+#\r
+# Note: Only use a user-defined header if you know what you are doing! The\r
+# following commands have a special meaning inside the header: $title,\r
+# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will\r
+# replace them by respectively the title of the page, the current date and time,\r
+# only the current date, the version number of doxygen, the project name (see\r
+# PROJECT_NAME), or the project number (see PROJECT_NUMBER).\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_HEADER           =\r
+\r
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the\r
+# generated LaTeX document. The footer should contain everything after the last\r
+# chapter. If it is left blank doxygen will generate a standard footer.\r
+#\r
+# Note: Only use a user-defined footer if you know what you are doing!\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_FOOTER           =\r
+\r
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or\r
+# other source files which should be copied to the LATEX_OUTPUT output\r
+# directory. Note that the files will be copied as-is; there are no commands or\r
+# markers available.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_EXTRA_FILES      =\r
+\r
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is\r
+# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will\r
+# contain links (just like the HTML output) instead of page references. This\r
+# makes the output suitable for online browsing using a PDF viewer.\r
+# The default value is: YES.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+PDF_HYPERLINKS         = YES\r
+\r
+# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate\r
+# the PDF file directly from the LaTeX files. Set this option to YES to get a\r
+# higher quality PDF documentation.\r
+# The default value is: YES.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+USE_PDFLATEX           = YES\r
+\r
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode\r
+# command to the generated LaTeX files. This will instruct LaTeX to keep running\r
+# if errors occur, instead of asking the user for help. This option is also used\r
+# when generating formulas in HTML.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_BATCHMODE        = NO\r
+\r
+# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the\r
+# index chapters (such as File Index, Compound Index, etc.) in the output.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_HIDE_INDICES     = NO\r
+\r
+# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source\r
+# code with syntax highlighting in the LaTeX output.\r
+#\r
+# Note that which sources are shown also depends on other settings such as\r
+# SOURCE_BROWSER.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_SOURCE_CODE      = NO\r
+\r
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the\r
+# bibliography, e.g. plainnat, or ieeetr. See\r
+# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.\r
+# The default value is: plain.\r
+# This tag requires that the tag GENERATE_LATEX is set to YES.\r
+\r
+LATEX_BIB_STYLE        = plain\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the RTF output\r
+#---------------------------------------------------------------------------\r
+\r
+# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The\r
+# RTF output is optimized for Word 97 and may not look too pretty with other RTF\r
+# readers/editors.\r
+# The default value is: NO.\r
+\r
+GENERATE_RTF           = NO\r
+\r
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a\r
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\r
+# it.\r
+# The default directory is: rtf.\r
+# This tag requires that the tag GENERATE_RTF is set to YES.\r
+\r
+RTF_OUTPUT             = rtf\r
+\r
+# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF\r
+# documents. This may be useful for small projects and may help to save some\r
+# trees in general.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_RTF is set to YES.\r
+\r
+COMPACT_RTF            = NO\r
+\r
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will\r
+# contain hyperlink fields. The RTF file will contain links (just like the HTML\r
+# output) instead of page references. This makes the output suitable for online\r
+# browsing using Word or some other Word compatible readers that support those\r
+# fields.\r
+#\r
+# Note: WordPad (write) and others do not support links.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_RTF is set to YES.\r
+\r
+RTF_HYPERLINKS         = NO\r
+\r
+# Load stylesheet definitions from file. Syntax is similar to doxygen's config\r
+# file, i.e. a series of assignments. You only have to provide replacements,\r
+# missing definitions are set to their default value.\r
+#\r
+# See also section "Doxygen usage" for information on how to generate the\r
+# default style sheet that doxygen normally uses.\r
+# This tag requires that the tag GENERATE_RTF is set to YES.\r
+\r
+RTF_STYLESHEET_FILE    =\r
+\r
+# Set optional variables used in the generation of an RTF document. Syntax is\r
+# similar to doxygen's config file. A template extensions file can be generated\r
+# using doxygen -e rtf extensionFile.\r
+# This tag requires that the tag GENERATE_RTF is set to YES.\r
+\r
+RTF_EXTENSIONS_FILE    =\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the man page output\r
+#---------------------------------------------------------------------------\r
+\r
+# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for\r
+# classes and files.\r
+# The default value is: NO.\r
+\r
+GENERATE_MAN           = NO\r
+\r
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a\r
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\r
+# it. A directory man3 will be created inside the directory specified by\r
+# MAN_OUTPUT.\r
+# The default directory is: man.\r
+# This tag requires that the tag GENERATE_MAN is set to YES.\r
+\r
+MAN_OUTPUT             = man\r
+\r
+# The MAN_EXTENSION tag determines the extension that is added to the generated\r
+# man pages. In case the manual section does not start with a number, the number\r
+# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is\r
+# optional.\r
+# The default value is: .3.\r
+# This tag requires that the tag GENERATE_MAN is set to YES.\r
+\r
+MAN_EXTENSION          = .3\r
+\r
+# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it\r
+# will generate one additional man file for each entity documented in the real\r
+# man page(s). These additional files only source the real man page, but without\r
+# them the man command would be unable to find the correct page.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_MAN is set to YES.\r
+\r
+MAN_LINKS              = NO\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the XML output\r
+#---------------------------------------------------------------------------\r
+\r
+# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that\r
+# captures the structure of the code including all documentation.\r
+# The default value is: NO.\r
+\r
+GENERATE_XML           = NO\r
+\r
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a\r
+# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of\r
+# it.\r
+# The default directory is: xml.\r
+# This tag requires that the tag GENERATE_XML is set to YES.\r
+\r
+XML_OUTPUT             = xml\r
+\r
+# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a\r
+# validating XML parser to check the syntax of the XML files.\r
+# This tag requires that the tag GENERATE_XML is set to YES.\r
+\r
+XML_SCHEMA             =\r
+\r
+# The XML_DTD tag can be used to specify a XML DTD, which can be used by a\r
+# validating XML parser to check the syntax of the XML files.\r
+# This tag requires that the tag GENERATE_XML is set to YES.\r
+\r
+XML_DTD                =\r
+\r
+# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program\r
+# listings (including syntax highlighting and cross-referencing information) to\r
+# the XML output. Note that enabling this will significantly increase the size\r
+# of the XML output.\r
+# The default value is: YES.\r
+# This tag requires that the tag GENERATE_XML is set to YES.\r
+\r
+XML_PROGRAMLISTING     = YES\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the DOCBOOK output\r
+#---------------------------------------------------------------------------\r
+\r
+# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files\r
+# that can be used to generate PDF.\r
+# The default value is: NO.\r
+\r
+GENERATE_DOCBOOK       = NO\r
+\r
+# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.\r
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in\r
+# front of it.\r
+# The default directory is: docbook.\r
+# This tag requires that the tag GENERATE_DOCBOOK is set to YES.\r
+\r
+DOCBOOK_OUTPUT         = docbook\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options for the AutoGen Definitions output\r
+#---------------------------------------------------------------------------\r
+\r
+# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen\r
+# Definitions (see http://autogen.sf.net) file that captures the structure of\r
+# the code including all documentation. Note that this feature is still\r
+# experimental and incomplete at the moment.\r
+# The default value is: NO.\r
+\r
+GENERATE_AUTOGEN_DEF   = NO\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the Perl module output\r
+#---------------------------------------------------------------------------\r
+\r
+# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module\r
+# file that captures the structure of the code including all documentation.\r
+#\r
+# Note that this feature is still experimental and incomplete at the moment.\r
+# The default value is: NO.\r
+\r
+GENERATE_PERLMOD       = NO\r
+\r
+# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary\r
+# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI\r
+# output from the Perl module output.\r
+# The default value is: NO.\r
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.\r
+\r
+PERLMOD_LATEX          = NO\r
+\r
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely\r
+# formatted so it can be parsed by a human reader. This is useful if you want to\r
+# understand what is going on. On the other hand, if this tag is set to NO the\r
+# size of the Perl module output will be much smaller and Perl will parse it\r
+# just the same.\r
+# The default value is: YES.\r
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.\r
+\r
+PERLMOD_PRETTY         = YES\r
+\r
+# The names of the make variables in the generated doxyrules.make file are\r
+# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful\r
+# so different doxyrules.make files included by the same Makefile don't\r
+# overwrite each other's variables.\r
+# This tag requires that the tag GENERATE_PERLMOD is set to YES.\r
+\r
+PERLMOD_MAKEVAR_PREFIX =\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the preprocessor\r
+#---------------------------------------------------------------------------\r
+\r
+# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all\r
+# C-preprocessor directives found in the sources and include files.\r
+# The default value is: YES.\r
+\r
+ENABLE_PREPROCESSING   = YES\r
+\r
+# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names\r
+# in the source code. If set to NO only conditional compilation will be\r
+# performed. Macro expansion can be done in a controlled way by setting\r
+# EXPAND_ONLY_PREDEF to YES.\r
+# The default value is: NO.\r
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\r
+\r
+MACRO_EXPANSION        = NO\r
+\r
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then\r
+# the macro expansion is limited to the macros specified with the PREDEFINED and\r
+# EXPAND_AS_DEFINED tags.\r
+# The default value is: NO.\r
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\r
+\r
+EXPAND_ONLY_PREDEF     = NO\r
+\r
+# If the SEARCH_INCLUDES tag is set to YES the includes files in the\r
+# INCLUDE_PATH will be searched if a #include is found.\r
+# The default value is: YES.\r
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\r
+\r
+SEARCH_INCLUDES        = YES\r
+\r
+# The INCLUDE_PATH tag can be used to specify one or more directories that\r
+# contain include files that are not input files but should be processed by the\r
+# preprocessor.\r
+# This tag requires that the tag SEARCH_INCLUDES is set to YES.\r
+\r
+INCLUDE_PATH           =\r
+\r
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard\r
+# patterns (like *.h and *.hpp) to filter out the header-files in the\r
+# directories. If left blank, the patterns specified with FILE_PATTERNS will be\r
+# used.\r
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\r
+\r
+INCLUDE_FILE_PATTERNS  =\r
+\r
+# The PREDEFINED tag can be used to specify one or more macro names that are\r
+# defined before the preprocessor is started (similar to the -D option of e.g.\r
+# gcc). The argument of the tag is a list of macros of the form: name or\r
+# name=definition (no spaces). If the definition and the "=" are omitted, "=1"\r
+# is assumed. To prevent a macro definition from being undefined via #undef or\r
+# recursively expanded use the := operator instead of the = operator.\r
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\r
+\r
+PREDEFINED             =\r
+\r
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this\r
+# tag can be used to specify a list of macro names that should be expanded. The\r
+# macro definition that is found in the sources will be used. Use the PREDEFINED\r
+# tag if you want to use a different macro definition that overrules the\r
+# definition found in the source code.\r
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\r
+\r
+EXPAND_AS_DEFINED      =\r
+\r
+# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will\r
+# remove all refrences to function-like macros that are alone on a line, have an\r
+# all uppercase name, and do not end with a semicolon. Such function macros are\r
+# typically used for boiler-plate code, and will confuse the parser if not\r
+# removed.\r
+# The default value is: YES.\r
+# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.\r
+\r
+SKIP_FUNCTION_MACROS   = YES\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to external references\r
+#---------------------------------------------------------------------------\r
+\r
+# The TAGFILES tag can be used to specify one or more tag files. For each tag\r
+# file the location of the external documentation should be added. The format of\r
+# a tag file without this location is as follows:\r
+# TAGFILES = file1 file2 ...\r
+# Adding location for the tag files is done as follows:\r
+# TAGFILES = file1=loc1 "file2 = loc2" ...\r
+# where loc1 and loc2 can be relative or absolute paths or URLs. See the\r
+# section "Linking to external documentation" for more information about the use\r
+# of tag files.\r
+# Note: Each tag file must have an unique name (where the name does NOT include\r
+# the path). If a tag file is not located in the directory in which doxygen is\r
+# run, you must also specify the path to the tagfile here.\r
+\r
+TAGFILES               =\r
+\r
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create a\r
+# tag file that is based on the input files it reads. See section "Linking to\r
+# external documentation" for more information about the usage of tag files.\r
+\r
+GENERATE_TAGFILE       =\r
+\r
+# If the ALLEXTERNALS tag is set to YES all external class will be listed in the\r
+# class index. If set to NO only the inherited external classes will be listed.\r
+# The default value is: NO.\r
+\r
+ALLEXTERNALS           = NO\r
+\r
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in\r
+# the modules index. If set to NO, only the current project's groups will be\r
+# listed.\r
+# The default value is: YES.\r
+\r
+EXTERNAL_GROUPS        = YES\r
+\r
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in\r
+# the related pages index. If set to NO, only the current project's pages will\r
+# be listed.\r
+# The default value is: YES.\r
+\r
+EXTERNAL_PAGES         = YES\r
+\r
+# The PERL_PATH should be the absolute path and name of the perl script\r
+# interpreter (i.e. the result of 'which perl').\r
+# The default file (with absolute path) is: /usr/bin/perl.\r
+\r
+PERL_PATH              = /usr/bin/perl\r
+\r
+#---------------------------------------------------------------------------\r
+# Configuration options related to the dot tool\r
+#---------------------------------------------------------------------------\r
+\r
+# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram\r
+# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to\r
+# NO turns the diagrams off. Note that this option also works with HAVE_DOT\r
+# disabled, but it is recommended to install and use dot, since it yields more\r
+# powerful graphs.\r
+# The default value is: YES.\r
+\r
+CLASS_DIAGRAMS         = YES\r
+\r
+# You can define message sequence charts within doxygen comments using the \msc\r
+# command. Doxygen will then run the mscgen tool (see:\r
+# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the\r
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where\r
+# the mscgen tool resides. If left empty the tool is assumed to be found in the\r
+# default search path.\r
+\r
+MSCGEN_PATH            =\r
+\r
+# You can include diagrams made with dia in doxygen documentation. Doxygen will\r
+# then run dia to produce the diagram and insert it in the documentation. The\r
+# DIA_PATH tag allows you to specify the directory where the dia binary resides.\r
+# If left empty dia is assumed to be found in the default search path.\r
+\r
+DIA_PATH               =\r
+\r
+# If set to YES, the inheritance and collaboration graphs will hide inheritance\r
+# and usage relations if the target is undocumented or is not a class.\r
+# The default value is: YES.\r
+\r
+HIDE_UNDOC_RELATIONS   = YES\r
+\r
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is\r
+# available from the path. This tool is part of Graphviz (see:\r
+# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent\r
+# Bell Labs. The other options in this section have no effect if this option is\r
+# set to NO\r
+# The default value is: NO.\r
+\r
+HAVE_DOT               = NO\r
+\r
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed\r
+# to run in parallel. When set to 0 doxygen will base this on the number of\r
+# processors available in the system. You can set it explicitly to a value\r
+# larger than 0 to get control over the balance between CPU load and processing\r
+# speed.\r
+# Minimum value: 0, maximum value: 32, default value: 0.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_NUM_THREADS        = 0\r
+\r
+# When you want a differently looking font n the dot files that doxygen\r
+# generates you can specify the font name using DOT_FONTNAME. You need to make\r
+# sure dot is able to find the font, which can be done by putting it in a\r
+# standard location or by setting the DOTFONTPATH environment variable or by\r
+# setting DOT_FONTPATH to the directory containing the font.\r
+# The default value is: Helvetica.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_FONTNAME           = Helvetica\r
+\r
+# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of\r
+# dot graphs.\r
+# Minimum value: 4, maximum value: 24, default value: 10.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_FONTSIZE           = 10\r
+\r
+# By default doxygen will tell dot to use the default font as specified with\r
+# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set\r
+# the path where dot can find it using this tag.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_FONTPATH           =\r
+\r
+# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for\r
+# each documented class showing the direct and indirect inheritance relations.\r
+# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+CLASS_GRAPH            = YES\r
+\r
+# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a\r
+# graph for each documented class showing the direct and indirect implementation\r
+# dependencies (inheritance, containment, and class references variables) of the\r
+# class with other documented classes.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+COLLABORATION_GRAPH    = YES\r
+\r
+# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for\r
+# groups, showing the direct groups dependencies.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+GROUP_GRAPHS           = YES\r
+\r
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and\r
+# collaboration diagrams in a style similar to the OMG's Unified Modeling\r
+# Language.\r
+# The default value is: NO.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+UML_LOOK               = NO\r
+\r
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside the\r
+# class node. If there are many fields or methods and many nodes the graph may\r
+# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the\r
+# number of items for each type to make the size more manageable. Set this to 0\r
+# for no limit. Note that the threshold may be exceeded by 50% before the limit\r
+# is enforced. So when you set the threshold to 10, up to 15 fields may appear,\r
+# but if the number exceeds 15, the total amount of fields shown is limited to\r
+# 10.\r
+# Minimum value: 0, maximum value: 100, default value: 10.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+UML_LIMIT_NUM_FIELDS   = 10\r
+\r
+# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and\r
+# collaboration graphs will show the relations between templates and their\r
+# instances.\r
+# The default value is: NO.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+TEMPLATE_RELATIONS     = NO\r
+\r
+# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to\r
+# YES then doxygen will generate a graph for each documented file showing the\r
+# direct and indirect include dependencies of the file with other documented\r
+# files.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+INCLUDE_GRAPH          = YES\r
+\r
+# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are\r
+# set to YES then doxygen will generate a graph for each documented file showing\r
+# the direct and indirect include dependencies of the file with other documented\r
+# files.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+INCLUDED_BY_GRAPH      = YES\r
+\r
+# If the CALL_GRAPH tag is set to YES then doxygen will generate a call\r
+# dependency graph for every global function or class method.\r
+#\r
+# Note that enabling this option will significantly increase the time of a run.\r
+# So in most cases it will be better to enable call graphs for selected\r
+# functions only using the \callgraph command.\r
+# The default value is: NO.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+CALL_GRAPH             = NO\r
+\r
+# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller\r
+# dependency graph for every global function or class method.\r
+#\r
+# Note that enabling this option will significantly increase the time of a run.\r
+# So in most cases it will be better to enable caller graphs for selected\r
+# functions only using the \callergraph command.\r
+# The default value is: NO.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+CALLER_GRAPH           = NO\r
+\r
+# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical\r
+# hierarchy of all classes instead of a textual one.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+GRAPHICAL_HIERARCHY    = YES\r
+\r
+# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the\r
+# dependencies a directory has on other directories in a graphical way. The\r
+# dependency relations are determined by the #include relations between the\r
+# files in the directories.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DIRECTORY_GRAPH        = YES\r
+\r
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images\r
+# generated by dot.\r
+# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order\r
+# to make the SVG files visible in IE 9+ (other browsers do not have this\r
+# requirement).\r
+# Possible values are: png, jpg, gif and svg.\r
+# The default value is: png.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_IMAGE_FORMAT       = png\r
+\r
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to\r
+# enable generation of interactive SVG images that allow zooming and panning.\r
+#\r
+# Note that this requires a modern browser other than Internet Explorer. Tested\r
+# and working are Firefox, Chrome, Safari, and Opera.\r
+# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make\r
+# the SVG files visible. Older versions of IE do not have SVG support.\r
+# The default value is: NO.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+INTERACTIVE_SVG        = NO\r
+\r
+# The DOT_PATH tag can be used to specify the path where the dot tool can be\r
+# found. If left blank, it is assumed the dot tool can be found in the path.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_PATH               =\r
+\r
+# The DOTFILE_DIRS tag can be used to specify one or more directories that\r
+# contain dot files that are included in the documentation (see the \dotfile\r
+# command).\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOTFILE_DIRS           =\r
+\r
+# The MSCFILE_DIRS tag can be used to specify one or more directories that\r
+# contain msc files that are included in the documentation (see the \mscfile\r
+# command).\r
+\r
+MSCFILE_DIRS           =\r
+\r
+# The DIAFILE_DIRS tag can be used to specify one or more directories that\r
+# contain dia files that are included in the documentation (see the \diafile\r
+# command).\r
+\r
+DIAFILE_DIRS           =\r
+\r
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes\r
+# that will be shown in the graph. If the number of nodes in a graph becomes\r
+# larger than this value, doxygen will truncate the graph, which is visualized\r
+# by representing a node as a red box. Note that doxygen if the number of direct\r
+# children of the root node in a graph is already larger than\r
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that\r
+# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.\r
+# Minimum value: 0, maximum value: 10000, default value: 50.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_GRAPH_MAX_NODES    = 50\r
+\r
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs\r
+# generated by dot. A depth value of 3 means that only nodes reachable from the\r
+# root by following a path via at most 3 edges will be shown. Nodes that lay\r
+# further from the root node will be omitted. Note that setting this option to 1\r
+# or 2 may greatly reduce the computation time needed for large code bases. Also\r
+# note that the size of a graph can be further restricted by\r
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.\r
+# Minimum value: 0, maximum value: 1000, default value: 0.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+MAX_DOT_GRAPH_DEPTH    = 0\r
+\r
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent\r
+# background. This is disabled by default, because dot on Windows does not seem\r
+# to support this out of the box.\r
+#\r
+# Warning: Depending on the platform used, enabling this option may lead to\r
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to\r
+# read).\r
+# The default value is: NO.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_TRANSPARENT        = NO\r
+\r
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output\r
+# files in one run (i.e. multiple -o and -T options on the command line). This\r
+# makes dot run faster, but since only newer versions of dot (>1.8.10) support\r
+# this, this feature is disabled by default.\r
+# The default value is: NO.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_MULTI_TARGETS      = NO\r
+\r
+# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page\r
+# explaining the meaning of the various boxes and arrows in the dot generated\r
+# graphs.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+GENERATE_LEGEND        = YES\r
+\r
+# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot\r
+# files that are used to generate the various graphs.\r
+# The default value is: YES.\r
+# This tag requires that the tag HAVE_DOT is set to YES.\r
+\r
+DOT_CLEANUP            = YES\r
diff --git a/readme.md b/readme.md
new file mode 100644 (file)
index 0000000..485e00f
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,324 @@
+TinyXML-2
+=========
+![TinyXML-2 Logo](http://www.grinninglizard.com/tinyxml2/TinyXML2_small.png)
+
+TinyXML-2 is a simple, small, efficient, C++ XML parser that can be 
+easily integrated into other programs.
+
+The master is hosted on github:
+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.
+-------------
+       
+In brief, TinyXML-2 parses an XML document, and builds from that a 
+Document Object Model (DOM) that can be read, modified, and saved.
+
+XML stands for "eXtensible Markup Language." It is a general purpose
+human and machine readable markup language to describe arbitrary data.
+All those random file formats created to store application data can 
+all be replaced with XML. One parser for everything.
+
+http://en.wikipedia.org/wiki/XML
+
+There are different ways to access and interact with XML data.
+TinyXML-2 uses a Document Object Model (DOM), meaning the XML data is parsed
+into a C++ objects that can be browsed and manipulated, and then 
+written to disk or another output stream. You can also construct an XML document 
+from scratch with C++ objects and write this to disk or another output
+stream. You can even use TinyXML-2 to stream XML programmatically from
+code without creating a document first.
+
+TinyXML-2 is designed to be easy and fast to learn. It is one header and
+one cpp file. Simply add these to your project and off you go. 
+There is an example file - xmltest.cpp - to get you started. 
+
+TinyXML-2 is released under the ZLib license, 
+so you can use it in open source or commercial code. The details
+of the license are at the top of every source file.
+
+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.
+-------------------
+
+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 also much bigger, 
+take longer to set up in 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-2 is now the focus of all development, well tested, and your
+best choice unless you have a requirement to maintain TinyXML-1 code.
+
+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.
+
+TinyXML-2 has no requirement for STL, but has also dropped all STL support. All
+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.  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.  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.  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.
+
+However, any sub-node of the Document, XMLElement, XMLText, etc, can only
+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
+
+#### Whitespace Preservation (default)
+
+Microsoft has an excellent article on white space: http://msdn.microsoft.com/en-us/library/ms256097.aspx
+
+By default, TinyXML-2 preserves white space in a (hopefully) sane way that is almost complient with the
+spec. (TinyXML-1 used a completely different model, much more similar to 'collapse', below.)
+
+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:
+
+       <element> Hello,  World</element>
+
+The leading space before the "Hello" and the double space after the comma are 
+preserved. Line-feeds are preserved, as in this example:
+
+       <element> Hello again,  
+                 World</element>
+
+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:
+
+       <document>
+               <data>1</data>
+               <data>2</data>
+               <data>3</data>
+       </document>
+
+       <document><data>1</data><data>2</data><data>3</data></document>
+
+#### Whitespace Collapse
+
+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. 
+
+TinyXML-2 supports this with the 'whitespace' parameter to the XMLDocument constructor.
+(The default is to preserve whitespace, as described above.)
+
+However, you may also use COLLAPSE_WHITESPACE, which will:
+
+* Remove leading and trailing whitespace
+* Convert newlines and line-feeds into a space character
+* Collapse a run of any number of space characters into a single space character
+
+Note that (currently) there is a performance impact for using COLLAPSE_WHITESPACE.
+It essentially causes the XML to be parsed twice.
+
+### Entities
+
+TinyXML-2 recognizes the pre-defined "character entities", meaning special
+characters. Namely:
+
+       &amp;   &
+       &lt;    <
+       &gt;    >
+       &quot;  "
+       &apos;  '
+
+These are recognized when the XML document is read, and translated to their
+UTF-8 equivalents. For instance, text with the XML of:
+
+       Far &amp; Away
+
+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. 
+
+Additionally, any character can be specified by its Unicode code point:
+The syntax "&#xA0;" or "&#160;" are both to the non-breaking space characher. 
+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
+
+#### Print to file
+You can directly use the convenience function:
+
+       XMLDocument doc;
+       ...
+       doc.SaveFile( "foo.xml" );
+
+Or the XMLPrinter class:
+
+       XMLPrinter printer( fp );
+       doc.Print( &printer );
+
+#### 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
+
+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.
+
+The Printer supports the streaming case. The following code
+prints out a trivially simple XML file without ever creating
+an XML document.
+
+       XMLPrinter printer( fp );
+       printer.OpenElement( "foo" );
+       printer.PushAttribute( "foo", "bar" );
+       printer.CloseElement();
+
+Examples
+--------
+
+#### Load and parse an XML file.
+
+       /* ------ Example 1: Load and parse an XML file. ---- */        
+       {
+               XMLDocument doc;
+               doc.LoadFile( "dream.xml" );
+       }
+
+#### Lookup information.
+
+       /* ------ Example 2: Lookup information. ---- */        
+       {
+               XMLDocument doc;
+               doc.LoadFile( "dream.xml" );
+
+               // Structure of the XML file:
+               // - Element "PLAY"      the root Element, which is the 
+               //                       FirstChildElement of the Document
+               // - - Element "TITLE"   child of the root PLAY Element
+               // - - - Text            child of the TITLE Element
+               
+               // Navigate to the title, using the convenience function,
+               // with a dangerous lack of error checking.
+               const char* title = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->GetText();
+               printf( "Name of play (1): %s\n", title );
+               
+               // Text is just another Node to TinyXML-2. The more
+               // general way to get to the XMLText:
+               XMLText* textNode = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" )->FirstChild()->ToText();
+               title = textNode->Value();
+               printf( "Name of play (2): %s\n", title );
+       }
+
+Using and Installing
+--------------------
+
+There are 2 files in TinyXML-2:
+* tinyxml2.cpp
+* tinyxml2.h
+
+And additionally a test file:
+* xmltest.cpp
+
+Simply compile and run. There is a visual studio 2010 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 are *nix and don't want 
+to use a build system.
+
+Versioning
+----------
+
+TinyXML-2 uses semantic versioning. http://semver.org/ Releases are now tagged in github.
+
+Note that the major version will (probably) change fairly rapidly. API changes are fairly
+common.
+
+Documentation
+-------------
+
+The documentation is build with Doxygen, using the 'dox' 
+configuration file.
+
+License
+-------
+
+TinyXML-2 is released under the zlib license:
+
+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.
+
+Permission is granted to anyone to use this software for any 
+purpose, including commercial applications, and to alter it and 
+redistribute it freely, subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must 
+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
+------------
+
+Thanks very much to everyone who sends suggestions, bugs, ideas, and 
+encouragement. It all helps, and makes this project fun.
+
+The original TinyXML-1 has many contributors, who all deserve thanks
+in shaping what is a very successful library. Extra thanks to Yves
+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 TinyXML-2 has been and is being improved
+by many contributors.
+
+Thanks to John Mackay at http://john.mackay.rosalilastudio.com for the TinyXML-2 logo!
+
+
diff --git a/resources/dream.xml b/resources/dream.xml
new file mode 100755 (executable)
index 0000000..0a0b17c
--- /dev/null
@@ -0,0 +1,4546 @@
+<?xml version="1.0"?>
+<!DOCTYPE PLAY SYSTEM "play.dtd">
+
+<PLAY>
+<TITLE>A Midsummer Night's Dream</TITLE>
+
+<FM>
+<P>Text placed in the public domain by Moby Lexical Tools, 1992.</P>
+<P>SGML markup by Jon Bosak, 1992-1994.</P>
+<P>XML version by Jon Bosak, 1996-1998.</P>
+<P>This work may be freely copied and distributed worldwide.</P>
+</FM>
+
+
+<PERSONAE>
+<TITLE>Dramatis Personae</TITLE>
+
+<PERSONA>THESEUS, Duke of Athens.</PERSONA>
+<PERSONA>EGEUS, father to Hermia.</PERSONA>
+
+<PGROUP>
+<PERSONA>LYSANDER</PERSONA>
+<PERSONA>DEMETRIUS</PERSONA>
+<GRPDESCR>in love with Hermia.</GRPDESCR>
+</PGROUP>
+
+<PERSONA>PHILOSTRATE, master of the revels to Theseus.</PERSONA>
+<PERSONA>QUINCE, a carpenter.</PERSONA>
+<PERSONA>SNUG, a joiner.</PERSONA>
+<PERSONA>BOTTOM, a weaver.</PERSONA>
+<PERSONA>FLUTE, a bellows-mender.</PERSONA>
+<PERSONA>SNOUT, a tinker.</PERSONA>
+<PERSONA>STARVELING, a tailor.</PERSONA>
+<PERSONA>HIPPOLYTA, queen of the Amazons, betrothed to Theseus.</PERSONA>
+<PERSONA>HERMIA, daughter to Egeus, in love with Lysander.</PERSONA>
+<PERSONA>HELENA, in love with Demetrius.</PERSONA>
+<PERSONA>OBERON, king of the fairies.</PERSONA>
+<PERSONA>TITANIA, queen of the fairies.</PERSONA>
+<PERSONA>PUCK, or Robin Goodfellow.</PERSONA>
+
+<PGROUP>
+<PERSONA>PEASEBLOSSOM</PERSONA>
+<PERSONA>COBWEB</PERSONA>
+<PERSONA>MOTH</PERSONA>
+<PERSONA>MUSTARDSEED</PERSONA>
+<GRPDESCR>fairies.</GRPDESCR>
+</PGROUP>
+
+<PERSONA>Other fairies attending their King and Queen.</PERSONA>
+<PERSONA>Attendants on Theseus and Hippolyta.</PERSONA>
+</PERSONAE>
+
+<SCNDESCR>SCENE  Athens, and a wood near it.</SCNDESCR>
+
+<PLAYSUBT>A MIDSUMMER NIGHT'S DREAM</PLAYSUBT>
+
+<ACT><TITLE>ACT I</TITLE>
+
+<SCENE><TITLE>SCENE I.  Athens. The palace of THESEUS.</TITLE>
+<STAGEDIR>Enter THESEUS, HIPPOLYTA, PHILOSTRATE, and
+Attendants</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Now, fair Hippolyta, our nuptial hour</LINE>
+<LINE>Draws on apace; four happy days bring in</LINE>
+<LINE>Another moon: but, O, methinks, how slow</LINE>
+<LINE>This old moon wanes! she lingers my desires,</LINE>
+<LINE>Like to a step-dame or a dowager</LINE>
+<LINE>Long withering out a young man revenue.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>Four days will quickly steep themselves in night;</LINE>
+<LINE>Four nights will quickly dream away the time;</LINE>
+<LINE>And then the moon, like to a silver bow</LINE>
+<LINE>New-bent in heaven, shall behold the night</LINE>
+<LINE>Of our solemnities.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Go, Philostrate,</LINE>
+<LINE>Stir up the Athenian youth to merriments;</LINE>
+<LINE>Awake the pert and nimble spirit of mirth;</LINE>
+<LINE>Turn melancholy forth to funerals;</LINE>
+<LINE>The pale companion is not for our pomp.</LINE>
+<STAGEDIR>Exit PHILOSTRATE</STAGEDIR>
+<LINE>Hippolyta, I woo'd thee with my sword,</LINE>
+<LINE>And won thy love, doing thee injuries;</LINE>
+<LINE>But I will wed thee in another key,</LINE>
+<LINE>With pomp, with triumph and with revelling.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter EGEUS, HERMIA, LYSANDER, and DEMETRIUS</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>EGEUS</SPEAKER>
+<LINE>Happy be Theseus, our renowned duke!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Thanks, good Egeus: what's the news with thee?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>EGEUS</SPEAKER>
+<LINE>Full of vexation come I, with complaint</LINE>
+<LINE>Against my child, my daughter Hermia.</LINE>
+<LINE>Stand forth, Demetrius. My noble lord,</LINE>
+<LINE>This man hath my consent to marry her.</LINE>
+<LINE>Stand forth, Lysander: and my gracious duke,</LINE>
+<LINE>This man hath bewitch'd the bosom of my child;</LINE>
+<LINE>Thou, thou, Lysander, thou hast given her rhymes,</LINE>
+<LINE>And interchanged love-tokens with my child:</LINE>
+<LINE>Thou hast by moonlight at her window sung,</LINE>
+<LINE>With feigning voice verses of feigning love,</LINE>
+<LINE>And stolen the impression of her fantasy</LINE>
+<LINE>With bracelets of thy hair, rings, gawds, conceits,</LINE>
+<LINE>Knacks, trifles, nosegays, sweetmeats, messengers</LINE>
+<LINE>Of strong prevailment in unharden'd youth:</LINE>
+<LINE>With cunning hast thou filch'd my daughter's heart,</LINE>
+<LINE>Turn'd her obedience, which is due to me,</LINE>
+<LINE>To stubborn harshness: and, my gracious duke,</LINE>
+<LINE>Be it so she; will not here before your grace</LINE>
+<LINE>Consent to marry with Demetrius,</LINE>
+<LINE>I beg the ancient privilege of Athens,</LINE>
+<LINE>As she is mine, I may dispose of her:</LINE>
+<LINE>Which shall be either to this gentleman</LINE>
+<LINE>Or to her death, according to our law</LINE>
+<LINE>Immediately provided in that case.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>What say you, Hermia? be advised fair maid:</LINE>
+<LINE>To you your father should be as a god;</LINE>
+<LINE>One that composed your beauties, yea, and one</LINE>
+<LINE>To whom you are but as a form in wax</LINE>
+<LINE>By him imprinted and within his power</LINE>
+<LINE>To leave the figure or disfigure it.</LINE>
+<LINE>Demetrius is a worthy gentleman.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>So is Lysander.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>In himself he is;</LINE>
+<LINE>But in this kind, wanting your father's voice,</LINE>
+<LINE>The other must be held the worthier.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>I would my father look'd but with my eyes.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Rather your eyes must with his judgment look.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>I do entreat your grace to pardon me.</LINE>
+<LINE>I know not by what power I am made bold,</LINE>
+<LINE>Nor how it may concern my modesty,</LINE>
+<LINE>In such a presence here to plead my thoughts;</LINE>
+<LINE>But I beseech your grace that I may know</LINE>
+<LINE>The worst that may befall me in this case,</LINE>
+<LINE>If I refuse to wed Demetrius.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Either to die the death or to abjure</LINE>
+<LINE>For ever the society of men.</LINE>
+<LINE>Therefore, fair Hermia, question your desires;</LINE>
+<LINE>Know of your youth, examine well your blood,</LINE>
+<LINE>Whether, if you yield not to your father's choice,</LINE>
+<LINE>You can endure the livery of a nun,</LINE>
+<LINE>For aye to be in shady cloister mew'd,</LINE>
+<LINE>To live a barren sister all your life,</LINE>
+<LINE>Chanting faint hymns to the cold fruitless moon.</LINE>
+<LINE>Thrice-blessed they that master so their blood,</LINE>
+<LINE>To undergo such maiden pilgrimage;</LINE>
+<LINE>But earthlier happy is the rose distill'd,</LINE>
+<LINE>Than that which withering on the virgin thorn</LINE>
+<LINE>Grows, lives and dies in single blessedness.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>So will I grow, so live, so die, my lord,</LINE>
+<LINE>Ere I will my virgin patent up</LINE>
+<LINE>Unto his lordship, whose unwished yoke</LINE>
+<LINE>My soul consents not to give sovereignty.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Take time to pause; and, by the nest new moon--</LINE>
+<LINE>The sealing-day betwixt my love and me,</LINE>
+<LINE>For everlasting bond of fellowship--</LINE>
+<LINE>Upon that day either prepare to die</LINE>
+<LINE>For disobedience to your father's will,</LINE>
+<LINE>Or else to wed Demetrius, as he would;</LINE>
+<LINE>Or on Diana's altar to protest</LINE>
+<LINE>For aye austerity and single life.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Relent, sweet Hermia: and, Lysander, yield</LINE>
+<LINE>Thy crazed title to my certain right.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>You have her father's love, Demetrius;</LINE>
+<LINE>Let me have Hermia's: do you marry him.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>EGEUS</SPEAKER>
+<LINE>Scornful Lysander! true, he hath my love,</LINE>
+<LINE>And what is mine my love shall render him.</LINE>
+<LINE>And she is mine, and all my right of her</LINE>
+<LINE>I do estate unto Demetrius.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>I am, my lord, as well derived as he,</LINE>
+<LINE>As well possess'd; my love is more than his;</LINE>
+<LINE>My fortunes every way as fairly rank'd,</LINE>
+<LINE>If not with vantage, as Demetrius';</LINE>
+<LINE>And, which is more than all these boasts can be,</LINE>
+<LINE>I am beloved of beauteous Hermia:</LINE>
+<LINE>Why should not I then prosecute my right?</LINE>
+<LINE>Demetrius, I'll avouch it to his head,</LINE>
+<LINE>Made love to Nedar's daughter, Helena,</LINE>
+<LINE>And won her soul; and she, sweet lady, dotes,</LINE>
+<LINE>Devoutly dotes, dotes in idolatry,</LINE>
+<LINE>Upon this spotted and inconstant man.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>I must confess that I have heard so much,</LINE>
+<LINE>And with Demetrius thought to have spoke thereof;</LINE>
+<LINE>But, being over-full of self-affairs,</LINE>
+<LINE>My mind did lose it. But, Demetrius, come;</LINE>
+<LINE>And come, Egeus; you shall go with me,</LINE>
+<LINE>I have some private schooling for you both.</LINE>
+<LINE>For you, fair Hermia, look you arm yourself</LINE>
+<LINE>To fit your fancies to your father's will;</LINE>
+<LINE>Or else the law of Athens yields you up--</LINE>
+<LINE>Which by no means we may extenuate--</LINE>
+<LINE>To death, or to a vow of single life.</LINE>
+<LINE>Come, my Hippolyta: what cheer, my love?</LINE>
+<LINE>Demetrius and Egeus, go along:</LINE>
+<LINE>I must employ you in some business</LINE>
+<LINE>Against our nuptial and confer with you</LINE>
+<LINE>Of something nearly that concerns yourselves.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>EGEUS</SPEAKER>
+<LINE>With duty and desire we follow you.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt all but LYSANDER and HERMIA</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>How now, my love! why is your cheek so pale?</LINE>
+<LINE>How chance the roses there do fade so fast?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Belike for want of rain, which I could well</LINE>
+<LINE>Beteem them from the tempest of my eyes.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Ay me! for aught that I could ever read,</LINE>
+<LINE>Could ever hear by tale or history,</LINE>
+<LINE>The course of true love never did run smooth;</LINE>
+<LINE>But, either it was different in blood,--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>O cross! too high to be enthrall'd to low.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Or else misgraffed in respect of years,--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>O spite! too old to be engaged to young.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Or else it stood upon the choice of friends,--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>O hell! to choose love by another's eyes.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Or, if there were a sympathy in choice,</LINE>
+<LINE>War, death, or sickness did lay siege to it,</LINE>
+<LINE>Making it momentany as a sound,</LINE>
+<LINE>Swift as a shadow, short as any dream;</LINE>
+<LINE>Brief as the lightning in the collied night,</LINE>
+<LINE>That, in a spleen, unfolds both heaven and earth,</LINE>
+<LINE>And ere a man hath power to say 'Behold!'</LINE>
+<LINE>The jaws of darkness do devour it up:</LINE>
+<LINE>So quick bright things come to confusion.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>If then true lovers have been ever cross'd,</LINE>
+<LINE>It stands as an edict in destiny:</LINE>
+<LINE>Then let us teach our trial patience,</LINE>
+<LINE>Because it is a customary cross,</LINE>
+<LINE>As due to love as thoughts and dreams and sighs,</LINE>
+<LINE>Wishes and tears, poor fancy's followers.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>A good persuasion: therefore, hear me, Hermia.</LINE>
+<LINE>I have a widow aunt, a dowager</LINE>
+<LINE>Of great revenue, and she hath no child:</LINE>
+<LINE>From Athens is her house remote seven leagues;</LINE>
+<LINE>And she respects me as her only son.</LINE>
+<LINE>There, gentle Hermia, may I marry thee;</LINE>
+<LINE>And to that place the sharp Athenian law</LINE>
+<LINE>Cannot pursue us. If thou lovest me then,</LINE>
+<LINE>Steal forth thy father's house to-morrow night;</LINE>
+<LINE>And in the wood, a league without the town,</LINE>
+<LINE>Where I did meet thee once with Helena,</LINE>
+<LINE>To do observance to a morn of May,</LINE>
+<LINE>There will I stay for thee.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>My good Lysander!</LINE>
+<LINE>I swear to thee, by Cupid's strongest bow,</LINE>
+<LINE>By his best arrow with the golden head,</LINE>
+<LINE>By the simplicity of Venus' doves,</LINE>
+<LINE>By that which knitteth souls and prospers loves,</LINE>
+<LINE>And by that fire which burn'd the Carthage queen,</LINE>
+<LINE>When the false Troyan under sail was seen,</LINE>
+<LINE>By all the vows that ever men have broke,</LINE>
+<LINE>In number more than ever women spoke,</LINE>
+<LINE>In that same place thou hast appointed me,</LINE>
+<LINE>To-morrow truly will I meet with thee.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Keep promise, love. Look, here comes Helena.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter HELENA</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>God speed fair Helena! whither away?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Call you me fair? that fair again unsay.</LINE>
+<LINE>Demetrius loves your fair: O happy fair!</LINE>
+<LINE>Your eyes are lode-stars; and your tongue's sweet air</LINE>
+<LINE>More tuneable than lark to shepherd's ear,</LINE>
+<LINE>When wheat is green, when hawthorn buds appear.</LINE>
+<LINE>Sickness is catching: O, were favour so,</LINE>
+<LINE>Yours would I catch, fair Hermia, ere I go;</LINE>
+<LINE>My ear should catch your voice, my eye your eye,</LINE>
+<LINE>My tongue should catch your tongue's sweet melody.</LINE>
+<LINE>Were the world mine, Demetrius being bated,</LINE>
+<LINE>The rest I'd give to be to you translated.</LINE>
+<LINE>O, teach me how you look, and with what art</LINE>
+<LINE>You sway the motion of Demetrius' heart.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>I frown upon him, yet he loves me still.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>O that your frowns would teach my smiles such skill!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>I give him curses, yet he gives me love.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>O that my prayers could such affection move!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>The more I hate, the more he follows me.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>The more I love, the more he hateth me.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>His folly, Helena, is no fault of mine.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>None, but your beauty: would that fault were mine!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Take comfort: he no more shall see my face;</LINE>
+<LINE>Lysander and myself will fly this place.</LINE>
+<LINE>Before the time I did Lysander see,</LINE>
+<LINE>Seem'd Athens as a paradise to me:</LINE>
+<LINE>O, then, what graces in my love do dwell,</LINE>
+<LINE>That he hath turn'd a heaven unto a hell!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Helen, to you our minds we will unfold:</LINE>
+<LINE>To-morrow night, when Phoebe doth behold</LINE>
+<LINE>Her silver visage in the watery glass,</LINE>
+<LINE>Decking with liquid pearl the bladed grass,</LINE>
+<LINE>A time that lovers' flights doth still conceal,</LINE>
+<LINE>Through Athens' gates have we devised to steal.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>And in the wood, where often you and I</LINE>
+<LINE>Upon faint primrose-beds were wont to lie,</LINE>
+<LINE>Emptying our bosoms of their counsel sweet,</LINE>
+<LINE>There my Lysander and myself shall meet;</LINE>
+<LINE>And thence from Athens turn away our eyes,</LINE>
+<LINE>To seek new friends and stranger companies.</LINE>
+<LINE>Farewell, sweet playfellow: pray thou for us;</LINE>
+<LINE>And good luck grant thee thy Demetrius!</LINE>
+<LINE>Keep word, Lysander: we must starve our sight</LINE>
+<LINE>From lovers' food till morrow deep midnight.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>I will, my Hermia.</LINE>
+<STAGEDIR>Exit HERMIA</STAGEDIR>
+<LINE>Helena, adieu:</LINE>
+<LINE>As you on him, Demetrius dote on you!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>How happy some o'er other some can be!</LINE>
+<LINE>Through Athens I am thought as fair as she.</LINE>
+<LINE>But what of that? Demetrius thinks not so;</LINE>
+<LINE>He will not know what all but he do know:</LINE>
+<LINE>And as he errs, doting on Hermia's eyes,</LINE>
+<LINE>So I, admiring of his qualities:</LINE>
+<LINE>Things base and vile, folding no quantity,</LINE>
+<LINE>Love can transpose to form and dignity:</LINE>
+<LINE>Love looks not with the eyes, but with the mind;</LINE>
+<LINE>And therefore is wing'd Cupid painted blind:</LINE>
+<LINE>Nor hath Love's mind of any judgement taste;</LINE>
+<LINE>Wings and no eyes figure unheedy haste:</LINE>
+<LINE>And therefore is Love said to be a child,</LINE>
+<LINE>Because in choice he is so oft beguiled.</LINE>
+<LINE>As waggish boys in game themselves forswear,</LINE>
+<LINE>So the boy Love is perjured every where:</LINE>
+<LINE>For ere Demetrius look'd on Hermia's eyne,</LINE>
+<LINE>He hail'd down oaths that he was only mine;</LINE>
+<LINE>And when this hail some heat from Hermia felt,</LINE>
+<LINE>So he dissolved, and showers of oaths did melt.</LINE>
+<LINE>I will go tell him of fair Hermia's flight:</LINE>
+<LINE>Then to the wood will he to-morrow night</LINE>
+<LINE>Pursue her; and for this intelligence</LINE>
+<LINE>If I have thanks, it is a dear expense:</LINE>
+<LINE>But herein mean I to enrich my pain,</LINE>
+<LINE>To have his sight thither and back again.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+</SCENE>
+
+<SCENE><TITLE>SCENE II.  Athens. QUINCE'S house.</TITLE>
+<STAGEDIR>Enter QUINCE, SNUG, BOTTOM, FLUTE, SNOUT, and
+STARVELING</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Is all our company here?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>You were best to call them generally, man by man,</LINE>
+<LINE>according to the scrip.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Here is the scroll of every man's name, which is</LINE>
+<LINE>thought fit, through all Athens, to play in our</LINE>
+<LINE>interlude before the duke and the duchess, on his</LINE>
+<LINE>wedding-day at night.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>First, good Peter Quince, say what the play treats</LINE>
+<LINE>on, then read the names of the actors, and so grow</LINE>
+<LINE>to a point.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Marry, our play is, The most lamentable comedy, and</LINE>
+<LINE>most cruel death of Pyramus and Thisby.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>A very good piece of work, I assure you, and a</LINE>
+<LINE>merry. Now, good Peter Quince, call forth your</LINE>
+<LINE>actors by the scroll. Masters, spread yourselves.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Answer as I call you. Nick Bottom, the weaver.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Ready. Name what part I am for, and proceed.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>You, Nick Bottom, are set down for Pyramus.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>What is Pyramus? a lover, or a tyrant?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>A lover, that kills himself most gallant for love.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>That will ask some tears in the true performing of</LINE>
+<LINE>it: if I do it, let the audience look to their</LINE>
+<LINE>eyes; I will move storms, I will condole in some</LINE>
+<LINE>measure. To the rest: yet my chief humour is for a</LINE>
+<LINE>tyrant: I could play Ercles rarely, or a part to</LINE>
+<LINE>tear a cat in, to make all split.</LINE>
+<LINE>The raging rocks</LINE>
+<LINE>And shivering shocks</LINE>
+<LINE>Shall break the locks</LINE>
+<LINE>Of prison gates;</LINE>
+<LINE>And Phibbus' car</LINE>
+<LINE>Shall shine from far</LINE>
+<LINE>And make and mar</LINE>
+<LINE>The foolish Fates.</LINE>
+<LINE>This was lofty! Now name the rest of the players.</LINE>
+<LINE>This is Ercles' vein, a tyrant's vein; a lover is</LINE>
+<LINE>more condoling.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Francis Flute, the bellows-mender.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>Here, Peter Quince.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Flute, you must take Thisby on you.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>What is Thisby? a wandering knight?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>It is the lady that Pyramus must love.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>Nay, faith, let me not play a woman; I have a beard coming.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>That's all one: you shall play it in a mask, and</LINE>
+<LINE>you may speak as small as you will.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>An I may hide my face, let me play Thisby too, I'll</LINE>
+<LINE>speak in a monstrous little voice. 'Thisne,</LINE>
+<LINE>Thisne;' 'Ah, Pyramus, lover dear! thy Thisby dear,</LINE>
+<LINE>and lady dear!'</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>No, no; you must play Pyramus: and, Flute, you Thisby.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Well, proceed.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Robin Starveling, the tailor.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>STARVELING</SPEAKER>
+<LINE>Here, Peter Quince.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Robin Starveling, you must play Thisby's mother.</LINE>
+<LINE>Tom Snout, the tinker.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>SNOUT</SPEAKER>
+<LINE>Here, Peter Quince.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>You, Pyramus' father: myself, Thisby's father:</LINE>
+<LINE>Snug, the joiner; you, the lion's part: and, I</LINE>
+<LINE>hope, here is a play fitted.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>SNUG</SPEAKER>
+<LINE>Have you the lion's part written? pray you, if it</LINE>
+<LINE>be, give it me, for I am slow of study.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>You may do it extempore, for it is nothing but roaring.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Let me play the lion too: I will roar, that I will</LINE>
+<LINE>do any man's heart good to hear me; I will roar,</LINE>
+<LINE>that I will make the duke say 'Let him roar again,</LINE>
+<LINE>let him roar again.'</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>An you should do it too terribly, you would fright</LINE>
+<LINE>the duchess and the ladies, that they would shriek;</LINE>
+<LINE>and that were enough to hang us all.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>ALL</SPEAKER>
+<LINE>That would hang us, every mother's son.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>I grant you, friends, if that you should fright the</LINE>
+<LINE>ladies out of their wits, they would have no more</LINE>
+<LINE>discretion but to hang us: but I will aggravate my</LINE>
+<LINE>voice so that I will roar you as gently as any</LINE>
+<LINE>sucking dove; I will roar you an 'twere any</LINE>
+<LINE>nightingale.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>You can play no part but Pyramus; for Pyramus is a</LINE>
+<LINE>sweet-faced man; a proper man, as one shall see in a</LINE>
+<LINE>summer's day; a most lovely gentleman-like man:</LINE>
+<LINE>therefore you must needs play Pyramus.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Well, I will undertake it. What beard were I best</LINE>
+<LINE>to play it in?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Why, what you will.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>I will discharge it in either your straw-colour</LINE>
+<LINE>beard, your orange-tawny beard, your purple-in-grain</LINE>
+<LINE>beard, or your French-crown-colour beard, your</LINE>
+<LINE>perfect yellow.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Some of your French crowns have no hair at all, and</LINE>
+<LINE>then you will play bare-faced. But, masters, here</LINE>
+<LINE>are your parts: and I am to entreat you, request</LINE>
+<LINE>you and desire you, to con them by to-morrow night;</LINE>
+<LINE>and meet me in the palace wood, a mile without the</LINE>
+<LINE>town, by moonlight; there will we rehearse, for if</LINE>
+<LINE>we meet in the city, we shall be dogged with</LINE>
+<LINE>company, and our devices known. In the meantime I</LINE>
+<LINE>will draw a bill of properties, such as our play</LINE>
+<LINE>wants. I pray you, fail me not.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>We will meet; and there we may rehearse most</LINE>
+<LINE>obscenely and courageously. Take pains; be perfect: adieu.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>At the duke's oak we meet.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Enough; hold or cut bow-strings.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt</STAGEDIR>
+</SCENE>
+
+</ACT>
+
+<ACT><TITLE>ACT II</TITLE>
+
+<SCENE><TITLE>SCENE I.  A wood near Athens.</TITLE>
+<STAGEDIR>Enter, from opposite sides, a Fairy, and PUCK</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>How now, spirit! whither wander you?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Fairy</SPEAKER>
+<LINE>Over hill, over dale,</LINE>
+<LINE>Thorough bush, thorough brier,</LINE>
+<LINE>Over park, over pale,</LINE>
+<LINE>Thorough flood, thorough fire,</LINE>
+<LINE>I do wander everywhere,</LINE>
+<LINE>Swifter than the moon's sphere;</LINE>
+<LINE>And I serve the fairy queen,</LINE>
+<LINE>To dew her orbs upon the green.</LINE>
+<LINE>The cowslips tall her pensioners be:</LINE>
+<LINE>In their gold coats spots you see;</LINE>
+<LINE>Those be rubies, fairy favours,</LINE>
+<LINE>In those freckles live their savours:</LINE>
+<LINE>I must go seek some dewdrops here</LINE>
+<LINE>And hang a pearl in every cowslip's ear.</LINE>
+<LINE>Farewell, thou lob of spirits; I'll be gone:</LINE>
+<LINE>Our queen and all our elves come here anon.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>The king doth keep his revels here to-night:</LINE>
+<LINE>Take heed the queen come not within his sight;</LINE>
+<LINE>For Oberon is passing fell and wrath,</LINE>
+<LINE>Because that she as her attendant hath</LINE>
+<LINE>A lovely boy, stolen from an Indian king;</LINE>
+<LINE>She never had so sweet a changeling;</LINE>
+<LINE>And jealous Oberon would have the child</LINE>
+<LINE>Knight of his train, to trace the forests wild;</LINE>
+<LINE>But she perforce withholds the loved boy,</LINE>
+<LINE>Crowns him with flowers and makes him all her joy:</LINE>
+<LINE>And now they never meet in grove or green,</LINE>
+<LINE>By fountain clear, or spangled starlight sheen,</LINE>
+<LINE>But, they do square, that all their elves for fear</LINE>
+<LINE>Creep into acorn-cups and hide them there.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Fairy</SPEAKER>
+<LINE>Either I mistake your shape and making quite,</LINE>
+<LINE>Or else you are that shrewd and knavish sprite</LINE>
+<LINE>Call'd Robin Goodfellow: are not you he</LINE>
+<LINE>That frights the maidens of the villagery;</LINE>
+<LINE>Skim milk, and sometimes labour in the quern</LINE>
+<LINE>And bootless make the breathless housewife churn;</LINE>
+<LINE>And sometime make the drink to bear no barm;</LINE>
+<LINE>Mislead night-wanderers, laughing at their harm?</LINE>
+<LINE>Those that Hobgoblin call you and sweet Puck,</LINE>
+<LINE>You do their work, and they shall have good luck:</LINE>
+<LINE>Are not you he?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Thou speak'st aright;</LINE>
+<LINE>I am that merry wanderer of the night.</LINE>
+<LINE>I jest to Oberon and make him smile</LINE>
+<LINE>When I a fat and bean-fed horse beguile,</LINE>
+<LINE>Neighing in likeness of a filly foal:</LINE>
+<LINE>And sometime lurk I in a gossip's bowl,</LINE>
+<LINE>In very likeness of a roasted crab,</LINE>
+<LINE>And when she drinks, against her lips I bob</LINE>
+<LINE>And on her wither'd dewlap pour the ale.</LINE>
+<LINE>The wisest aunt, telling the saddest tale,</LINE>
+<LINE>Sometime for three-foot stool mistaketh me;</LINE>
+<LINE>Then slip I from her bum, down topples she,</LINE>
+<LINE>And 'tailor' cries, and falls into a cough;</LINE>
+<LINE>And then the whole quire hold their hips and laugh,</LINE>
+<LINE>And waxen in their mirth and neeze and swear</LINE>
+<LINE>A merrier hour was never wasted there.</LINE>
+<LINE>But, room, fairy! here comes Oberon.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Fairy</SPEAKER>
+<LINE>And here my mistress. Would that he were gone!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter, from one side, OBERON, with his train;
+from the other, TITANIA, with hers</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Ill met by moonlight, proud Titania.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>What, jealous Oberon! Fairies, skip hence:</LINE>
+<LINE>I have forsworn his bed and company.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Tarry, rash wanton: am not I thy lord?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Then I must be thy lady: but I know</LINE>
+<LINE>When thou hast stolen away from fairy land,</LINE>
+<LINE>And in the shape of Corin sat all day,</LINE>
+<LINE>Playing on pipes of corn and versing love</LINE>
+<LINE>To amorous Phillida. Why art thou here,</LINE>
+<LINE>Come from the farthest Steppe of India?</LINE>
+<LINE>But that, forsooth, the bouncing Amazon,</LINE>
+<LINE>Your buskin'd mistress and your warrior love,</LINE>
+<LINE>To Theseus must be wedded, and you come</LINE>
+<LINE>To give their bed joy and prosperity.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>How canst thou thus for shame, Titania,</LINE>
+<LINE>Glance at my credit with Hippolyta,</LINE>
+<LINE>Knowing I know thy love to Theseus?</LINE>
+<LINE>Didst thou not lead him through the glimmering night</LINE>
+<LINE>From Perigenia, whom he ravished?</LINE>
+<LINE>And make him with fair AEgle break his faith,</LINE>
+<LINE>With Ariadne and Antiopa?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>These are the forgeries of jealousy:</LINE>
+<LINE>And never, since the middle summer's spring,</LINE>
+<LINE>Met we on hill, in dale, forest or mead,</LINE>
+<LINE>By paved fountain or by rushy brook,</LINE>
+<LINE>Or in the beached margent of the sea,</LINE>
+<LINE>To dance our ringlets to the whistling wind,</LINE>
+<LINE>But with thy brawls thou hast disturb'd our sport.</LINE>
+<LINE>Therefore the winds, piping to us in vain,</LINE>
+<LINE>As in revenge, have suck'd up from the sea</LINE>
+<LINE>Contagious fogs; which falling in the land</LINE>
+<LINE>Have every pelting river made so proud</LINE>
+<LINE>That they have overborne their continents:</LINE>
+<LINE>The ox hath therefore stretch'd his yoke in vain,</LINE>
+<LINE>The ploughman lost his sweat, and the green corn</LINE>
+<LINE>Hath rotted ere his youth attain'd a beard;</LINE>
+<LINE>The fold stands empty in the drowned field,</LINE>
+<LINE>And crows are fatted with the murrion flock;</LINE>
+<LINE>The nine men's morris is fill'd up with mud,</LINE>
+<LINE>And the quaint mazes in the wanton green</LINE>
+<LINE>For lack of tread are undistinguishable:</LINE>
+<LINE>The human mortals want their winter here;</LINE>
+<LINE>No night is now with hymn or carol blest:</LINE>
+<LINE>Therefore the moon, the governess of floods,</LINE>
+<LINE>Pale in her anger, washes all the air,</LINE>
+<LINE>That rheumatic diseases do abound:</LINE>
+<LINE>And thorough this distemperature we see</LINE>
+<LINE>The seasons alter: hoary-headed frosts</LINE>
+<LINE>Far in the fresh lap of the crimson rose,</LINE>
+<LINE>And on old Hiems' thin and icy crown</LINE>
+<LINE>An odorous chaplet of sweet summer buds</LINE>
+<LINE>Is, as in mockery, set: the spring, the summer,</LINE>
+<LINE>The childing autumn, angry winter, change</LINE>
+<LINE>Their wonted liveries, and the mazed world,</LINE>
+<LINE>By their increase, now knows not which is which:</LINE>
+<LINE>And this same progeny of evils comes</LINE>
+<LINE>From our debate, from our dissension;</LINE>
+<LINE>We are their parents and original.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Do you amend it then; it lies in you:</LINE>
+<LINE>Why should Titania cross her Oberon?</LINE>
+<LINE>I do but beg a little changeling boy,</LINE>
+<LINE>To be my henchman.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Set your heart at rest:</LINE>
+<LINE>The fairy land buys not the child of me.</LINE>
+<LINE>His mother was a votaress of my order:</LINE>
+<LINE>And, in the spiced Indian air, by night,</LINE>
+<LINE>Full often hath she gossip'd by my side,</LINE>
+<LINE>And sat with me on Neptune's yellow sands,</LINE>
+<LINE>Marking the embarked traders on the flood,</LINE>
+<LINE>When we have laugh'd to see the sails conceive</LINE>
+<LINE>And grow big-bellied with the wanton wind;</LINE>
+<LINE>Which she, with pretty and with swimming gait</LINE>
+<LINE>Following,--her womb then rich with my young squire,--</LINE>
+<LINE>Would imitate, and sail upon the land,</LINE>
+<LINE>To fetch me trifles, and return again,</LINE>
+<LINE>As from a voyage, rich with merchandise.</LINE>
+<LINE>But she, being mortal, of that boy did die;</LINE>
+<LINE>And for her sake do I rear up her boy,</LINE>
+<LINE>And for her sake I will not part with him.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>How long within this wood intend you stay?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Perchance till after Theseus' wedding-day.</LINE>
+<LINE>If you will patiently dance in our round</LINE>
+<LINE>And see our moonlight revels, go with us;</LINE>
+<LINE>If not, shun me, and I will spare your haunts.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Give me that boy, and I will go with thee.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Not for thy fairy kingdom. Fairies, away!</LINE>
+<LINE>We shall chide downright, if I longer stay.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit TITANIA with her train</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Well, go thy way: thou shalt not from this grove</LINE>
+<LINE>Till I torment thee for this injury.</LINE>
+<LINE>My gentle Puck, come hither. Thou rememberest</LINE>
+<LINE>Since once I sat upon a promontory,</LINE>
+<LINE>And heard a mermaid on a dolphin's back</LINE>
+<LINE>Uttering such dulcet and harmonious breath</LINE>
+<LINE>That the rude sea grew civil at her song</LINE>
+<LINE>And certain stars shot madly from their spheres,</LINE>
+<LINE>To hear the sea-maid's music.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>I remember.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>That very time I saw, but thou couldst not,</LINE>
+<LINE>Flying between the cold moon and the earth,</LINE>
+<LINE>Cupid all arm'd: a certain aim he took</LINE>
+<LINE>At a fair vestal throned by the west,</LINE>
+<LINE>And loosed his love-shaft smartly from his bow,</LINE>
+<LINE>As it should pierce a hundred thousand hearts;</LINE>
+<LINE>But I might see young Cupid's fiery shaft</LINE>
+<LINE>Quench'd in the chaste beams of the watery moon,</LINE>
+<LINE>And the imperial votaress passed on,</LINE>
+<LINE>In maiden meditation, fancy-free.</LINE>
+<LINE>Yet mark'd I where the bolt of Cupid fell:</LINE>
+<LINE>It fell upon a little western flower,</LINE>
+<LINE>Before milk-white, now purple with love's wound,</LINE>
+<LINE>And maidens call it love-in-idleness.</LINE>
+<LINE>Fetch me that flower; the herb I shew'd thee once:</LINE>
+<LINE>The juice of it on sleeping eye-lids laid</LINE>
+<LINE>Will make or man or woman madly dote</LINE>
+<LINE>Upon the next live creature that it sees.</LINE>
+<LINE>Fetch me this herb; and be thou here again</LINE>
+<LINE>Ere the leviathan can swim a league.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>I'll put a girdle round about the earth</LINE>
+<LINE>In forty minutes.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Having once this juice,</LINE>
+<LINE>I'll watch Titania when she is asleep,</LINE>
+<LINE>And drop the liquor of it in her eyes.</LINE>
+<LINE>The next thing then she waking looks upon,</LINE>
+<LINE>Be it on lion, bear, or wolf, or bull,</LINE>
+<LINE>On meddling monkey, or on busy ape,</LINE>
+<LINE>She shall pursue it with the soul of love:</LINE>
+<LINE>And ere I take this charm from off her sight,</LINE>
+<LINE>As I can take it with another herb,</LINE>
+<LINE>I'll make her render up her page to me.</LINE>
+<LINE>But who comes here? I am invisible;</LINE>
+<LINE>And I will overhear their conference.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter DEMETRIUS, HELENA, following him</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>I love thee not, therefore pursue me not.</LINE>
+<LINE>Where is Lysander and fair Hermia?</LINE>
+<LINE>The one I'll slay, the other slayeth me.</LINE>
+<LINE>Thou told'st me they were stolen unto this wood;</LINE>
+<LINE>And here am I, and wode within this wood,</LINE>
+<LINE>Because I cannot meet my Hermia.</LINE>
+<LINE>Hence, get thee gone, and follow me no more.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>You draw me, you hard-hearted adamant;</LINE>
+<LINE>But yet you draw not iron, for my heart</LINE>
+<LINE>Is true as steel: leave you your power to draw,</LINE>
+<LINE>And I shall have no power to follow you.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Do I entice you? do I speak you fair?</LINE>
+<LINE>Or, rather, do I not in plainest truth</LINE>
+<LINE>Tell you, I do not, nor I cannot love you?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>And even for that do I love you the more.</LINE>
+<LINE>I am your spaniel; and, Demetrius,</LINE>
+<LINE>The more you beat me, I will fawn on you:</LINE>
+<LINE>Use me but as your spaniel, spurn me, strike me,</LINE>
+<LINE>Neglect me, lose me; only give me leave,</LINE>
+<LINE>Unworthy as I am, to follow you.</LINE>
+<LINE>What worser place can I beg in your love,--</LINE>
+<LINE>And yet a place of high respect with me,--</LINE>
+<LINE>Than to be used as you use your dog?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Tempt not too much the hatred of my spirit;</LINE>
+<LINE>For I am sick when I do look on thee.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>And I am sick when I look not on you.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>You do impeach your modesty too much,</LINE>
+<LINE>To leave the city and commit yourself</LINE>
+<LINE>Into the hands of one that loves you not;</LINE>
+<LINE>To trust the opportunity of night</LINE>
+<LINE>And the ill counsel of a desert place</LINE>
+<LINE>With the rich worth of your virginity.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Your virtue is my privilege: for that</LINE>
+<LINE>It is not night when I do see your face,</LINE>
+<LINE>Therefore I think I am not in the night;</LINE>
+<LINE>Nor doth this wood lack worlds of company,</LINE>
+<LINE>For you in my respect are all the world:</LINE>
+<LINE>Then how can it be said I am alone,</LINE>
+<LINE>When all the world is here to look on me?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>I'll run from thee and hide me in the brakes,</LINE>
+<LINE>And leave thee to the mercy of wild beasts.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>The wildest hath not such a heart as you.</LINE>
+<LINE>Run when you will, the story shall be changed:</LINE>
+<LINE>Apollo flies, and Daphne holds the chase;</LINE>
+<LINE>The dove pursues the griffin; the mild hind</LINE>
+<LINE>Makes speed to catch the tiger; bootless speed,</LINE>
+<LINE>When cowardice pursues and valour flies.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>I will not stay thy questions; let me go:</LINE>
+<LINE>Or, if thou follow me, do not believe</LINE>
+<LINE>But I shall do thee mischief in the wood.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Ay, in the temple, in the town, the field,</LINE>
+<LINE>You do me mischief. Fie, Demetrius!</LINE>
+<LINE>Your wrongs do set a scandal on my sex:</LINE>
+<LINE>We cannot fight for love, as men may do;</LINE>
+<LINE>We should be wood and were not made to woo.</LINE>
+<STAGEDIR>Exit DEMETRIUS</STAGEDIR>
+<LINE>I'll follow thee and make a heaven of hell,</LINE>
+<LINE>To die upon the hand I love so well.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Fare thee well, nymph: ere he do leave this grove,</LINE>
+<LINE>Thou shalt fly him and he shall seek thy love.</LINE>
+<STAGEDIR>Re-enter PUCK</STAGEDIR>
+<LINE>Hast thou the flower there? Welcome, wanderer.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Ay, there it is.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>I pray thee, give it me.</LINE>
+<LINE>I know a bank where the wild thyme blows,</LINE>
+<LINE>Where oxlips and the nodding violet grows,</LINE>
+<LINE>Quite over-canopied with luscious woodbine,</LINE>
+<LINE>With sweet musk-roses and with eglantine:</LINE>
+<LINE>There sleeps Titania sometime of the night,</LINE>
+<LINE>Lull'd in these flowers with dances and delight;</LINE>
+<LINE>And there the snake throws her enamell'd skin,</LINE>
+<LINE>Weed wide enough to wrap a fairy in:</LINE>
+<LINE>And with the juice of this I'll streak her eyes,</LINE>
+<LINE>And make her full of hateful fantasies.</LINE>
+<LINE>Take thou some of it, and seek through this grove:</LINE>
+<LINE>A sweet Athenian lady is in love</LINE>
+<LINE>With a disdainful youth: anoint his eyes;</LINE>
+<LINE>But do it when the next thing he espies</LINE>
+<LINE>May be the lady: thou shalt know the man</LINE>
+<LINE>By the Athenian garments he hath on.</LINE>
+<LINE>Effect it with some care, that he may prove</LINE>
+<LINE>More fond on her than she upon her love:</LINE>
+<LINE>And look thou meet me ere the first cock crow.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Fear not, my lord, your servant shall do so.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt</STAGEDIR>
+</SCENE>
+
+<SCENE><TITLE>SCENE II.  Another part of the wood.</TITLE>
+<STAGEDIR>Enter TITANIA, with her train</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Come, now a roundel and a fairy song;</LINE>
+<LINE>Then, for the third part of a minute, hence;</LINE>
+<LINE>Some to kill cankers in the musk-rose buds,</LINE>
+<LINE>Some war with rere-mice for their leathern wings,</LINE>
+<LINE>To make my small elves coats, and some keep back</LINE>
+<LINE>The clamorous owl that nightly hoots and wonders</LINE>
+<LINE>At our quaint spirits. Sing me now asleep;</LINE>
+<LINE>Then to your offices and let me rest.</LINE>
+<STAGEDIR>The Fairies sing</STAGEDIR>
+<LINE>You spotted snakes with double tongue,</LINE>
+<LINE>Thorny hedgehogs, be not seen;</LINE>
+<LINE>Newts and blind-worms, do no wrong,</LINE>
+<LINE>Come not near our fairy queen.</LINE>
+<LINE>Philomel, with melody</LINE>
+<LINE>Sing in our sweet lullaby;</LINE>
+<LINE>Lulla, lulla, lullaby, lulla, lulla, lullaby:</LINE>
+<LINE>Never harm,</LINE>
+<LINE>Nor spell nor charm,</LINE>
+<LINE>Come our lovely lady nigh;</LINE>
+<LINE>So, good night, with lullaby.</LINE>
+<LINE>Weaving spiders, come not here;</LINE>
+<LINE>Hence, you long-legg'd spinners, hence!</LINE>
+<LINE>Beetles black, approach not near;</LINE>
+<LINE>Worm nor snail, do no offence.</LINE>
+<LINE>Philomel, with melody, &amp;c.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Fairy</SPEAKER>
+<LINE>Hence, away! now all is well:</LINE>
+<LINE>One aloof stand sentinel.</LINE>
+</SPEECH>
+
+<STAGEDIR>Exeunt Fairies. TITANIA sleeps</STAGEDIR>
+<STAGEDIR>Enter OBERON and squeezes the flower on TITANIA's eyelids</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>What thou seest when thou dost wake,</LINE>
+<LINE>Do it for thy true-love take,</LINE>
+<LINE>Love and languish for his sake:</LINE>
+<LINE>Be it ounce, or cat, or bear,</LINE>
+<LINE>Pard, or boar with bristled hair,</LINE>
+<LINE>In thy eye that shall appear</LINE>
+<LINE>When thou wakest, it is thy dear:</LINE>
+<LINE>Wake when some vile thing is near.</LINE>
+</SPEECH>
+
+<STAGEDIR>Exit</STAGEDIR>
+<STAGEDIR>Enter LYSANDER and HERMIA</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Fair love, you faint with wandering in the wood;</LINE>
+<LINE>And to speak troth, I have forgot our way:</LINE>
+<LINE>We'll rest us, Hermia, if you think it good,</LINE>
+<LINE>And tarry for the comfort of the day.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Be it so, Lysander: find you out a bed;</LINE>
+<LINE>For I upon this bank will rest my head.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>One turf shall serve as pillow for us both;</LINE>
+<LINE>One heart, one bed, two bosoms and one troth.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Nay, good Lysander; for my sake, my dear,</LINE>
+<LINE>Lie further off yet, do not lie so near.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>O, take the sense, sweet, of my innocence!</LINE>
+<LINE>Love takes the meaning in love's conference.</LINE>
+<LINE>I mean, that my heart unto yours is knit</LINE>
+<LINE>So that but one heart we can make of it;</LINE>
+<LINE>Two bosoms interchained with an oath;</LINE>
+<LINE>So then two bosoms and a single troth.</LINE>
+<LINE>Then by your side no bed-room me deny;</LINE>
+<LINE>For lying so, Hermia, I do not lie.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Lysander riddles very prettily:</LINE>
+<LINE>Now much beshrew my manners and my pride,</LINE>
+<LINE>If Hermia meant to say Lysander lied.</LINE>
+<LINE>But, gentle friend, for love and courtesy</LINE>
+<LINE>Lie further off; in human modesty,</LINE>
+<LINE>Such separation as may well be said</LINE>
+<LINE>Becomes a virtuous bachelor and a maid,</LINE>
+<LINE>So far be distant; and, good night, sweet friend:</LINE>
+<LINE>Thy love ne'er alter till thy sweet life end!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Amen, amen, to that fair prayer, say I;</LINE>
+<LINE>And then end life when I end loyalty!</LINE>
+<LINE>Here is my bed: sleep give thee all his rest!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>With half that wish the wisher's eyes be press'd!</LINE>
+</SPEECH>
+
+<STAGEDIR>They sleep</STAGEDIR>
+<STAGEDIR>Enter PUCK</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Through the forest have I gone.</LINE>
+<LINE>But Athenian found I none,</LINE>
+<LINE>On whose eyes I might approve</LINE>
+<LINE>This flower's force in stirring love.</LINE>
+<LINE>Night and silence.--Who is here?</LINE>
+<LINE>Weeds of Athens he doth wear:</LINE>
+<LINE>This is he, my master said,</LINE>
+<LINE>Despised the Athenian maid;</LINE>
+<LINE>And here the maiden, sleeping sound,</LINE>
+<LINE>On the dank and dirty ground.</LINE>
+<LINE>Pretty soul! she durst not lie</LINE>
+<LINE>Near this lack-love, this kill-courtesy.</LINE>
+<LINE>Churl, upon thy eyes I throw</LINE>
+<LINE>All the power this charm doth owe.</LINE>
+<LINE>When thou wakest, let love forbid</LINE>
+<LINE>Sleep his seat on thy eyelid:</LINE>
+<LINE>So awake when I am gone;</LINE>
+<LINE>For I must now to Oberon.</LINE>
+</SPEECH>
+
+<STAGEDIR>Exit</STAGEDIR>
+<STAGEDIR>Enter DEMETRIUS and HELENA, running</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Stay, though thou kill me, sweet Demetrius.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>I charge thee, hence, and do not haunt me thus.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>O, wilt thou darkling leave me? do not so.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Stay, on thy peril: I alone will go.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>O, I am out of breath in this fond chase!</LINE>
+<LINE>The more my prayer, the lesser is my grace.</LINE>
+<LINE>Happy is Hermia, wheresoe'er she lies;</LINE>
+<LINE>For she hath blessed and attractive eyes.</LINE>
+<LINE>How came her eyes so bright? Not with salt tears:</LINE>
+<LINE>If so, my eyes are oftener wash'd than hers.</LINE>
+<LINE>No, no, I am as ugly as a bear;</LINE>
+<LINE>For beasts that meet me run away for fear:</LINE>
+<LINE>Therefore no marvel though Demetrius</LINE>
+<LINE>Do, as a monster fly my presence thus.</LINE>
+<LINE>What wicked and dissembling glass of mine</LINE>
+<LINE>Made me compare with Hermia's sphery eyne?</LINE>
+<LINE>But who is here? Lysander! on the ground!</LINE>
+<LINE>Dead? or asleep? I see no blood, no wound.</LINE>
+<LINE>Lysander if you live, good sir, awake.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE><STAGEDIR>Awaking</STAGEDIR>  And run through fire I will for thy sweet sake.</LINE>
+<LINE>Transparent Helena! Nature shows art,</LINE>
+<LINE>That through thy bosom makes me see thy heart.</LINE>
+<LINE>Where is Demetrius? O, how fit a word</LINE>
+<LINE>Is that vile name to perish on my sword!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Do not say so, Lysander; say not so</LINE>
+<LINE>What though he love your Hermia? Lord, what though?</LINE>
+<LINE>Yet Hermia still loves you: then be content.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Content with Hermia! No; I do repent</LINE>
+<LINE>The tedious minutes I with her have spent.</LINE>
+<LINE>Not Hermia but Helena I love:</LINE>
+<LINE>Who will not change a raven for a dove?</LINE>
+<LINE>The will of man is by his reason sway'd;</LINE>
+<LINE>And reason says you are the worthier maid.</LINE>
+<LINE>Things growing are not ripe until their season</LINE>
+<LINE>So I, being young, till now ripe not to reason;</LINE>
+<LINE>And touching now the point of human skill,</LINE>
+<LINE>Reason becomes the marshal to my will</LINE>
+<LINE>And leads me to your eyes, where I o'erlook</LINE>
+<LINE>Love's stories written in love's richest book.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Wherefore was I to this keen mockery born?</LINE>
+<LINE>When at your hands did I deserve this scorn?</LINE>
+<LINE>Is't not enough, is't not enough, young man,</LINE>
+<LINE>That I did never, no, nor never can,</LINE>
+<LINE>Deserve a sweet look from Demetrius' eye,</LINE>
+<LINE>But you must flout my insufficiency?</LINE>
+<LINE>Good troth, you do me wrong, good sooth, you do,</LINE>
+<LINE>In such disdainful manner me to woo.</LINE>
+<LINE>But fare you well: perforce I must confess</LINE>
+<LINE>I thought you lord of more true gentleness.</LINE>
+<LINE>O, that a lady, of one man refused.</LINE>
+<LINE>Should of another therefore be abused!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>She sees not Hermia. Hermia, sleep thou there:</LINE>
+<LINE>And never mayst thou come Lysander near!</LINE>
+<LINE>For as a surfeit of the sweetest things</LINE>
+<LINE>The deepest loathing to the stomach brings,</LINE>
+<LINE>Or as tie heresies that men do leave</LINE>
+<LINE>Are hated most of those they did deceive,</LINE>
+<LINE>So thou, my surfeit and my heresy,</LINE>
+<LINE>Of all be hated, but the most of me!</LINE>
+<LINE>And, all my powers, address your love and might</LINE>
+<LINE>To honour Helen and to be her knight!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE><STAGEDIR>Awaking</STAGEDIR>  Help me, Lysander, help me! do thy best</LINE>
+<LINE>To pluck this crawling serpent from my breast!</LINE>
+<LINE>Ay me, for pity! what a dream was here!</LINE>
+<LINE>Lysander, look how I do quake with fear:</LINE>
+<LINE>Methought a serpent eat my heart away,</LINE>
+<LINE>And you sat smiling at his cruel pray.</LINE>
+<LINE>Lysander! what, removed? Lysander! lord!</LINE>
+<LINE>What, out of hearing? gone? no sound, no word?</LINE>
+<LINE>Alack, where are you speak, an if you hear;</LINE>
+<LINE>Speak, of all loves! I swoon almost with fear.</LINE>
+<LINE>No? then I well perceive you all not nigh</LINE>
+<LINE>Either death or you I'll find immediately.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+</SCENE>
+
+</ACT>
+
+<ACT><TITLE>ACT III</TITLE>
+
+<SCENE><TITLE>SCENE I.  The wood. TITANIA lying asleep.</TITLE>
+<STAGEDIR>Enter QUINCE, SNUG, BOTTOM, FLUTE, SNOUT, and
+STARVELING</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Are we all met?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Pat, pat; and here's a marvellous convenient place</LINE>
+<LINE>for our rehearsal. This green plot shall be our</LINE>
+<LINE>stage, this hawthorn-brake our tiring-house; and we</LINE>
+<LINE>will do it in action as we will do it before the duke.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Peter Quince,--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>What sayest thou, bully Bottom?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>There are things in this comedy of Pyramus and</LINE>
+<LINE>Thisby that will never please. First, Pyramus must</LINE>
+<LINE>draw a sword to kill himself; which the ladies</LINE>
+<LINE>cannot abide. How answer you that?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>SNOUT</SPEAKER>
+<LINE>By'r lakin, a parlous fear.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>STARVELING</SPEAKER>
+<LINE>I believe we must leave the killing out, when all is done.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Not a whit: I have a device to make all well.</LINE>
+<LINE>Write me a prologue; and let the prologue seem to</LINE>
+<LINE>say, we will do no harm with our swords, and that</LINE>
+<LINE>Pyramus is not killed indeed; and, for the more</LINE>
+<LINE>better assurance, tell them that I, Pyramus, am not</LINE>
+<LINE>Pyramus, but Bottom the weaver: this will put them</LINE>
+<LINE>out of fear.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Well, we will have such a prologue; and it shall be</LINE>
+<LINE>written in eight and six.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>No, make it two more; let it be written in eight and eight.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>SNOUT</SPEAKER>
+<LINE>Will not the ladies be afeard of the lion?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>STARVELING</SPEAKER>
+<LINE>I fear it, I promise you.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Masters, you ought to consider with yourselves: to</LINE>
+<LINE>bring in--God shield us!--a lion among ladies, is a</LINE>
+<LINE>most dreadful thing; for there is not a more fearful</LINE>
+<LINE>wild-fowl than your lion living; and we ought to</LINE>
+<LINE>look to 't.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>SNOUT</SPEAKER>
+<LINE>Therefore another prologue must tell he is not a lion.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Nay, you must name his name, and half his face must</LINE>
+<LINE>be seen through the lion's neck: and he himself</LINE>
+<LINE>must speak through, saying thus, or to the same</LINE>
+<LINE>defect,--'Ladies,'--or 'Fair-ladies--I would wish</LINE>
+<LINE>You,'--or 'I would request you,'--or 'I would</LINE>
+<LINE>entreat you,--not to fear, not to tremble: my life</LINE>
+<LINE>for yours. If you think I come hither as a lion, it</LINE>
+<LINE>were pity of my life: no I am no such thing; I am a</LINE>
+<LINE>man as other men are;' and there indeed let him name</LINE>
+<LINE>his name, and tell them plainly he is Snug the joiner.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Well it shall be so. But there is two hard things;</LINE>
+<LINE>that is, to bring the moonlight into a chamber; for,</LINE>
+<LINE>you know, Pyramus and Thisby meet by moonlight.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>SNOUT</SPEAKER>
+<LINE>Doth the moon shine that night we play our play?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>A calendar, a calendar! look in the almanac; find</LINE>
+<LINE>out moonshine, find out moonshine.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Yes, it doth shine that night.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Why, then may you leave a casement of the great</LINE>
+<LINE>chamber window, where we play, open, and the moon</LINE>
+<LINE>may shine in at the casement.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Ay; or else one must come in with a bush of thorns</LINE>
+<LINE>and a lanthorn, and say he comes to disfigure, or to</LINE>
+<LINE>present, the person of Moonshine. Then, there is</LINE>
+<LINE>another thing: we must have a wall in the great</LINE>
+<LINE>chamber; for Pyramus and Thisby says the story, did</LINE>
+<LINE>talk through the chink of a wall.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>SNOUT</SPEAKER>
+<LINE>You can never bring in a wall. What say you, Bottom?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Some man or other must present Wall: and let him</LINE>
+<LINE>have some plaster, or some loam, or some rough-cast</LINE>
+<LINE>about him, to signify wall; and let him hold his</LINE>
+<LINE>fingers thus, and through that cranny shall Pyramus</LINE>
+<LINE>and Thisby whisper.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>If that may be, then all is well. Come, sit down,</LINE>
+<LINE>every mother's son, and rehearse your parts.</LINE>
+<LINE>Pyramus, you begin: when you have spoken your</LINE>
+<LINE>speech, enter into that brake: and so every one</LINE>
+<LINE>according to his cue.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter PUCK behind</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>What hempen home-spuns have we swaggering here,</LINE>
+<LINE>So near the cradle of the fairy queen?</LINE>
+<LINE>What, a play toward! I'll be an auditor;</LINE>
+<LINE>An actor too, perhaps, if I see cause.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Speak, Pyramus. Thisby, stand forth.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Thisby, the flowers of odious savours sweet,--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Odours, odours.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>--odours savours sweet:</LINE>
+<LINE>So hath thy breath, my dearest Thisby dear.</LINE>
+<LINE>But hark, a voice! stay thou but here awhile,</LINE>
+<LINE>And by and by I will to thee appear.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>A stranger Pyramus than e'er played here.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>Must I speak now?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Ay, marry, must you; for you must understand he goes</LINE>
+<LINE>but to see a noise that he heard, and is to come again.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>Most radiant Pyramus, most lily-white of hue,</LINE>
+<LINE>Of colour like the red rose on triumphant brier,</LINE>
+<LINE>Most brisky juvenal and eke most lovely Jew,</LINE>
+<LINE>As true as truest horse that yet would never tire,</LINE>
+<LINE>I'll meet thee, Pyramus, at Ninny's tomb.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>'Ninus' tomb,' man: why, you must not speak that</LINE>
+<LINE>yet; that you answer to Pyramus: you speak all your</LINE>
+<LINE>part at once, cues and all Pyramus enter: your cue</LINE>
+<LINE>is past; it is, 'never tire.'</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>O,--As true as truest horse, that yet would</LINE>
+<LINE>never tire.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Re-enter PUCK, and BOTTOM with an ass's head</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>If I were fair, Thisby, I were only thine.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>O monstrous! O strange! we are haunted. Pray,</LINE>
+<LINE>masters! fly, masters! Help!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt QUINCE, SNUG, FLUTE, SNOUT, and STARVELING</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>I'll follow you, I'll lead you about a round,</LINE>
+<LINE>Through bog, through bush, through brake, through brier:</LINE>
+<LINE>Sometime a horse I'll be, sometime a hound,</LINE>
+<LINE>A hog, a headless bear, sometime a fire;</LINE>
+<LINE>And neigh, and bark, and grunt, and roar, and burn,</LINE>
+<LINE>Like horse, hound, hog, bear, fire, at every turn.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Why do they run away? this is a knavery of them to</LINE>
+<LINE>make me afeard.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Re-enter SNOUT</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>SNOUT</SPEAKER>
+<LINE>O Bottom, thou art changed! what do I see on thee?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>What do you see? you see an asshead of your own, do</LINE>
+<LINE>you?</LINE>
+</SPEECH>
+
+<STAGEDIR>Exit SNOUT</STAGEDIR>
+<STAGEDIR>Re-enter QUINCE</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Bless thee, Bottom! bless thee! thou art</LINE>
+<LINE>translated.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>I see their knavery: this is to make an ass of me;</LINE>
+<LINE>to fright me, if they could. But I will not stir</LINE>
+<LINE>from this place, do what they can: I will walk up</LINE>
+<LINE>and down here, and I will sing, that they shall hear</LINE>
+<LINE>I am not afraid.</LINE>
+<STAGEDIR>Sings</STAGEDIR>
+<LINE>The ousel cock so black of hue,</LINE>
+<LINE>With orange-tawny bill,</LINE>
+<LINE>The throstle with his note so true,</LINE>
+<LINE>The wren with little quill,--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE><STAGEDIR>Awaking</STAGEDIR>  What angel wakes me from my flowery bed?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE><STAGEDIR>Sings</STAGEDIR></LINE>
+<LINE>The finch, the sparrow and the lark,</LINE>
+<LINE>The plain-song cuckoo gray,</LINE>
+<LINE>Whose note full many a man doth mark,</LINE>
+<LINE>And dares not answer nay;--</LINE>
+<LINE>for, indeed, who would set his wit to so foolish</LINE>
+<LINE>a bird? who would give a bird the lie, though he cry</LINE>
+<LINE>'cuckoo' never so?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>I pray thee, gentle mortal, sing again:</LINE>
+<LINE>Mine ear is much enamour'd of thy note;</LINE>
+<LINE>So is mine eye enthralled to thy shape;</LINE>
+<LINE>And thy fair virtue's force perforce doth move me</LINE>
+<LINE>On the first view to say, to swear, I love thee.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Methinks, mistress, you should have little reason</LINE>
+<LINE>for that: and yet, to say the truth, reason and</LINE>
+<LINE>love keep little company together now-a-days; the</LINE>
+<LINE>more the pity that some honest neighbours will not</LINE>
+<LINE>make them friends. Nay, I can gleek upon occasion.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Thou art as wise as thou art beautiful.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Not so, neither: but if I had wit enough to get out</LINE>
+<LINE>of this wood, I have enough to serve mine own turn.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Out of this wood do not desire to go:</LINE>
+<LINE>Thou shalt remain here, whether thou wilt or no.</LINE>
+<LINE>I am a spirit of no common rate;</LINE>
+<LINE>The summer still doth tend upon my state;</LINE>
+<LINE>And I do love thee: therefore, go with me;</LINE>
+<LINE>I'll give thee fairies to attend on thee,</LINE>
+<LINE>And they shall fetch thee jewels from the deep,</LINE>
+<LINE>And sing while thou on pressed flowers dost sleep;</LINE>
+<LINE>And I will purge thy mortal grossness so</LINE>
+<LINE>That thou shalt like an airy spirit go.</LINE>
+<LINE>Peaseblossom! Cobweb! Moth! and Mustardseed!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter PEASEBLOSSOM, COBWEB, MOTH, and MUSTARDSEED</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PEASEBLOSSOM</SPEAKER>
+<LINE>Ready.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>COBWEB</SPEAKER>
+<LINE>And I.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>MOTH</SPEAKER>
+<LINE>And I.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>MUSTARDSEED</SPEAKER>
+<LINE>And I.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>ALL</SPEAKER>
+<LINE>Where shall we go?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Be kind and courteous to this gentleman;</LINE>
+<LINE>Hop in his walks and gambol in his eyes;</LINE>
+<LINE>Feed him with apricocks and dewberries,</LINE>
+<LINE>With purple grapes, green figs, and mulberries;</LINE>
+<LINE>The honey-bags steal from the humble-bees,</LINE>
+<LINE>And for night-tapers crop their waxen thighs</LINE>
+<LINE>And light them at the fiery glow-worm's eyes,</LINE>
+<LINE>To have my love to bed and to arise;</LINE>
+<LINE>And pluck the wings from Painted butterflies</LINE>
+<LINE>To fan the moonbeams from his sleeping eyes:</LINE>
+<LINE>Nod to him, elves, and do him courtesies.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PEASEBLOSSOM</SPEAKER>
+<LINE>Hail, mortal!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>COBWEB</SPEAKER>
+<LINE>Hail!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>MOTH</SPEAKER>
+<LINE>Hail!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>MUSTARDSEED</SPEAKER>
+<LINE>Hail!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>I cry your worship's mercy, heartily: I beseech your</LINE>
+<LINE>worship's name.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>COBWEB</SPEAKER>
+<LINE>Cobweb.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>I shall desire you of more acquaintance, good Master</LINE>
+<LINE>Cobweb: if I cut my finger, I shall make bold with</LINE>
+<LINE>you. Your name, honest gentleman?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PEASEBLOSSOM</SPEAKER>
+<LINE>Peaseblossom.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>I pray you, commend me to Mistress Squash, your</LINE>
+<LINE>mother, and to Master Peascod, your father. Good</LINE>
+<LINE>Master Peaseblossom, I shall desire you of more</LINE>
+<LINE>acquaintance too. Your name, I beseech you, sir?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>MUSTARDSEED</SPEAKER>
+<LINE>Mustardseed.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Good Master Mustardseed, I know your patience well:</LINE>
+<LINE>that same cowardly, giant-like ox-beef hath</LINE>
+<LINE>devoured many a gentleman of your house: I promise</LINE>
+<LINE>you your kindred had made my eyes water ere now. I</LINE>
+<LINE>desire your more acquaintance, good Master</LINE>
+<LINE>Mustardseed.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Come, wait upon him; lead him to my bower.</LINE>
+<LINE>The moon methinks looks with a watery eye;</LINE>
+<LINE>And when she weeps, weeps every little flower,</LINE>
+<LINE>Lamenting some enforced chastity.</LINE>
+<LINE>Tie up my love's tongue bring him silently.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt</STAGEDIR>
+</SCENE>
+
+<SCENE><TITLE>SCENE II.  Another part of the wood.</TITLE>
+<STAGEDIR>Enter OBERON</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>I wonder if Titania be awaked;</LINE>
+<LINE>Then, what it was that next came in her eye,</LINE>
+<LINE>Which she must dote on in extremity.</LINE>
+<STAGEDIR>Enter PUCK</STAGEDIR>
+<LINE>Here comes my messenger.</LINE>
+<LINE>How now, mad spirit!</LINE>
+<LINE>What night-rule now about this haunted grove?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>My mistress with a monster is in love.</LINE>
+<LINE>Near to her close and consecrated bower,</LINE>
+<LINE>While she was in her dull and sleeping hour,</LINE>
+<LINE>A crew of patches, rude mechanicals,</LINE>
+<LINE>That work for bread upon Athenian stalls,</LINE>
+<LINE>Were met together to rehearse a play</LINE>
+<LINE>Intended for great Theseus' nuptial-day.</LINE>
+<LINE>The shallowest thick-skin of that barren sort,</LINE>
+<LINE>Who Pyramus presented, in their sport</LINE>
+<LINE>Forsook his scene and enter'd in a brake</LINE>
+<LINE>When I did him at this advantage take,</LINE>
+<LINE>An ass's nole I fixed on his head:</LINE>
+<LINE>Anon his Thisbe must be answered,</LINE>
+<LINE>And forth my mimic comes. When they him spy,</LINE>
+<LINE>As wild geese that the creeping fowler eye,</LINE>
+<LINE>Or russet-pated choughs, many in sort,</LINE>
+<LINE>Rising and cawing at the gun's report,</LINE>
+<LINE>Sever themselves and madly sweep the sky,</LINE>
+<LINE>So, at his sight, away his fellows fly;</LINE>
+<LINE>And, at our stamp, here o'er and o'er one falls;</LINE>
+<LINE>He murder cries and help from Athens calls.</LINE>
+<LINE>Their sense thus weak, lost with their fears</LINE>
+<LINE>thus strong,</LINE>
+<LINE>Made senseless things begin to do them wrong;</LINE>
+<LINE>For briers and thorns at their apparel snatch;</LINE>
+<LINE>Some sleeves, some hats, from yielders all</LINE>
+<LINE>things catch.</LINE>
+<LINE>I led them on in this distracted fear,</LINE>
+<LINE>And left sweet Pyramus translated there:</LINE>
+<LINE>When in that moment, so it came to pass,</LINE>
+<LINE>Titania waked and straightway loved an ass.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>This falls out better than I could devise.</LINE>
+<LINE>But hast thou yet latch'd the Athenian's eyes</LINE>
+<LINE>With the love-juice, as I did bid thee do?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>I took him sleeping,--that is finish'd too,--</LINE>
+<LINE>And the Athenian woman by his side:</LINE>
+<LINE>That, when he waked, of force she must be eyed.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter HERMIA and DEMETRIUS</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Stand close: this is the same Athenian.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>This is the woman, but not this the man.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>O, why rebuke you him that loves you so?</LINE>
+<LINE>Lay breath so bitter on your bitter foe.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Now I but chide; but I should use thee worse,</LINE>
+<LINE>For thou, I fear, hast given me cause to curse,</LINE>
+<LINE>If thou hast slain Lysander in his sleep,</LINE>
+<LINE>Being o'er shoes in blood, plunge in the deep,</LINE>
+<LINE>And kill me too.</LINE>
+<LINE>The sun was not so true unto the day</LINE>
+<LINE>As he to me: would he have stolen away</LINE>
+<LINE>From sleeping Hermia? I'll believe as soon</LINE>
+<LINE>This whole earth may be bored and that the moon</LINE>
+<LINE>May through the centre creep and so displease</LINE>
+<LINE>Her brother's noontide with Antipodes.</LINE>
+<LINE>It cannot be but thou hast murder'd him;</LINE>
+<LINE>So should a murderer look, so dead, so grim.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>So should the murder'd look, and so should I,</LINE>
+<LINE>Pierced through the heart with your stern cruelty:</LINE>
+<LINE>Yet you, the murderer, look as bright, as clear,</LINE>
+<LINE>As yonder Venus in her glimmering sphere.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>What's this to my Lysander? where is he?</LINE>
+<LINE>Ah, good Demetrius, wilt thou give him me?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>I had rather give his carcass to my hounds.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Out, dog! out, cur! thou drivest me past the bounds</LINE>
+<LINE>Of maiden's patience. Hast thou slain him, then?</LINE>
+<LINE>Henceforth be never number'd among men!</LINE>
+<LINE>O, once tell true, tell true, even for my sake!</LINE>
+<LINE>Durst thou have look'd upon him being awake,</LINE>
+<LINE>And hast thou kill'd him sleeping? O brave touch!</LINE>
+<LINE>Could not a worm, an adder, do so much?</LINE>
+<LINE>An adder did it; for with doubler tongue</LINE>
+<LINE>Than thine, thou serpent, never adder stung.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>You spend your passion on a misprised mood:</LINE>
+<LINE>I am not guilty of Lysander's blood;</LINE>
+<LINE>Nor is he dead, for aught that I can tell.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>I pray thee, tell me then that he is well.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>An if I could, what should I get therefore?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>A privilege never to see me more.</LINE>
+<LINE>And from thy hated presence part I so:</LINE>
+<LINE>See me no more, whether he be dead or no.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>There is no following her in this fierce vein:</LINE>
+<LINE>Here therefore for a while I will remain.</LINE>
+<LINE>So sorrow's heaviness doth heavier grow</LINE>
+<LINE>For debt that bankrupt sleep doth sorrow owe:</LINE>
+<LINE>Which now in some slight measure it will pay,</LINE>
+<LINE>If for his tender here I make some stay.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Lies down and sleeps</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>What hast thou done? thou hast mistaken quite</LINE>
+<LINE>And laid the love-juice on some true-love's sight:</LINE>
+<LINE>Of thy misprision must perforce ensue</LINE>
+<LINE>Some true love turn'd and not a false turn'd true.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Then fate o'er-rules, that, one man holding troth,</LINE>
+<LINE>A million fail, confounding oath on oath.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>About the wood go swifter than the wind,</LINE>
+<LINE>And Helena of Athens look thou find:</LINE>
+<LINE>All fancy-sick she is and pale of cheer,</LINE>
+<LINE>With sighs of love, that costs the fresh blood dear:</LINE>
+<LINE>By some illusion see thou bring her here:</LINE>
+<LINE>I'll charm his eyes against she do appear.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>I go, I go; look how I go,</LINE>
+<LINE>Swifter than arrow from the Tartar's bow.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Flower of this purple dye,</LINE>
+<LINE>Hit with Cupid's archery,</LINE>
+<LINE>Sink in apple of his eye.</LINE>
+<LINE>When his love he doth espy,</LINE>
+<LINE>Let her shine as gloriously</LINE>
+<LINE>As the Venus of the sky.</LINE>
+<LINE>When thou wakest, if she be by,</LINE>
+<LINE>Beg of her for remedy.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Re-enter PUCK</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Captain of our fairy band,</LINE>
+<LINE>Helena is here at hand;</LINE>
+<LINE>And the youth, mistook by me,</LINE>
+<LINE>Pleading for a lover's fee.</LINE>
+<LINE>Shall we their fond pageant see?</LINE>
+<LINE>Lord, what fools these mortals be!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Stand aside: the noise they make</LINE>
+<LINE>Will cause Demetrius to awake.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Then will two at once woo one;</LINE>
+<LINE>That must needs be sport alone;</LINE>
+<LINE>And those things do best please me</LINE>
+<LINE>That befal preposterously.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter LYSANDER and HELENA</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Why should you think that I should woo in scorn?</LINE>
+<LINE>Scorn and derision never come in tears:</LINE>
+<LINE>Look, when I vow, I weep; and vows so born,</LINE>
+<LINE>In their nativity all truth appears.</LINE>
+<LINE>How can these things in me seem scorn to you,</LINE>
+<LINE>Bearing the badge of faith, to prove them true?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>You do advance your cunning more and more.</LINE>
+<LINE>When truth kills truth, O devilish-holy fray!</LINE>
+<LINE>These vows are Hermia's: will you give her o'er?</LINE>
+<LINE>Weigh oath with oath, and you will nothing weigh:</LINE>
+<LINE>Your vows to her and me, put in two scales,</LINE>
+<LINE>Will even weigh, and both as light as tales.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>I had no judgment when to her I swore.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Nor none, in my mind, now you give her o'er.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Demetrius loves her, and he loves not you.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE><STAGEDIR>Awaking</STAGEDIR>  O Helena, goddess, nymph, perfect, divine!</LINE>
+<LINE>To what, my love, shall I compare thine eyne?</LINE>
+<LINE>Crystal is muddy. O, how ripe in show</LINE>
+<LINE>Thy lips, those kissing cherries, tempting grow!</LINE>
+<LINE>That pure congealed white, high Taurus snow,</LINE>
+<LINE>Fann'd with the eastern wind, turns to a crow</LINE>
+<LINE>When thou hold'st up thy hand: O, let me kiss</LINE>
+<LINE>This princess of pure white, this seal of bliss!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>O spite! O hell! I see you all are bent</LINE>
+<LINE>To set against me for your merriment:</LINE>
+<LINE>If you we re civil and knew courtesy,</LINE>
+<LINE>You would not do me thus much injury.</LINE>
+<LINE>Can you not hate me, as I know you do,</LINE>
+<LINE>But you must join in souls to mock me too?</LINE>
+<LINE>If you were men, as men you are in show,</LINE>
+<LINE>You would not use a gentle lady so;</LINE>
+<LINE>To vow, and swear, and superpraise my parts,</LINE>
+<LINE>When I am sure you hate me with your hearts.</LINE>
+<LINE>You both are rivals, and love Hermia;</LINE>
+<LINE>And now both rivals, to mock Helena:</LINE>
+<LINE>A trim exploit, a manly enterprise,</LINE>
+<LINE>To conjure tears up in a poor maid's eyes</LINE>
+<LINE>With your derision! none of noble sort</LINE>
+<LINE>Would so offend a virgin, and extort</LINE>
+<LINE>A poor soul's patience, all to make you sport.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>You are unkind, Demetrius; be not so;</LINE>
+<LINE>For you love Hermia; this you know I know:</LINE>
+<LINE>And here, with all good will, with all my heart,</LINE>
+<LINE>In Hermia's love I yield you up my part;</LINE>
+<LINE>And yours of Helena to me bequeath,</LINE>
+<LINE>Whom I do love and will do till my death.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Never did mockers waste more idle breath.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Lysander, keep thy Hermia; I will none:</LINE>
+<LINE>If e'er I loved her, all that love is gone.</LINE>
+<LINE>My heart to her but as guest-wise sojourn'd,</LINE>
+<LINE>And now to Helen is it home return'd,</LINE>
+<LINE>There to remain.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Helen, it is not so.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Disparage not the faith thou dost not know,</LINE>
+<LINE>Lest, to thy peril, thou aby it dear.</LINE>
+<LINE>Look, where thy love comes; yonder is thy dear.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Re-enter HERMIA</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Dark night, that from the eye his function takes,</LINE>
+<LINE>The ear more quick of apprehension makes;</LINE>
+<LINE>Wherein it doth impair the seeing sense,</LINE>
+<LINE>It pays the hearing double recompense.</LINE>
+<LINE>Thou art not by mine eye, Lysander, found;</LINE>
+<LINE>Mine ear, I thank it, brought me to thy sound</LINE>
+<LINE>But why unkindly didst thou leave me so?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Why should he stay, whom love doth press to go?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>What love could press Lysander from my side?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Lysander's love, that would not let him bide,</LINE>
+<LINE>Fair Helena, who more engilds the night</LINE>
+<LINE>Than all you fiery oes and eyes of light.</LINE>
+<LINE>Why seek'st thou me? could not this make thee know,</LINE>
+<LINE>The hate I bear thee made me leave thee so?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>You speak not as you think: it cannot be.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Lo, she is one of this confederacy!</LINE>
+<LINE>Now I perceive they have conjoin'd all three</LINE>
+<LINE>To fashion this false sport, in spite of me.</LINE>
+<LINE>Injurious Hermia! most ungrateful maid!</LINE>
+<LINE>Have you conspired, have you with these contrived</LINE>
+<LINE>To bait me with this foul derision?</LINE>
+<LINE>Is all the counsel that we two have shared,</LINE>
+<LINE>The sisters' vows, the hours that we have spent,</LINE>
+<LINE>When we have chid the hasty-footed time</LINE>
+<LINE>For parting us,--O, is it all forgot?</LINE>
+<LINE>All school-days' friendship, childhood innocence?</LINE>
+<LINE>We, Hermia, like two artificial gods,</LINE>
+<LINE>Have with our needles created both one flower,</LINE>
+<LINE>Both on one sampler, sitting on one cushion,</LINE>
+<LINE>Both warbling of one song, both in one key,</LINE>
+<LINE>As if our hands, our sides, voices and minds,</LINE>
+<LINE>Had been incorporate. So we grow together,</LINE>
+<LINE>Like to a double cherry, seeming parted,</LINE>
+<LINE>But yet an union in partition;</LINE>
+<LINE>Two lovely berries moulded on one stem;</LINE>
+<LINE>So, with two seeming bodies, but one heart;</LINE>
+<LINE>Two of the first, like coats in heraldry,</LINE>
+<LINE>Due but to one and crowned with one crest.</LINE>
+<LINE>And will you rent our ancient love asunder,</LINE>
+<LINE>To join with men in scorning your poor friend?</LINE>
+<LINE>It is not friendly, 'tis not maidenly:</LINE>
+<LINE>Our sex, as well as I, may chide you for it,</LINE>
+<LINE>Though I alone do feel the injury.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>I am amazed at your passionate words.</LINE>
+<LINE>I scorn you not: it seems that you scorn me.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Have you not set Lysander, as in scorn,</LINE>
+<LINE>To follow me and praise my eyes and face?</LINE>
+<LINE>And made your other love, Demetrius,</LINE>
+<LINE>Who even but now did spurn me with his foot,</LINE>
+<LINE>To call me goddess, nymph, divine and rare,</LINE>
+<LINE>Precious, celestial? Wherefore speaks he this</LINE>
+<LINE>To her he hates? and wherefore doth Lysander</LINE>
+<LINE>Deny your love, so rich within his soul,</LINE>
+<LINE>And tender me, forsooth, affection,</LINE>
+<LINE>But by your setting on, by your consent?</LINE>
+<LINE>What thought I be not so in grace as you,</LINE>
+<LINE>So hung upon with love, so fortunate,</LINE>
+<LINE>But miserable most, to love unloved?</LINE>
+<LINE>This you should pity rather than despise.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERNIA</SPEAKER>
+<LINE>I understand not what you mean by this.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Ay, do, persever, counterfeit sad looks,</LINE>
+<LINE>Make mouths upon me when I turn my back;</LINE>
+<LINE>Wink each at other; hold the sweet jest up:</LINE>
+<LINE>This sport, well carried, shall be chronicled.</LINE>
+<LINE>If you have any pity, grace, or manners,</LINE>
+<LINE>You would not make me such an argument.</LINE>
+<LINE>But fare ye well: 'tis partly my own fault;</LINE>
+<LINE>Which death or absence soon shall remedy.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Stay, gentle Helena; hear my excuse:</LINE>
+<LINE>My love, my life my soul, fair Helena!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>O excellent!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Sweet, do not scorn her so.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>If she cannot entreat, I can compel.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Thou canst compel no more than she entreat:</LINE>
+<LINE>Thy threats have no more strength than her weak prayers.</LINE>
+<LINE>Helen, I love thee; by my life, I do:</LINE>
+<LINE>I swear by that which I will lose for thee,</LINE>
+<LINE>To prove him false that says I love thee not.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>I say I love thee more than he can do.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>If thou say so, withdraw, and prove it too.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Quick, come!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Lysander, whereto tends all this?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Away, you Ethiope!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>No, no; he'll</LINE>
+<LINE>Seem to break loose; take on as you would follow,</LINE>
+<LINE>But yet come not: you are a tame man, go!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Hang off, thou cat, thou burr! vile thing, let loose,</LINE>
+<LINE>Or I will shake thee from me like a serpent!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Why are you grown so rude? what change is this?</LINE>
+<LINE>Sweet love,--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Thy love! out, tawny Tartar, out!</LINE>
+<LINE>Out, loathed medicine! hated potion, hence!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Do you not jest?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Yes, sooth; and so do you.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Demetrius, I will keep my word with thee.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>I would I had your bond, for I perceive</LINE>
+<LINE>A weak bond holds you: I'll not trust your word.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>What, should I hurt her, strike her, kill her dead?</LINE>
+<LINE>Although I hate her, I'll not harm her so.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>What, can you do me greater harm than hate?</LINE>
+<LINE>Hate me! wherefore? O me! what news, my love!</LINE>
+<LINE>Am not I Hermia? are not you Lysander?</LINE>
+<LINE>I am as fair now as I was erewhile.</LINE>
+<LINE>Since night you loved me; yet since night you left</LINE>
+<LINE>me:</LINE>
+<LINE>Why, then you left me--O, the gods forbid!--</LINE>
+<LINE>In earnest, shall I say?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Ay, by my life;</LINE>
+<LINE>And never did desire to see thee more.</LINE>
+<LINE>Therefore be out of hope, of question, of doubt;</LINE>
+<LINE>Be certain, nothing truer; 'tis no jest</LINE>
+<LINE>That I do hate thee and love Helena.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>O me! you juggler! you canker-blossom!</LINE>
+<LINE>You thief of love! what, have you come by night</LINE>
+<LINE>And stolen my love's heart from him?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Fine, i'faith!</LINE>
+<LINE>Have you no modesty, no maiden shame,</LINE>
+<LINE>No touch of bashfulness? What, will you tear</LINE>
+<LINE>Impatient answers from my gentle tongue?</LINE>
+<LINE>Fie, fie! you counterfeit, you puppet, you!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Puppet? why so? ay, that way goes the game.</LINE>
+<LINE>Now I perceive that she hath made compare</LINE>
+<LINE>Between our statures; she hath urged her height;</LINE>
+<LINE>And with her personage, her tall personage,</LINE>
+<LINE>Her height, forsooth, she hath prevail'd with him.</LINE>
+<LINE>And are you grown so high in his esteem;</LINE>
+<LINE>Because I am so dwarfish and so low?</LINE>
+<LINE>How low am I, thou painted maypole? speak;</LINE>
+<LINE>How low am I? I am not yet so low</LINE>
+<LINE>But that my nails can reach unto thine eyes.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>I pray you, though you mock me, gentlemen,</LINE>
+<LINE>Let her not hurt me: I was never curst;</LINE>
+<LINE>I have no gift at all in shrewishness;</LINE>
+<LINE>I am a right maid for my cowardice:</LINE>
+<LINE>Let her not strike me. You perhaps may think,</LINE>
+<LINE>Because she is something lower than myself,</LINE>
+<LINE>That I can match her.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Lower! hark, again.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>Good Hermia, do not be so bitter with me.</LINE>
+<LINE>I evermore did love you, Hermia,</LINE>
+<LINE>Did ever keep your counsels, never wrong'd you;</LINE>
+<LINE>Save that, in love unto Demetrius,</LINE>
+<LINE>I told him of your stealth unto this wood.</LINE>
+<LINE>He follow'd you; for love I follow'd him;</LINE>
+<LINE>But he hath chid me hence and threaten'd me</LINE>
+<LINE>To strike me, spurn me, nay, to kill me too:</LINE>
+<LINE>And now, so you will let me quiet go,</LINE>
+<LINE>To Athens will I bear my folly back</LINE>
+<LINE>And follow you no further: let me go:</LINE>
+<LINE>You see how simple and how fond I am.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Why, get you gone: who is't that hinders you?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>A foolish heart, that I leave here behind.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>What, with Lysander?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>With Demetrius.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Be not afraid; she shall not harm thee, Helena.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>No, sir, she shall not, though you take her part.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>O, when she's angry, she is keen and shrewd!</LINE>
+<LINE>She was a vixen when she went to school;</LINE>
+<LINE>And though she be but little, she is fierce.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>'Little' again! nothing but 'low' and 'little'!</LINE>
+<LINE>Why will you suffer her to flout me thus?</LINE>
+<LINE>Let me come to her.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Get you gone, you dwarf;</LINE>
+<LINE>You minimus, of hindering knot-grass made;</LINE>
+<LINE>You bead, you acorn.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>You are too officious</LINE>
+<LINE>In her behalf that scorns your services.</LINE>
+<LINE>Let her alone: speak not of Helena;</LINE>
+<LINE>Take not her part; for, if thou dost intend</LINE>
+<LINE>Never so little show of love to her,</LINE>
+<LINE>Thou shalt aby it.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Now she holds me not;</LINE>
+<LINE>Now follow, if thou darest, to try whose right,</LINE>
+<LINE>Of thine or mine, is most in Helena.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Follow! nay, I'll go with thee, cheek by jole.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt LYSANDER and DEMETRIUS</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>You, mistress, all this coil is 'long of you:</LINE>
+<LINE>Nay, go not back.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>I will not trust you, I,</LINE>
+<LINE>Nor longer stay in your curst company.</LINE>
+<LINE>Your hands than mine are quicker for a fray,</LINE>
+<LINE>My legs are longer though, to run away.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>I am amazed, and know not what to say.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>This is thy negligence: still thou mistakest,</LINE>
+<LINE>Or else committ'st thy knaveries wilfully.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Believe me, king of shadows, I mistook.</LINE>
+<LINE>Did not you tell me I should know the man</LINE>
+<LINE>By the Athenian garment be had on?</LINE>
+<LINE>And so far blameless proves my enterprise,</LINE>
+<LINE>That I have 'nointed an Athenian's eyes;</LINE>
+<LINE>And so far am I glad it so did sort</LINE>
+<LINE>As this their jangling I esteem a sport.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Thou see'st these lovers seek a place to fight:</LINE>
+<LINE>Hie therefore, Robin, overcast the night;</LINE>
+<LINE>The starry welkin cover thou anon</LINE>
+<LINE>With drooping fog as black as Acheron,</LINE>
+<LINE>And lead these testy rivals so astray</LINE>
+<LINE>As one come not within another's way.</LINE>
+<LINE>Like to Lysander sometime frame thy tongue,</LINE>
+<LINE>Then stir Demetrius up with bitter wrong;</LINE>
+<LINE>And sometime rail thou like Demetrius;</LINE>
+<LINE>And from each other look thou lead them thus,</LINE>
+<LINE>Till o'er their brows death-counterfeiting sleep</LINE>
+<LINE>With leaden legs and batty wings doth creep:</LINE>
+<LINE>Then crush this herb into Lysander's eye;</LINE>
+<LINE>Whose liquor hath this virtuous property,</LINE>
+<LINE>To take from thence all error with his might,</LINE>
+<LINE>And make his eyeballs roll with wonted sight.</LINE>
+<LINE>When they next wake, all this derision</LINE>
+<LINE>Shall seem a dream and fruitless vision,</LINE>
+<LINE>And back to Athens shall the lovers wend,</LINE>
+<LINE>With league whose date till death shall never end.</LINE>
+<LINE>Whiles I in this affair do thee employ,</LINE>
+<LINE>I'll to my queen and beg her Indian boy;</LINE>
+<LINE>And then I will her charmed eye release</LINE>
+<LINE>From monster's view, and all things shall be peace.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>My fairy lord, this must be done with haste,</LINE>
+<LINE>For night's swift dragons cut the clouds full fast,</LINE>
+<LINE>And yonder shines Aurora's harbinger;</LINE>
+<LINE>At whose approach, ghosts, wandering here and there,</LINE>
+<LINE>Troop home to churchyards: damned spirits all,</LINE>
+<LINE>That in crossways and floods have burial,</LINE>
+<LINE>Already to their wormy beds are gone;</LINE>
+<LINE>For fear lest day should look their shames upon,</LINE>
+<LINE>They willfully themselves exile from light</LINE>
+<LINE>And must for aye consort with black-brow'd night.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>But we are spirits of another sort:</LINE>
+<LINE>I with the morning's love have oft made sport,</LINE>
+<LINE>And, like a forester, the groves may tread,</LINE>
+<LINE>Even till the eastern gate, all fiery-red,</LINE>
+<LINE>Opening on Neptune with fair blessed beams,</LINE>
+<LINE>Turns into yellow gold his salt green streams.</LINE>
+<LINE>But, notwithstanding, haste; make no delay:</LINE>
+<LINE>We may effect this business yet ere day.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Up and down, up and down,</LINE>
+<LINE>I will lead them up and down:</LINE>
+<LINE>I am fear'd in field and town:</LINE>
+<LINE>Goblin, lead them up and down.</LINE>
+<LINE>Here comes one.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Re-enter LYSANDER</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Where art thou, proud Demetrius? speak thou now.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Here, villain; drawn and ready. Where art thou?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>I will be with thee straight.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Follow me, then,</LINE>
+<LINE>To plainer ground.</LINE>
+</SPEECH>
+
+<STAGEDIR>Exit LYSANDER, as following the voice</STAGEDIR>
+<STAGEDIR>Re-enter DEMETRIUS</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Lysander! speak again:</LINE>
+<LINE>Thou runaway, thou coward, art thou fled?</LINE>
+<LINE>Speak! In some bush? Where dost thou hide thy head?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Thou coward, art thou bragging to the stars,</LINE>
+<LINE>Telling the bushes that thou look'st for wars,</LINE>
+<LINE>And wilt not come? Come, recreant; come, thou child;</LINE>
+<LINE>I'll whip thee with a rod: he is defiled</LINE>
+<LINE>That draws a sword on thee.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Yea, art thou there?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Follow my voice: we'll try no manhood here.</LINE>
+</SPEECH>
+
+<STAGEDIR>Exeunt</STAGEDIR>
+<STAGEDIR>Re-enter LYSANDER</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>He goes before me and still dares me on:</LINE>
+<LINE>When I come where he calls, then he is gone.</LINE>
+<LINE>The villain is much lighter-heel'd than I:</LINE>
+<LINE>I follow'd fast, but faster he did fly;</LINE>
+<LINE>That fallen am I in dark uneven way,</LINE>
+<LINE>And here will rest me.</LINE>
+<STAGEDIR>Lies down</STAGEDIR>
+<LINE>Come, thou gentle day!</LINE>
+<LINE>For if but once thou show me thy grey light,</LINE>
+<LINE>I'll find Demetrius and revenge this spite.</LINE>
+</SPEECH>
+
+<STAGEDIR>Sleeps</STAGEDIR>
+<STAGEDIR>Re-enter PUCK and DEMETRIUS</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Ho, ho, ho! Coward, why comest thou not?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Abide me, if thou darest; for well I wot</LINE>
+<LINE>Thou runn'st before me, shifting every place,</LINE>
+<LINE>And darest not stand, nor look me in the face.</LINE>
+<LINE>Where art thou now?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Come hither: I am here.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Nay, then, thou mock'st me. Thou shalt buy this dear,</LINE>
+<LINE>If ever I thy face by daylight see:</LINE>
+<LINE>Now, go thy way. Faintness constraineth me</LINE>
+<LINE>To measure out my length on this cold bed.</LINE>
+<LINE>By day's approach look to be visited.</LINE>
+</SPEECH>
+
+<STAGEDIR>Lies down and sleeps</STAGEDIR>
+<STAGEDIR>Re-enter HELENA</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>O weary night, O long and tedious night,</LINE>
+<LINE>Abate thy hour! Shine comforts from the east,</LINE>
+<LINE>That I may back to Athens by daylight,</LINE>
+<LINE>From these that my poor company detest:</LINE>
+<LINE>And sleep, that sometimes shuts up sorrow's eye,</LINE>
+<LINE>Steal me awhile from mine own company.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Lies down and sleeps</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Yet but three? Come one more;</LINE>
+<LINE>Two of both kinds make up four.</LINE>
+<LINE>Here she comes, curst and sad:</LINE>
+<LINE>Cupid is a knavish lad,</LINE>
+<LINE>Thus to make poor females mad.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Re-enter HERMIA</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Never so weary, never so in woe,</LINE>
+<LINE>Bedabbled with the dew and torn with briers,</LINE>
+<LINE>I can no further crawl, no further go;</LINE>
+<LINE>My legs can keep no pace with my desires.</LINE>
+<LINE>Here will I rest me till the break of day.</LINE>
+<LINE>Heavens shield Lysander, if they mean a fray!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Lies down and sleeps</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>On the ground</LINE>
+<LINE>Sleep sound:</LINE>
+<LINE>I'll apply</LINE>
+<LINE>To your eye,</LINE>
+<LINE>Gentle lover, remedy.</LINE>
+<STAGEDIR>Squeezing the juice on LYSANDER's eyes</STAGEDIR>
+<LINE>When thou wakest,</LINE>
+<LINE>Thou takest</LINE>
+<LINE>True delight</LINE>
+<LINE>In the sight</LINE>
+<LINE>Of thy former lady's eye:</LINE>
+<LINE>And the country proverb known,</LINE>
+<LINE>That every man should take his own,</LINE>
+<LINE>In your waking shall be shown:</LINE>
+<LINE>Jack shall have Jill;</LINE>
+<LINE>Nought shall go ill;</LINE>
+<LINE>The man shall have his mare again, and all shall be well.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+</SCENE>
+
+</ACT>
+
+<ACT><TITLE>ACT IV</TITLE>
+
+<SCENE><TITLE>SCENE I.  The same. LYSANDER, DEMETRIUS, HELENA, and HERMIA lying asleep.</TITLE>
+<STAGEDIR>Enter TITANIA and BOTTOM; PEASEBLOSSOM, COBWEB, MOTH,
+MUSTARDSEED, and other Fairies attending; OBERON
+behind unseen</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Come, sit thee down upon this flowery bed,</LINE>
+<LINE>While I thy amiable cheeks do coy,</LINE>
+<LINE>And stick musk-roses in thy sleek smooth head,</LINE>
+<LINE>And kiss thy fair large ears, my gentle joy.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Where's Peaseblossom?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PEASEBLOSSOM</SPEAKER>
+<LINE>Ready.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Scratch my head Peaseblossom. Where's Mounsieur Cobweb?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>COBWEB</SPEAKER>
+<LINE>Ready.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Mounsieur Cobweb, good mounsieur, get you your</LINE>
+<LINE>weapons in your hand, and kill me a red-hipped</LINE>
+<LINE>humble-bee on the top of a thistle; and, good</LINE>
+<LINE>mounsieur, bring me the honey-bag. Do not fret</LINE>
+<LINE>yourself too much in the action, mounsieur; and,</LINE>
+<LINE>good mounsieur, have a care the honey-bag break not;</LINE>
+<LINE>I would be loath to have you overflown with a</LINE>
+<LINE>honey-bag, signior. Where's Mounsieur Mustardseed?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>MUSTARDSEED</SPEAKER>
+<LINE>Ready.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Give me your neaf, Mounsieur Mustardseed. Pray you,</LINE>
+<LINE>leave your courtesy, good mounsieur.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>MUSTARDSEED</SPEAKER>
+<LINE>What's your Will?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Nothing, good mounsieur, but to help Cavalery Cobweb</LINE>
+<LINE>to scratch. I must to the barber's, monsieur; for</LINE>
+<LINE>methinks I am marvellous hairy about the face; and I</LINE>
+<LINE>am such a tender ass, if my hair do but tickle me,</LINE>
+<LINE>I must scratch.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>What, wilt thou hear some music,</LINE>
+<LINE>my sweet love?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>I have a reasonable good ear in music. Let's have</LINE>
+<LINE>the tongs and the bones.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Or say, sweet love, what thou desirest to eat.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Truly, a peck of provender: I could munch your good</LINE>
+<LINE>dry oats. Methinks I have a great desire to a bottle</LINE>
+<LINE>of hay: good hay, sweet hay, hath no fellow.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>I have a venturous fairy that shall seek</LINE>
+<LINE>The squirrel's hoard, and fetch thee new nuts.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>I had rather have a handful or two of dried peas.</LINE>
+<LINE>But, I pray you, let none of your people stir me: I</LINE>
+<LINE>have an exposition of sleep come upon me.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Sleep thou, and I will wind thee in my arms.</LINE>
+<LINE>Fairies, begone, and be all ways away.</LINE>
+<STAGEDIR>Exeunt fairies</STAGEDIR>
+<LINE>So doth the woodbine the sweet honeysuckle</LINE>
+<LINE>Gently entwist; the female ivy so</LINE>
+<LINE>Enrings the barky fingers of the elm.</LINE>
+<LINE>O, how I love thee! how I dote on thee!</LINE>
+</SPEECH>
+
+<STAGEDIR>They sleep</STAGEDIR>
+<STAGEDIR>Enter PUCK</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE><STAGEDIR>Advancing</STAGEDIR>  Welcome, good Robin.</LINE>
+<LINE>See'st thou this sweet sight?</LINE>
+<LINE>Her dotage now I do begin to pity:</LINE>
+<LINE>For, meeting her of late behind the wood,</LINE>
+<LINE>Seeking sweet favours from this hateful fool,</LINE>
+<LINE>I did upbraid her and fall out with her;</LINE>
+<LINE>For she his hairy temples then had rounded</LINE>
+<LINE>With a coronet of fresh and fragrant flowers;</LINE>
+<LINE>And that same dew, which sometime on the buds</LINE>
+<LINE>Was wont to swell like round and orient pearls,</LINE>
+<LINE>Stood now within the pretty flowerets' eyes</LINE>
+<LINE>Like tears that did their own disgrace bewail.</LINE>
+<LINE>When I had at my pleasure taunted her</LINE>
+<LINE>And she in mild terms begg'd my patience,</LINE>
+<LINE>I then did ask of her her changeling child;</LINE>
+<LINE>Which straight she gave me, and her fairy sent</LINE>
+<LINE>To bear him to my bower in fairy land.</LINE>
+<LINE>And now I have the boy, I will undo</LINE>
+<LINE>This hateful imperfection of her eyes:</LINE>
+<LINE>And, gentle Puck, take this transformed scalp</LINE>
+<LINE>From off the head of this Athenian swain;</LINE>
+<LINE>That, he awaking when the other do,</LINE>
+<LINE>May all to Athens back again repair</LINE>
+<LINE>And think no more of this night's accidents</LINE>
+<LINE>But as the fierce vexation of a dream.</LINE>
+<LINE>But first I will release the fairy queen.</LINE>
+<LINE>Be as thou wast wont to be;</LINE>
+<LINE>See as thou wast wont to see:</LINE>
+<LINE>Dian's bud o'er Cupid's flower</LINE>
+<LINE>Hath such force and blessed power.</LINE>
+<LINE>Now, my Titania; wake you, my sweet queen.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>My Oberon! what visions have I seen!</LINE>
+<LINE>Methought I was enamour'd of an ass.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>There lies your love.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>How came these things to pass?</LINE>
+<LINE>O, how mine eyes do loathe his visage now!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Silence awhile. Robin, take off this head.</LINE>
+<LINE>Titania, music call; and strike more dead</LINE>
+<LINE>Than common sleep of all these five the sense.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Music, ho! music, such as charmeth sleep!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Music, still</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Now, when thou wakest, with thine</LINE>
+<LINE>own fool's eyes peep.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Sound, music! Come, my queen, take hands with me,</LINE>
+<LINE>And rock the ground whereon these sleepers be.</LINE>
+<LINE>Now thou and I are new in amity,</LINE>
+<LINE>And will to-morrow midnight solemnly</LINE>
+<LINE>Dance in Duke Theseus' house triumphantly,</LINE>
+<LINE>And bless it to all fair prosperity:</LINE>
+<LINE>There shall the pairs of faithful lovers be</LINE>
+<LINE>Wedded, with Theseus, all in jollity.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Fairy king, attend, and mark:</LINE>
+<LINE>I do hear the morning lark.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Then, my queen, in silence sad,</LINE>
+<LINE>Trip we after the night's shade:</LINE>
+<LINE>We the globe can compass soon,</LINE>
+<LINE>Swifter than the wandering moon.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>Come, my lord, and in our flight</LINE>
+<LINE>Tell me how it came this night</LINE>
+<LINE>That I sleeping here was found</LINE>
+<LINE>With these mortals on the ground.</LINE>
+<STAGEDIR>Exeunt</STAGEDIR>
+</SPEECH>
+
+<STAGEDIR>Horns winded within</STAGEDIR>
+<STAGEDIR>Enter THESEUS, HIPPOLYTA, EGEUS, and train</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Go, one of you, find out the forester;</LINE>
+<LINE>For now our observation is perform'd;</LINE>
+<LINE>And since we have the vaward of the day,</LINE>
+<LINE>My love shall hear the music of my hounds.</LINE>
+<LINE>Uncouple in the western valley; let them go:</LINE>
+<LINE>Dispatch, I say, and find the forester.</LINE>
+<STAGEDIR>Exit an Attendant</STAGEDIR>
+<LINE>We will, fair queen, up to the mountain's top,</LINE>
+<LINE>And mark the musical confusion</LINE>
+<LINE>Of hounds and echo in conjunction.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>I was with Hercules and Cadmus once,</LINE>
+<LINE>When in a wood of Crete they bay'd the bear</LINE>
+<LINE>With hounds of Sparta: never did I hear</LINE>
+<LINE>Such gallant chiding: for, besides the groves,</LINE>
+<LINE>The skies, the fountains, every region near</LINE>
+<LINE>Seem'd all one mutual cry: I never heard</LINE>
+<LINE>So musical a discord, such sweet thunder.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>My hounds are bred out of the Spartan kind,</LINE>
+<LINE>So flew'd, so sanded, and their heads are hung</LINE>
+<LINE>With ears that sweep away the morning dew;</LINE>
+<LINE>Crook-knee'd, and dew-lapp'd like Thessalian bulls;</LINE>
+<LINE>Slow in pursuit, but match'd in mouth like bells,</LINE>
+<LINE>Each under each. A cry more tuneable</LINE>
+<LINE>Was never holla'd to, nor cheer'd with horn,</LINE>
+<LINE>In Crete, in Sparta, nor in Thessaly:</LINE>
+<LINE>Judge when you hear. But, soft! what nymphs are these?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>EGEUS</SPEAKER>
+<LINE>My lord, this is my daughter here asleep;</LINE>
+<LINE>And this, Lysander; this Demetrius is;</LINE>
+<LINE>This Helena, old Nedar's Helena:</LINE>
+<LINE>I wonder of their being here together.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>No doubt they rose up early to observe</LINE>
+<LINE>The rite of May, and hearing our intent,</LINE>
+<LINE>Came here in grace our solemnity.</LINE>
+<LINE>But speak, Egeus; is not this the day</LINE>
+<LINE>That Hermia should give answer of her choice?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>EGEUS</SPEAKER>
+<LINE>It is, my lord.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Go, bid the huntsmen wake them with their horns.</LINE>
+<STAGEDIR>Horns and shout within. LYSANDER, DEMETRIUS,
+HELENA, and HERMIA wake and start up</STAGEDIR>
+<LINE>Good morrow, friends. Saint Valentine is past:</LINE>
+<LINE>Begin these wood-birds but to couple now?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Pardon, my lord.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>I pray you all, stand up.</LINE>
+<LINE>I know you two are rival enemies:</LINE>
+<LINE>How comes this gentle concord in the world,</LINE>
+<LINE>That hatred is so far from jealousy,</LINE>
+<LINE>To sleep by hate, and fear no enmity?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>My lord, I shall reply amazedly,</LINE>
+<LINE>Half sleep, half waking: but as yet, I swear,</LINE>
+<LINE>I cannot truly say how I came here;</LINE>
+<LINE>But, as I think,--for truly would I speak,</LINE>
+<LINE>And now do I bethink me, so it is,--</LINE>
+<LINE>I came with Hermia hither: our intent</LINE>
+<LINE>Was to be gone from Athens, where we might,</LINE>
+<LINE>Without the peril of the Athenian law.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>EGEUS</SPEAKER>
+<LINE>Enough, enough, my lord; you have enough:</LINE>
+<LINE>I beg the law, the law, upon his head.</LINE>
+<LINE>They would have stolen away; they would, Demetrius,</LINE>
+<LINE>Thereby to have defeated you and me,</LINE>
+<LINE>You of your wife and me of my consent,</LINE>
+<LINE>Of my consent that she should be your wife.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>My lord, fair Helen told me of their stealth,</LINE>
+<LINE>Of this their purpose hither to this wood;</LINE>
+<LINE>And I in fury hither follow'd them,</LINE>
+<LINE>Fair Helena in fancy following me.</LINE>
+<LINE>But, my good lord, I wot not by what power,--</LINE>
+<LINE>But by some power it is,--my love to Hermia,</LINE>
+<LINE>Melted as the snow, seems to me now</LINE>
+<LINE>As the remembrance of an idle gaud</LINE>
+<LINE>Which in my childhood I did dote upon;</LINE>
+<LINE>And all the faith, the virtue of my heart,</LINE>
+<LINE>The object and the pleasure of mine eye,</LINE>
+<LINE>Is only Helena. To her, my lord,</LINE>
+<LINE>Was I betroth'd ere I saw Hermia:</LINE>
+<LINE>But, like in sickness, did I loathe this food;</LINE>
+<LINE>But, as in health, come to my natural taste,</LINE>
+<LINE>Now I do wish it, love it, long for it,</LINE>
+<LINE>And will for evermore be true to it.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Fair lovers, you are fortunately met:</LINE>
+<LINE>Of this discourse we more will hear anon.</LINE>
+<LINE>Egeus, I will overbear your will;</LINE>
+<LINE>For in the temple by and by with us</LINE>
+<LINE>These couples shall eternally be knit:</LINE>
+<LINE>And, for the morning now is something worn,</LINE>
+<LINE>Our purposed hunting shall be set aside.</LINE>
+<LINE>Away with us to Athens; three and three,</LINE>
+<LINE>We'll hold a feast in great solemnity.</LINE>
+<LINE>Come, Hippolyta.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt THESEUS, HIPPOLYTA, EGEUS, and train</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>These things seem small and undistinguishable,</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Methinks I see these things with parted eye,</LINE>
+<LINE>When every thing seems double.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>So methinks:</LINE>
+<LINE>And I have found Demetrius like a jewel,</LINE>
+<LINE>Mine own, and not mine own.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Are you sure</LINE>
+<LINE>That we are awake? It seems to me</LINE>
+<LINE>That yet we sleep, we dream. Do not you think</LINE>
+<LINE>The duke was here, and bid us follow him?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HERMIA</SPEAKER>
+<LINE>Yea; and my father.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HELENA</SPEAKER>
+<LINE>And Hippolyta.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>And he did bid us follow to the temple.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Why, then, we are awake: let's follow him</LINE>
+<LINE>And by the way let us recount our dreams.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE><STAGEDIR>Awaking</STAGEDIR>  When my cue comes, call me, and I will</LINE>
+<LINE>answer: my next is, 'Most fair Pyramus.' Heigh-ho!</LINE>
+<LINE>Peter Quince! Flute, the bellows-mender! Snout,</LINE>
+<LINE>the tinker! Starveling! God's my life, stolen</LINE>
+<LINE>hence, and left me asleep! I have had a most rare</LINE>
+<LINE>vision. I have had a dream, past the wit of man to</LINE>
+<LINE>say what dream it was: man is but an ass, if he go</LINE>
+<LINE>about to expound this dream. Methought I was--there</LINE>
+<LINE>is no man can tell what. Methought I was,--and</LINE>
+<LINE>methought I had,--but man is but a patched fool, if</LINE>
+<LINE>he will offer to say what methought I had. The eye</LINE>
+<LINE>of man hath not heard, the ear of man hath not</LINE>
+<LINE>seen, man's hand is not able to taste, his tongue</LINE>
+<LINE>to conceive, nor his heart to report, what my dream</LINE>
+<LINE>was. I will get Peter Quince to write a ballad of</LINE>
+<LINE>this dream: it shall be called Bottom's Dream,</LINE>
+<LINE>because it hath no bottom; and I will sing it in the</LINE>
+<LINE>latter end of a play, before the duke:</LINE>
+<LINE>peradventure, to make it the more gracious, I shall</LINE>
+<LINE>sing it at her death.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+</SCENE>
+
+<SCENE><TITLE>SCENE II.  Athens. QUINCE'S house.</TITLE>
+<STAGEDIR>Enter QUINCE, FLUTE, SNOUT, and STARVELING</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Have you sent to Bottom's house? is he come home yet?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>STARVELING</SPEAKER>
+<LINE>He cannot be heard of. Out of doubt he is</LINE>
+<LINE>transported.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>If he come not, then the play is marred: it goes</LINE>
+<LINE>not forward, doth it?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>It is not possible: you have not a man in all</LINE>
+<LINE>Athens able to discharge Pyramus but he.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>No, he hath simply the best wit of any handicraft</LINE>
+<LINE>man in Athens.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Yea and the best person too; and he is a very</LINE>
+<LINE>paramour for a sweet voice.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>You must say 'paragon:' a paramour is, God bless us,</LINE>
+<LINE>a thing of naught.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter SNUG</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>SNUG</SPEAKER>
+<LINE>Masters, the duke is coming from the temple, and</LINE>
+<LINE>there is two or three lords and ladies more married:</LINE>
+<LINE>if our sport had gone forward, we had all been made</LINE>
+<LINE>men.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>FLUTE</SPEAKER>
+<LINE>O sweet bully Bottom! Thus hath he lost sixpence a</LINE>
+<LINE>day during his life; he could not have 'scaped</LINE>
+<LINE>sixpence a day: an the duke had not given him</LINE>
+<LINE>sixpence a day for playing Pyramus, I'll be hanged;</LINE>
+<LINE>he would have deserved it: sixpence a day in</LINE>
+<LINE>Pyramus, or nothing.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter BOTTOM</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Where are these lads? where are these hearts?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Bottom! O most courageous day! O most happy hour!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Masters, I am to discourse wonders: but ask me not</LINE>
+<LINE>what; for if I tell you, I am no true Athenian. I</LINE>
+<LINE>will tell you every thing, right as it fell out.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>QUINCE</SPEAKER>
+<LINE>Let us hear, sweet Bottom.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE>Not a word of me. All that I will tell you is, that</LINE>
+<LINE>the duke hath dined. Get your apparel together,</LINE>
+<LINE>good strings to your beards, new ribbons to your</LINE>
+<LINE>pumps; meet presently at the palace; every man look</LINE>
+<LINE>o'er his part; for the short and the long is, our</LINE>
+<LINE>play is preferred. In any case, let Thisby have</LINE>
+<LINE>clean linen; and let not him that plays the lion</LINE>
+<LINE>pair his nails, for they shall hang out for the</LINE>
+<LINE>lion's claws. And, most dear actors, eat no onions</LINE>
+<LINE>nor garlic, for we are to utter sweet breath; and I</LINE>
+<LINE>do not doubt but to hear them say, it is a sweet</LINE>
+<LINE>comedy. No more words: away! go, away!</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt</STAGEDIR>
+</SCENE>
+
+</ACT>
+
+<ACT><TITLE>ACT V</TITLE>
+
+<SCENE><TITLE>SCENE I.  Athens. The palace of THESEUS.</TITLE>
+<STAGEDIR>Enter THESEUS, HIPPOLYTA, PHILOSTRATE, Lords and
+Attendants</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>'Tis strange my Theseus, that these</LINE>
+<LINE>lovers speak of.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>More strange than true: I never may believe</LINE>
+<LINE>These antique fables, nor these fairy toys.</LINE>
+<LINE>Lovers and madmen have such seething brains,</LINE>
+<LINE>Such shaping fantasies, that apprehend</LINE>
+<LINE>More than cool reason ever comprehends.</LINE>
+<LINE>The lunatic, the lover and the poet</LINE>
+<LINE>Are of imagination all compact:</LINE>
+<LINE>One sees more devils than vast hell can hold,</LINE>
+<LINE>That is, the madman: the lover, all as frantic,</LINE>
+<LINE>Sees Helen's beauty in a brow of Egypt:</LINE>
+<LINE>The poet's eye, in fine frenzy rolling,</LINE>
+<LINE>Doth glance from heaven to earth, from earth to heaven;</LINE>
+<LINE>And as imagination bodies forth</LINE>
+<LINE>The forms of things unknown, the poet's pen</LINE>
+<LINE>Turns them to shapes and gives to airy nothing</LINE>
+<LINE>A local habitation and a name.</LINE>
+<LINE>Such tricks hath strong imagination,</LINE>
+<LINE>That if it would but apprehend some joy,</LINE>
+<LINE>It comprehends some bringer of that joy;</LINE>
+<LINE>Or in the night, imagining some fear,</LINE>
+<LINE>How easy is a bush supposed a bear!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>But all the story of the night told over,</LINE>
+<LINE>And all their minds transfigured so together,</LINE>
+<LINE>More witnesseth than fancy's images</LINE>
+<LINE>And grows to something of great constancy;</LINE>
+<LINE>But, howsoever, strange and admirable.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Here come the lovers, full of joy and mirth.</LINE>
+<STAGEDIR>Enter LYSANDER, DEMETRIUS, HERMIA, and HELENA</STAGEDIR>
+<LINE>Joy, gentle friends! joy and fresh days of love</LINE>
+<LINE>Accompany your hearts!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>More than to us</LINE>
+<LINE>Wait in your royal walks, your board, your bed!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Come now; what masques, what dances shall we have,</LINE>
+<LINE>To wear away this long age of three hours</LINE>
+<LINE>Between our after-supper and bed-time?</LINE>
+<LINE>Where is our usual manager of mirth?</LINE>
+<LINE>What revels are in hand? Is there no play,</LINE>
+<LINE>To ease the anguish of a torturing hour?</LINE>
+<LINE>Call Philostrate.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PHILOSTRATE</SPEAKER>
+<LINE>Here, mighty Theseus.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Say, what abridgement have you for this evening?</LINE>
+<LINE>What masque? what music? How shall we beguile</LINE>
+<LINE>The lazy time, if not with some delight?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PHILOSTRATE</SPEAKER>
+<LINE>There is a brief how many sports are ripe:</LINE>
+<LINE>Make choice of which your highness will see first.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Giving a paper</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE><STAGEDIR>Reads</STAGEDIR>  'The battle with the Centaurs, to be sung</LINE>
+<LINE>By an Athenian eunuch to the harp.'</LINE>
+<LINE>We'll none of that: that have I told my love,</LINE>
+<LINE>In glory of my kinsman Hercules.</LINE>
+<STAGEDIR>Reads</STAGEDIR>
+<LINE>'The riot of the tipsy Bacchanals,</LINE>
+<LINE>Tearing the Thracian singer in their rage.'</LINE>
+<LINE>That is an old device; and it was play'd</LINE>
+<LINE>When I from Thebes came last a conqueror.</LINE>
+<STAGEDIR>Reads</STAGEDIR>
+<LINE>'The thrice three Muses mourning for the death</LINE>
+<LINE>Of Learning, late deceased in beggary.'</LINE>
+<LINE>That is some satire, keen and critical,</LINE>
+<LINE>Not sorting with a nuptial ceremony.</LINE>
+<STAGEDIR>Reads</STAGEDIR>
+<LINE>'A tedious brief scene of young Pyramus</LINE>
+<LINE>And his love Thisbe; very tragical mirth.'</LINE>
+<LINE>Merry and tragical! tedious and brief!</LINE>
+<LINE>That is, hot ice and wondrous strange snow.</LINE>
+<LINE>How shall we find the concord of this discord?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PHILOSTRATE</SPEAKER>
+<LINE>A play there is, my lord, some ten words long,</LINE>
+<LINE>Which is as brief as I have known a play;</LINE>
+<LINE>But by ten words, my lord, it is too long,</LINE>
+<LINE>Which makes it tedious; for in all the play</LINE>
+<LINE>There is not one word apt, one player fitted:</LINE>
+<LINE>And tragical, my noble lord, it is;</LINE>
+<LINE>For Pyramus therein doth kill himself.</LINE>
+<LINE>Which, when I saw rehearsed, I must confess,</LINE>
+<LINE>Made mine eyes water; but more merry tears</LINE>
+<LINE>The passion of loud laughter never shed.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>What are they that do play it?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PHILOSTRATE</SPEAKER>
+<LINE>Hard-handed men that work in Athens here,</LINE>
+<LINE>Which never labour'd in their minds till now,</LINE>
+<LINE>And now have toil'd their unbreathed memories</LINE>
+<LINE>With this same play, against your nuptial.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>And we will hear it.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>PHILOSTRATE</SPEAKER>
+<LINE>No, my noble lord;</LINE>
+<LINE>It is not for you: I have heard it over,</LINE>
+<LINE>And it is nothing, nothing in the world;</LINE>
+<LINE>Unless you can find sport in their intents,</LINE>
+<LINE>Extremely stretch'd and conn'd with cruel pain,</LINE>
+<LINE>To do you service.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>I will hear that play;</LINE>
+<LINE>For never anything can be amiss,</LINE>
+<LINE>When simpleness and duty tender it.</LINE>
+<LINE>Go, bring them in: and take your places, ladies.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit PHILOSTRATE</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>I love not to see wretchedness o'er charged</LINE>
+<LINE>And duty in his service perishing.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Why, gentle sweet, you shall see no such thing.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>He says they can do nothing in this kind.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>The kinder we, to give them thanks for nothing.</LINE>
+<LINE>Our sport shall be to take what they mistake:</LINE>
+<LINE>And what poor duty cannot do, noble respect</LINE>
+<LINE>Takes it in might, not merit.</LINE>
+<LINE>Where I have come, great clerks have purposed</LINE>
+<LINE>To greet me with premeditated welcomes;</LINE>
+<LINE>Where I have seen them shiver and look pale,</LINE>
+<LINE>Make periods in the midst of sentences,</LINE>
+<LINE>Throttle their practised accent in their fears</LINE>
+<LINE>And in conclusion dumbly have broke off,</LINE>
+<LINE>Not paying me a welcome. Trust me, sweet,</LINE>
+<LINE>Out of this silence yet I pick'd a welcome;</LINE>
+<LINE>And in the modesty of fearful duty</LINE>
+<LINE>I read as much as from the rattling tongue</LINE>
+<LINE>Of saucy and audacious eloquence.</LINE>
+<LINE>Love, therefore, and tongue-tied simplicity</LINE>
+<LINE>In least speak most, to my capacity.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Re-enter PHILOSTRATE</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PHILOSTRATE</SPEAKER>
+<LINE>So please your grace, the Prologue is address'd.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Let him approach.</LINE>
+</SPEECH>
+
+<STAGEDIR>Flourish of trumpets</STAGEDIR>
+<STAGEDIR>Enter QUINCE for the Prologue</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>Prologue</SPEAKER>
+<LINE>If we offend, it is with our good will.</LINE>
+<LINE>That you should think, we come not to offend,</LINE>
+<LINE>But with good will. To show our simple skill,</LINE>
+<LINE>That is the true beginning of our end.</LINE>
+<LINE>Consider then we come but in despite.</LINE>
+<LINE>We do not come as minding to contest you,</LINE>
+<LINE>Our true intent is. All for your delight</LINE>
+<LINE>We are not here. That you should here repent you,</LINE>
+<LINE>The actors are at hand and by their show</LINE>
+<LINE>You shall know all that you are like to know.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>This fellow doth not stand upon points.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>He hath rid his prologue like a rough colt; he knows</LINE>
+<LINE>not the stop. A good moral, my lord: it is not</LINE>
+<LINE>enough to speak, but to speak true.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>Indeed he hath played on his prologue like a child</LINE>
+<LINE>on a recorder; a sound, but not in government.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>His speech, was like a tangled chain; nothing</LINE>
+<LINE>impaired, but all disordered. Who is next?</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter Pyramus and Thisbe, Wall, Moonshine, and Lion</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>Prologue</SPEAKER>
+<LINE>Gentles, perchance you wonder at this show;</LINE>
+<LINE>But wonder on, till truth make all things plain.</LINE>
+<LINE>This man is Pyramus, if you would know;</LINE>
+<LINE>This beauteous lady Thisby is certain.</LINE>
+<LINE>This man, with lime and rough-cast, doth present</LINE>
+<LINE>Wall, that vile Wall which did these lovers sunder;</LINE>
+<LINE>And through Wall's chink, poor souls, they are content</LINE>
+<LINE>To whisper. At the which let no man wonder.</LINE>
+<LINE>This man, with lanthorn, dog, and bush of thorn,</LINE>
+<LINE>Presenteth Moonshine; for, if you will know,</LINE>
+<LINE>By moonshine did these lovers think no scorn</LINE>
+<LINE>To meet at Ninus' tomb, there, there to woo.</LINE>
+<LINE>This grisly beast, which Lion hight by name,</LINE>
+<LINE>The trusty Thisby, coming first by night,</LINE>
+<LINE>Did scare away, or rather did affright;</LINE>
+<LINE>And, as she fled, her mantle she did fall,</LINE>
+<LINE>Which Lion vile with bloody mouth did stain.</LINE>
+<LINE>Anon comes Pyramus, sweet youth and tall,</LINE>
+<LINE>And finds his trusty Thisby's mantle slain:</LINE>
+<LINE>Whereat, with blade, with bloody blameful blade,</LINE>
+<LINE>He bravely broach'd is boiling bloody breast;</LINE>
+<LINE>And Thisby, tarrying in mulberry shade,</LINE>
+<LINE>His dagger drew, and died. For all the rest,</LINE>
+<LINE>Let Lion, Moonshine, Wall, and lovers twain</LINE>
+<LINE>At large discourse, while here they do remain.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt Prologue, Thisbe, Lion, and Moonshine</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>I wonder if the lion be to speak.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>No wonder, my lord: one lion may, when many asses do.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Wall</SPEAKER>
+<LINE>In this same interlude it doth befall</LINE>
+<LINE>That I, one Snout by name, present a wall;</LINE>
+<LINE>And such a wall, as I would have you think,</LINE>
+<LINE>That had in it a crannied hole or chink,</LINE>
+<LINE>Through which the lovers, Pyramus and Thisby,</LINE>
+<LINE>Did whisper often very secretly.</LINE>
+<LINE>This loam, this rough-cast and this stone doth show</LINE>
+<LINE>That I am that same wall; the truth is so:</LINE>
+<LINE>And this the cranny is, right and sinister,</LINE>
+<LINE>Through which the fearful lovers are to whisper.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Would you desire lime and hair to speak better?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>It is the wittiest partition that ever I heard</LINE>
+<LINE>discourse, my lord.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter Pyramus</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Pyramus draws near the wall: silence!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>O grim-look'd night! O night with hue so black!</LINE>
+<LINE>O night, which ever art when day is not!</LINE>
+<LINE>O night, O night! alack, alack, alack,</LINE>
+<LINE>I fear my Thisby's promise is forgot!</LINE>
+<LINE>And thou, O wall, O sweet, O lovely wall,</LINE>
+<LINE>That stand'st between her father's ground and mine!</LINE>
+<LINE>Thou wall, O wall, O sweet and lovely wall,</LINE>
+<LINE>Show me thy chink, to blink through with mine eyne!</LINE>
+<STAGEDIR>Wall holds up his fingers</STAGEDIR>
+<LINE>Thanks, courteous wall: Jove shield thee well for this!</LINE>
+<LINE>But what see I? No Thisby do I see.</LINE>
+<LINE>O wicked wall, through whom I see no bliss!</LINE>
+<LINE>Cursed be thy stones for thus deceiving me!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>The wall, methinks, being sensible, should curse again.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>No, in truth, sir, he should not. 'Deceiving me'</LINE>
+<LINE>is Thisby's cue: she is to enter now, and I am to</LINE>
+<LINE>spy her through the wall. You shall see, it will</LINE>
+<LINE>fall pat as I told you. Yonder she comes.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter Thisbe</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>Thisbe</SPEAKER>
+<LINE>O wall, full often hast thou heard my moans,</LINE>
+<LINE>For parting my fair Pyramus and me!</LINE>
+<LINE>My cherry lips have often kiss'd thy stones,</LINE>
+<LINE>Thy stones with lime and hair knit up in thee.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>I see a voice: now will I to the chink,</LINE>
+<LINE>To spy an I can hear my Thisby's face. Thisby!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Thisbe</SPEAKER>
+<LINE>My love thou art, my love I think.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>Think what thou wilt, I am thy lover's grace;</LINE>
+<LINE>And, like Limander, am I trusty still.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Thisbe</SPEAKER>
+<LINE>And I like Helen, till the Fates me kill.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>Not Shafalus to Procrus was so true.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Thisbe</SPEAKER>
+<LINE>As Shafalus to Procrus, I to you.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>O kiss me through the hole of this vile wall!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Thisbe</SPEAKER>
+<LINE>I kiss the wall's hole, not your lips at all.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>Wilt thou at Ninny's tomb meet me straightway?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Thisbe</SPEAKER>
+<LINE>'Tide life, 'tide death, I come without delay.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt Pyramus and Thisbe</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>Wall</SPEAKER>
+<LINE>Thus have I, Wall, my part discharged so;</LINE>
+<LINE>And, being done, thus Wall away doth go.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Now is the mural down between the two neighbours.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>No remedy, my lord, when walls are so wilful to hear</LINE>
+<LINE>without warning.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>This is the silliest stuff that ever I heard.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>The best in this kind are but shadows; and the worst</LINE>
+<LINE>are no worse, if imagination amend them.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>It must be your imagination then, and not theirs.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>If we imagine no worse of them than they of</LINE>
+<LINE>themselves, they may pass for excellent men. Here</LINE>
+<LINE>come two noble beasts in, a man and a lion.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter Lion and Moonshine</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>Lion</SPEAKER>
+<LINE>You, ladies, you, whose gentle hearts do fear</LINE>
+<LINE>The smallest monstrous mouse that creeps on floor,</LINE>
+<LINE>May now perchance both quake and tremble here,</LINE>
+<LINE>When lion rough in wildest rage doth roar.</LINE>
+<LINE>Then know that I, one Snug the joiner, am</LINE>
+<LINE>A lion-fell, nor else no lion's dam;</LINE>
+<LINE>For, if I should as lion come in strife</LINE>
+<LINE>Into this place, 'twere pity on my life.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>A very gentle beast, of a good conscience.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>The very best at a beast, my lord, that e'er I saw.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>This lion is a very fox for his valour.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>True; and a goose for his discretion.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Not so, my lord; for his valour cannot carry his</LINE>
+<LINE>discretion; and the fox carries the goose.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>His discretion, I am sure, cannot carry his valour;</LINE>
+<LINE>for the goose carries not the fox. It is well:</LINE>
+<LINE>leave it to his discretion, and let us listen to the moon.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Moonshine</SPEAKER>
+<LINE>This lanthorn doth the horned moon present;--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>He should have worn the horns on his head.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>He is no crescent, and his horns are</LINE>
+<LINE>invisible within the circumference.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Moonshine</SPEAKER>
+<LINE>This lanthorn doth the horned moon present;</LINE>
+<LINE>Myself the man i' the moon do seem to be.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>This is the greatest error of all the rest: the man</LINE>
+<LINE>should be put into the lanthorn. How is it else the</LINE>
+<LINE>man i' the moon?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>He dares not come there for the candle; for, you</LINE>
+<LINE>see, it is already in snuff.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>I am aweary of this moon: would he would change!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>It appears, by his small light of discretion, that</LINE>
+<LINE>he is in the wane; but yet, in courtesy, in all</LINE>
+<LINE>reason, we must stay the time.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Proceed, Moon.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Moonshine</SPEAKER>
+<LINE>All that I have to say, is, to tell you that the</LINE>
+<LINE>lanthorn is the moon; I, the man in the moon; this</LINE>
+<LINE>thorn-bush, my thorn-bush; and this dog, my dog.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Why, all these should be in the lanthorn; for all</LINE>
+<LINE>these are in the moon. But, silence! here comes Thisbe.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter Thisbe</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>Thisbe</SPEAKER>
+<LINE>This is old Ninny's tomb. Where is my love?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Lion</SPEAKER>
+<LINE><STAGEDIR>Roaring</STAGEDIR>  Oh--</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Thisbe runs off</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Well roared, Lion.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Well run, Thisbe.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>Well shone, Moon. Truly, the moon shines with a</LINE>
+<LINE>good grace.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>The Lion shakes Thisbe's mantle, and exit</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Well moused, Lion.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>And so the lion vanished.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>And then came Pyramus.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter Pyramus</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>Sweet Moon, I thank thee for thy sunny beams;</LINE>
+<LINE>I thank thee, Moon, for shining now so bright;</LINE>
+<LINE>For, by thy gracious, golden, glittering gleams,</LINE>
+<LINE>I trust to take of truest Thisby sight.</LINE>
+<LINE>But stay, O spite!</LINE>
+<LINE>But mark, poor knight,</LINE>
+<LINE>What dreadful dole is here!</LINE>
+<LINE>Eyes, do you see?</LINE>
+<LINE>How can it be?</LINE>
+<LINE>O dainty duck! O dear!</LINE>
+<LINE>Thy mantle good,</LINE>
+<LINE>What, stain'd with blood!</LINE>
+<LINE>Approach, ye Furies fell!</LINE>
+<LINE>O Fates, come, come,</LINE>
+<LINE>Cut thread and thrum;</LINE>
+<LINE>Quail, crush, conclude, and quell!</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>This passion, and the death of a dear friend, would</LINE>
+<LINE>go near to make a man look sad.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>Beshrew my heart, but I pity the man.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Pyramus</SPEAKER>
+<LINE>O wherefore, Nature, didst thou lions frame?</LINE>
+<LINE>Since lion vile hath here deflower'd my dear:</LINE>
+<LINE>Which is--no, no--which was the fairest dame</LINE>
+<LINE>That lived, that loved, that liked, that look'd</LINE>
+<LINE>with cheer.</LINE>
+<LINE>Come, tears, confound;</LINE>
+<LINE>Out, sword, and wound</LINE>
+<LINE>The pap of Pyramus;</LINE>
+<LINE>Ay, that left pap,</LINE>
+<LINE>Where heart doth hop:</LINE>
+<STAGEDIR>Stabs himself</STAGEDIR>
+<LINE>Thus die I, thus, thus, thus.</LINE>
+<LINE>Now am I dead,</LINE>
+<LINE>Now am I fled;</LINE>
+<LINE>My soul is in the sky:</LINE>
+<LINE>Tongue, lose thy light;</LINE>
+<LINE>Moon take thy flight:</LINE>
+<STAGEDIR>Exit Moonshine</STAGEDIR>
+<LINE>Now die, die, die, die, die.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Dies</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>No die, but an ace, for him; for he is but one.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>Less than an ace, man; for he is dead; he is nothing.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>With the help of a surgeon he might yet recover, and</LINE>
+<LINE>prove an ass.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>How chance Moonshine is gone before Thisbe comes</LINE>
+<LINE>back and finds her lover?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>She will find him by starlight. Here she comes; and</LINE>
+<LINE>her passion ends the play.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Re-enter Thisbe</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>HIPPOLYTA</SPEAKER>
+<LINE>Methinks she should not use a long one for such a</LINE>
+<LINE>Pyramus: I hope she will be brief.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>A mote will turn the balance, which Pyramus, which</LINE>
+<LINE>Thisbe, is the better; he for a man, God warrant us;</LINE>
+<LINE>she for a woman, God bless us.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>LYSANDER</SPEAKER>
+<LINE>She hath spied him already with those sweet eyes.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>And thus she means, videlicet:--</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>Thisbe</SPEAKER>
+<LINE>Asleep, my love?</LINE>
+<LINE>What, dead, my dove?</LINE>
+<LINE>O Pyramus, arise!</LINE>
+<LINE>Speak, speak. Quite dumb?</LINE>
+<LINE>Dead, dead? A tomb</LINE>
+<LINE>Must cover thy sweet eyes.</LINE>
+<LINE>These My lips,</LINE>
+<LINE>This cherry nose,</LINE>
+<LINE>These yellow cowslip cheeks,</LINE>
+<LINE>Are gone, are gone:</LINE>
+<LINE>Lovers, make moan:</LINE>
+<LINE>His eyes were green as leeks.</LINE>
+<LINE>O Sisters Three,</LINE>
+<LINE>Come, come to me,</LINE>
+<LINE>With hands as pale as milk;</LINE>
+<LINE>Lay them in gore,</LINE>
+<LINE>Since you have shore</LINE>
+<LINE>With shears his thread of silk.</LINE>
+<LINE>Tongue, not a word:</LINE>
+<LINE>Come, trusty sword;</LINE>
+<LINE>Come, blade, my breast imbrue:</LINE>
+<STAGEDIR>Stabs herself</STAGEDIR>
+<LINE>And, farewell, friends;</LINE>
+<LINE>Thus Thisby ends:</LINE>
+<LINE>Adieu, adieu, adieu.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Dies</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>Moonshine and Lion are left to bury the dead.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>DEMETRIUS</SPEAKER>
+<LINE>Ay, and Wall too.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>BOTTOM</SPEAKER>
+<LINE><STAGEDIR>Starting up</STAGEDIR>  No assure you; the wall is down that</LINE>
+<LINE>parted their fathers. Will it please you to see the</LINE>
+<LINE>epilogue, or to hear a Bergomask dance between two</LINE>
+<LINE>of our company?</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>THESEUS</SPEAKER>
+<LINE>No epilogue, I pray you; for your play needs no</LINE>
+<LINE>excuse. Never excuse; for when the players are all</LINE>
+<LINE>dead, there needs none to be blamed. Marry, if he</LINE>
+<LINE>that writ it had played Pyramus and hanged himself</LINE>
+<LINE>in Thisbe's garter, it would have been a fine</LINE>
+<LINE>tragedy: and so it is, truly; and very notably</LINE>
+<LINE>discharged. But come, your Bergomask: let your</LINE>
+<LINE>epilogue alone.</LINE>
+<STAGEDIR>A dance</STAGEDIR>
+<LINE>The iron tongue of midnight hath told twelve:</LINE>
+<LINE>Lovers, to bed; 'tis almost fairy time.</LINE>
+<LINE>I fear we shall out-sleep the coming morn</LINE>
+<LINE>As much as we this night have overwatch'd.</LINE>
+<LINE>This palpable-gross play hath well beguiled</LINE>
+<LINE>The heavy gait of night. Sweet friends, to bed.</LINE>
+<LINE>A fortnight hold we this solemnity,</LINE>
+<LINE>In nightly revels and new jollity.</LINE>
+</SPEECH>
+
+<STAGEDIR>Exeunt</STAGEDIR>
+<STAGEDIR>Enter PUCK</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>Now the hungry lion roars,</LINE>
+<LINE>And the wolf behowls the moon;</LINE>
+<LINE>Whilst the heavy ploughman snores,</LINE>
+<LINE>All with weary task fordone.</LINE>
+<LINE>Now the wasted brands do glow,</LINE>
+<LINE>Whilst the screech-owl, screeching loud,</LINE>
+<LINE>Puts the wretch that lies in woe</LINE>
+<LINE>In remembrance of a shroud.</LINE>
+<LINE>Now it is the time of night</LINE>
+<LINE>That the graves all gaping wide,</LINE>
+<LINE>Every one lets forth his sprite,</LINE>
+<LINE>In the church-way paths to glide:</LINE>
+<LINE>And we fairies, that do run</LINE>
+<LINE>By the triple Hecate's team,</LINE>
+<LINE>From the presence of the sun,</LINE>
+<LINE>Following darkness like a dream,</LINE>
+<LINE>Now are frolic: not a mouse</LINE>
+<LINE>Shall disturb this hallow'd house:</LINE>
+<LINE>I am sent with broom before,</LINE>
+<LINE>To sweep the dust behind the door.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Enter OBERON and TITANIA with their train</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Through the house give gathering light,</LINE>
+<LINE>By the dead and drowsy fire:</LINE>
+<LINE>Every elf and fairy sprite</LINE>
+<LINE>Hop as light as bird from brier;</LINE>
+<LINE>And this ditty, after me,</LINE>
+<LINE>Sing, and dance it trippingly.</LINE>
+</SPEECH>
+
+<SPEECH>
+<SPEAKER>TITANIA</SPEAKER>
+<LINE>First, rehearse your song by rote</LINE>
+<LINE>To each word a warbling note:</LINE>
+<LINE>Hand in hand, with fairy grace,</LINE>
+<LINE>Will we sing, and bless this place.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Song and dance</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>OBERON</SPEAKER>
+<LINE>Now, until the break of day,</LINE>
+<LINE>Through this house each fairy stray.</LINE>
+<LINE>To the best bride-bed will we,</LINE>
+<LINE>Which by us shall blessed be;</LINE>
+<LINE>And the issue there create</LINE>
+<LINE>Ever shall be fortunate.</LINE>
+<LINE>So shall all the couples three</LINE>
+<LINE>Ever true in loving be;</LINE>
+<LINE>And the blots of Nature's hand</LINE>
+<LINE>Shall not in their issue stand;</LINE>
+<LINE>Never mole, hare lip, nor scar,</LINE>
+<LINE>Nor mark prodigious, such as are</LINE>
+<LINE>Despised in nativity,</LINE>
+<LINE>Shall upon their children be.</LINE>
+<LINE>With this field-dew consecrate,</LINE>
+<LINE>Every fairy take his gait;</LINE>
+<LINE>And each several chamber bless,</LINE>
+<LINE>Through this palace, with sweet peace;</LINE>
+<LINE>And the owner of it blest</LINE>
+<LINE>Ever shall in safety rest.</LINE>
+<LINE>Trip away; make no stay;</LINE>
+<LINE>Meet me all by break of day.</LINE>
+</SPEECH>
+
+
+<STAGEDIR>Exeunt OBERON, TITANIA, and train</STAGEDIR>
+
+<SPEECH>
+<SPEAKER>PUCK</SPEAKER>
+<LINE>If we shadows have offended,</LINE>
+<LINE>Think but this, and all is mended,</LINE>
+<LINE>That you have but slumber'd here</LINE>
+<LINE>While these visions did appear.</LINE>
+<LINE>And this weak and idle theme,</LINE>
+<LINE>No more yielding but a dream,</LINE>
+<LINE>Gentles, do not reprehend:</LINE>
+<LINE>if you pardon, we will mend:</LINE>
+<LINE>And, as I am an honest Puck,</LINE>
+<LINE>If we have unearned luck</LINE>
+<LINE>Now to 'scape the serpent's tongue,</LINE>
+<LINE>We will make amends ere long;</LINE>
+<LINE>Else the Puck a liar call;</LINE>
+<LINE>So, good night unto you all.</LINE>
+<LINE>Give me your hands, if we be friends,</LINE>
+<LINE>And Robin shall restore amends.</LINE>
+</SPEECH>
+</SCENE>
+</ACT>
+</PLAY>
diff --git a/resources/empty.xml b/resources/empty.xml
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/resources/utf8test.xml b/resources/utf8test.xml
new file mode 100755 (executable)
index 0000000..4fd71ce
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document>
+    <English name="name" value="value">The world has many languages</English>
+    <Russian name="название(имя)" value="ценность">Мир имеет много языков</Russian>
+    <Spanish name="el nombre" value="el valor">el mundo tiene muchos idiomas</Spanish>
+    <SimplifiedChinese name="名字" value="价值">世界有很多语言</SimplifiedChinese>
+    <Русский название="name" ценность="value">&lt;имеет&gt;</Русский>
+    <汉语 名字="name" 价值="value">世界有很多语言</汉语>
+    <Heavy>"M&#x0eB;t&#230;l!"</Heavy>
+    <ä>Umlaut Element</ä>
+</document>
diff --git a/resources/utf8testverify.xml b/resources/utf8testverify.xml
new file mode 100755 (executable)
index 0000000..7d9b3c0
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document>
+    <English name="name" value="value">The world has many languages</English>
+    <Russian name="название(имя)" value="ценность">Мир имеет много языков</Russian>
+    <Spanish name="el nombre" value="el valor">el mundo tiene muchos idiomas</Spanish>
+    <SimplifiedChinese name="名字" value="价值">世界有很多语言</SimplifiedChinese>
+    <Русский название="name" ценность="value">&lt;имеет&gt;</Русский>
+    <汉语 名字="name" 价值="value">世界有很多语言</汉语>
+    <Heavy>"Mëtæl!"</Heavy>
+    <ä>Umlaut Element</ä>
+</document>
diff --git a/setversion.py b/setversion.py
new file mode 100755 (executable)
index 0000000..85523d7
--- /dev/null
@@ -0,0 +1,123 @@
+# Python program to set the version.\r
+##############################################\r
+\r
+import re\r
+import sys\r
+import optparse\r
+\r
+def fileProcess( name, lineFunction ):\r
+       filestream = open( name, 'r' )\r
+       if filestream.closed:\r
+               print( "file " + name + " not open." )\r
+               return\r
+\r
+       output = ""\r
+       print( "--- Processing " + name + " ---------" )\r
+       while 1:\r
+               line = filestream.readline()\r
+               if not line: break\r
+               output += lineFunction( line )\r
+       filestream.close()\r
+       \r
+       if not output: return                   # basic error checking\r
+       \r
+       print( "Writing file " + name )\r
+       filestream = open( name, "w" );\r
+       filestream.write( output );\r
+       filestream.close()\r
+       \r
+def echoInput( line ):\r
+       return line\r
+\r
+parser = optparse.OptionParser( "usage: %prog major minor build" )\r
+(options, args) = parser.parse_args()\r
+if len(args) != 3:\r
+       parser.error( "incorrect number of arguments" );\r
+\r
+major = args[0]\r
+minor = args[1]\r
+build = args[2]\r
+versionStr = major + "." + minor + "." + build\r
+\r
+print ("Setting dox,tinyxml2.h")\r
+print ("Version: " + major + "." + minor + "." + build)\r
+\r
+#### Write the tinyxml.h ####\r
+\r
+def engineRule( line ):\r
+\r
+       matchMajor = "static const int TIXML2_MAJOR_VERSION"\r
+       matchMinor = "static const int TIXML2_MINOR_VERSION"\r
+       matchBuild = "static const int TIXML2_PATCH_VERSION"\r
+\r
+       if line[0:len(matchMajor)] == matchMajor:\r
+               print( "1)tinyxml2.h Major found" )\r
+               return matchMajor + " = " + major + ";\n"\r
+\r
+       elif line[0:len(matchMinor)] == matchMinor:\r
+               print( "2)tinyxml2.h Minor found" )\r
+               return matchMinor + " = " + minor + ";\n"\r
+\r
+       elif line[0:len(matchBuild)] == matchBuild:\r
+               print( "3)tinyxml2.h Build found" )\r
+               return matchBuild + " = " + build + ";\n"\r
+\r
+       else:\r
+               return line;\r
+\r
+fileProcess( "tinyxml2.h", engineRule )\r
+\r
+\r
+#### Write the dox ####\r
+\r
+def doxRule( line ):\r
+\r
+       match = "PROJECT_NUMBER"\r
+\r
+       if line[0:len( match )] == match:\r
+               print( "dox project found" )\r
+               return "PROJECT_NUMBER = " + major + "." + minor + "." + build + "\n"\r
+\r
+       else:\r
+               return line;\r
+\r
+fileProcess( "dox", doxRule )\r
+\r
+\r
+#### Write the CMakeLists.txt ####\r
+\r
+def cmakeRule1( line ):\r
+\r
+       matchVersion = "set(GENERIC_LIB_VERSION"\r
+\r
+       if line[0:len(matchVersion)] == matchVersion:\r
+               print( "1)tinyxml2.h Major found" )\r
+               return matchVersion + " \"" + major + "." + minor + "." + build + "\")" + "\n"\r
+\r
+       else:\r
+               return line;\r
+\r
+fileProcess( "CMakeLists.txt", cmakeRule1 )\r
+\r
+def cmakeRule2( line ):\r
+\r
+       matchSoversion = "set(GENERIC_LIB_SOVERSION"\r
+\r
+       if line[0:len(matchSoversion)] == matchSoversion:\r
+               print( "1)tinyxml2.h Major found" )\r
+               return matchSoversion + " \"" + major + "\")" + "\n"\r
+\r
+       else:\r
+               return line;\r
+\r
+fileProcess( "CMakeLists.txt", cmakeRule2 )\r
+\r
+print( "Release note:" )\r
+print( '1. Build.   g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe' )\r
+print( '2. Commit.  git commit -am"setting the version to ' + versionStr + '"' )\r
+print( '3. Tag.     git tag ' + versionStr )\r
+print( '   OR       git tag -a ' + versionStr + ' -m [tag message]' )\r
+print( 'Remember to "git push" both code and tag. For the tag:' )\r
+print( 'git push origin [tagname]')\r
+\r
\ No newline at end of file
diff --git a/tinyxml2.cpp b/tinyxml2.cpp
new file mode 100755 (executable)
index 0000000..6d8573b
--- /dev/null
@@ -0,0 +1,2344 @@
+/*\r
+Original code by Lee Thomason (www.grinninglizard.com)\r
+\r
+This software is provided 'as-is', without any express or implied\r
+warranty. In no event will the authors be held liable for any\r
+damages arising from the use of this software.\r
+\r
+Permission is granted to anyone to use this software for any\r
+purpose, including commercial applications, and to alter it and\r
+redistribute it freely, subject to the following restrictions:\r
+\r
+1. The origin of this software must not be misrepresented; you must\r
+not claim that you wrote the original software. If you use this\r
+software in a product, an acknowledgment in the product documentation\r
+would be appreciated but is not required.\r
+\r
+2. Altered source versions must be plainly marked as such, and\r
+must not be misrepresented as being the original software.\r
+\r
+3. This notice may not be removed or altered from any source\r
+distribution.\r
+*/\r
+\r
+#include "tinyxml2.h"\r
+\r
+#include <new>         // yes, this one new style header, is in the Android SDK.\r
+#if defined(ANDROID_NDK) || defined(__QNXNTO__)\r
+#   include <stddef.h>\r
+#else\r
+#   include <cstddef>\r
+#endif\r
+\r
+static const char LINE_FEED                            = (char)0x0a;                   // all line endings are normalized to LF\r
+static const char LF = LINE_FEED;\r
+static const char CARRIAGE_RETURN              = (char)0x0d;                   // CR gets filtered out\r
+static const char CR = CARRIAGE_RETURN;\r
+static const char SINGLE_QUOTE                 = '\'';\r
+static const char DOUBLE_QUOTE                 = '\"';\r
+\r
+// Bunch of unicode info at:\r
+//             http://www.unicode.org/faq/utf_bom.html\r
+//     ef bb bf (Microsoft "lead bytes") - designates UTF-8\r
+\r
+static const unsigned char TIXML_UTF_LEAD_0 = 0xefU;\r
+static const unsigned char TIXML_UTF_LEAD_1 = 0xbbU;\r
+static const unsigned char TIXML_UTF_LEAD_2 = 0xbfU;\r
+\r
+namespace tinyxml2\r
+{\r
+\r
+struct Entity {\r
+    const char* pattern;\r
+    int length;\r
+    char value;\r
+};\r
+\r
+static const int NUM_ENTITIES = 5;\r
+static const Entity entities[NUM_ENTITIES] = {\r
+    { "quot", 4,       DOUBLE_QUOTE },\r
+    { "amp", 3,                '&'  },\r
+    { "apos", 4,       SINGLE_QUOTE },\r
+    { "lt",    2,              '<'      },\r
+    { "gt",    2,              '>'      }\r
+};\r
+\r
+\r
+StrPair::~StrPair()\r
+{\r
+    Reset();\r
+}\r
+\r
+\r
+void StrPair::TransferTo( StrPair* other )\r
+{\r
+    if ( this == other ) {\r
+        return;\r
+    }\r
+    // This in effect implements the assignment operator by "moving"\r
+    // ownership (as in auto_ptr).\r
+\r
+    TIXMLASSERT( other->_flags == 0 );\r
+    TIXMLASSERT( other->_start == 0 );\r
+    TIXMLASSERT( other->_end == 0 );\r
+\r
+    other->Reset();\r
+\r
+    other->_flags = _flags;\r
+    other->_start = _start;\r
+    other->_end = _end;\r
+\r
+    _flags = 0;\r
+    _start = 0;\r
+    _end = 0;\r
+}\r
+\r
+void StrPair::Reset()\r
+{\r
+    if ( _flags & NEEDS_DELETE ) {\r
+        delete [] _start;\r
+    }\r
+    _flags = 0;\r
+    _start = 0;\r
+    _end = 0;\r
+}\r
+\r
+\r
+void StrPair::SetStr( const char* str, int flags )\r
+{\r
+    Reset();\r
+    size_t len = strlen( str );\r
+    _start = new char[ len+1 ];\r
+    memcpy( _start, str, len+1 );\r
+    _end = _start + len;\r
+    _flags = flags | NEEDS_DELETE;\r
+}\r
+\r
+\r
+char* StrPair::ParseText( char* p, const char* endTag, int strFlags )\r
+{\r
+    TIXMLASSERT( endTag && *endTag );\r
+\r
+    char* start = p;\r
+    char  endChar = *endTag;\r
+    size_t length = strlen( endTag );\r
+\r
+    // Inner loop of text parsing.\r
+    while ( *p ) {\r
+        if ( *p == endChar && strncmp( p, endTag, length ) == 0 ) {\r
+            Set( start, p, strFlags );\r
+            return p + length;\r
+        }\r
+        ++p;\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+char* StrPair::ParseName( char* p )\r
+{\r
+    if ( !p || !(*p) ) {\r
+        return 0;\r
+    }\r
+    if ( !XMLUtil::IsNameStartChar( *p ) ) {\r
+        return 0;\r
+    }\r
+\r
+    char* const start = p;\r
+    ++p;\r
+    while ( *p && XMLUtil::IsNameChar( *p ) ) {\r
+        ++p;\r
+    }\r
+\r
+    Set( start, p, 0 );\r
+    return p;\r
+}\r
+\r
+\r
+void StrPair::CollapseWhitespace()\r
+{\r
+    // Adjusting _start would cause undefined behavior on delete[]\r
+    TIXMLASSERT( ( _flags & NEEDS_DELETE ) == 0 );\r
+    // Trim leading space.\r
+    _start = XMLUtil::SkipWhiteSpace( _start );\r
+\r
+    if ( *_start ) {\r
+        char* p = _start;      // the read pointer\r
+        char* q = _start;      // the write pointer\r
+\r
+        while( *p ) {\r
+            if ( XMLUtil::IsWhiteSpace( *p )) {\r
+                p = XMLUtil::SkipWhiteSpace( p );\r
+                if ( *p == 0 ) {\r
+                    break;    // don't write to q; this trims the trailing space.\r
+                }\r
+                *q = ' ';\r
+                ++q;\r
+            }\r
+            *q = *p;\r
+            ++q;\r
+            ++p;\r
+        }\r
+        *q = 0;\r
+    }\r
+}\r
+\r
+\r
+const char* StrPair::GetStr()\r
+{\r
+    TIXMLASSERT( _start );\r
+    TIXMLASSERT( _end );\r
+    if ( _flags & NEEDS_FLUSH ) {\r
+        *_end = 0;\r
+        _flags ^= NEEDS_FLUSH;\r
+\r
+        if ( _flags ) {\r
+            char* p = _start;  // the read pointer\r
+            char* q = _start;  // the write pointer\r
+\r
+            while( p < _end ) {\r
+                if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == CR ) {\r
+                    // CR-LF pair becomes LF\r
+                    // CR alone becomes LF\r
+                    // LF-CR becomes LF\r
+                    if ( *(p+1) == LF ) {\r
+                        p += 2;\r
+                    }\r
+                    else {\r
+                        ++p;\r
+                    }\r
+                    *q++ = LF;\r
+                }\r
+                else if ( (_flags & NEEDS_NEWLINE_NORMALIZATION) && *p == LF ) {\r
+                    if ( *(p+1) == CR ) {\r
+                        p += 2;\r
+                    }\r
+                    else {\r
+                        ++p;\r
+                    }\r
+                    *q++ = LF;\r
+                }\r
+                else if ( (_flags & NEEDS_ENTITY_PROCESSING) && *p == '&' ) {\r
+                    // Entities handled by tinyXML2:\r
+                    // - special entities in the entity table [in/out]\r
+                    // - numeric character reference [in]\r
+                    //   &#20013; or &#x4e2d;\r
+\r
+                    if ( *(p+1) == '#' ) {\r
+                        const int buflen = 10;\r
+                        char buf[buflen] = { 0 };\r
+                        int len = 0;\r
+                        char* adjusted = const_cast<char*>( XMLUtil::GetCharacterRef( p, buf, &len ) );\r
+                        if ( adjusted == 0 ) {\r
+                            *q = *p;\r
+                            ++p;\r
+                            ++q;\r
+                        }\r
+                        else {\r
+                            TIXMLASSERT( 0 <= len && len <= buflen );\r
+                            TIXMLASSERT( q + len <= adjusted );\r
+                            p = adjusted;\r
+                            memcpy( q, buf, len );\r
+                            q += len;\r
+                        }\r
+                    }\r
+                    else {\r
+                        int i=0;\r
+                        for(; i<NUM_ENTITIES; ++i ) {\r
+                            const Entity& entity = entities[i];\r
+                            if ( strncmp( p + 1, entity.pattern, entity.length ) == 0\r
+                                    && *( p + entity.length + 1 ) == ';' ) {\r
+                                // Found an entity - convert.\r
+                                *q = entity.value;\r
+                                ++q;\r
+                                p += entity.length + 2;\r
+                                break;\r
+                            }\r
+                        }\r
+                        if ( i == NUM_ENTITIES ) {\r
+                            // fixme: treat as error?\r
+                            ++p;\r
+                            ++q;\r
+                        }\r
+                    }\r
+                }\r
+                else {\r
+                    *q = *p;\r
+                    ++p;\r
+                    ++q;\r
+                }\r
+            }\r
+            *q = 0;\r
+        }\r
+        // The loop below has plenty going on, and this\r
+        // is a less useful mode. Break it out.\r
+        if ( _flags & COLLAPSE_WHITESPACE ) {\r
+            CollapseWhitespace();\r
+        }\r
+        _flags = (_flags & NEEDS_DELETE);\r
+    }\r
+    TIXMLASSERT( _start );\r
+    return _start;\r
+}\r
+\r
+\r
+\r
+\r
+// --------- XMLUtil ----------- //\r
+\r
+const char* XMLUtil::ReadBOM( const char* p, bool* bom )\r
+{\r
+    TIXMLASSERT( p );\r
+    TIXMLASSERT( bom );\r
+    *bom = false;\r
+    const unsigned char* pu = reinterpret_cast<const unsigned char*>(p);\r
+    // Check for BOM:\r
+    if (    *(pu+0) == TIXML_UTF_LEAD_0\r
+            && *(pu+1) == TIXML_UTF_LEAD_1\r
+            && *(pu+2) == TIXML_UTF_LEAD_2 ) {\r
+        *bom = true;\r
+        p += 3;\r
+    }\r
+    TIXMLASSERT( p );\r
+    return p;\r
+}\r
+\r
+\r
+void XMLUtil::ConvertUTF32ToUTF8( unsigned long input, char* output, int* length )\r
+{\r
+    const unsigned long BYTE_MASK = 0xBF;\r
+    const unsigned long BYTE_MARK = 0x80;\r
+    const unsigned long FIRST_BYTE_MARK[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };\r
+\r
+    if (input < 0x80) {\r
+        *length = 1;\r
+    }\r
+    else if ( input < 0x800 ) {\r
+        *length = 2;\r
+    }\r
+    else if ( input < 0x10000 ) {\r
+        *length = 3;\r
+    }\r
+    else if ( input < 0x200000 ) {\r
+        *length = 4;\r
+    }\r
+    else {\r
+        *length = 0;    // This code won't covert this correctly anyway.\r
+        return;\r
+    }\r
+\r
+    output += *length;\r
+\r
+    // Scary scary fall throughs.\r
+    switch (*length) {\r
+        case 4:\r
+            --output;\r
+            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\r
+            input >>= 6;\r
+        case 3:\r
+            --output;\r
+            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\r
+            input >>= 6;\r
+        case 2:\r
+            --output;\r
+            *output = (char)((input | BYTE_MARK) & BYTE_MASK);\r
+            input >>= 6;\r
+        case 1:\r
+            --output;\r
+            *output = (char)(input | FIRST_BYTE_MARK[*length]);\r
+            break;\r
+        default:\r
+            TIXMLASSERT( false );\r
+    }\r
+}\r
+\r
+\r
+const char* XMLUtil::GetCharacterRef( const char* p, char* value, int* length )\r
+{\r
+    // Presume an entity, and pull it out.\r
+    *length = 0;\r
+\r
+    if ( *(p+1) == '#' && *(p+2) ) {\r
+        unsigned long ucs = 0;\r
+        TIXMLASSERT( sizeof( ucs ) >= 4 );\r
+        ptrdiff_t delta = 0;\r
+        unsigned mult = 1;\r
+        static const char SEMICOLON = ';';\r
+\r
+        if ( *(p+2) == 'x' ) {\r
+            // Hexadecimal.\r
+            const char* q = p+3;\r
+            if ( !(*q) ) {\r
+                return 0;\r
+            }\r
+\r
+            q = strchr( q, SEMICOLON );\r
+\r
+            if ( !q ) {\r
+                return 0;\r
+            }\r
+            TIXMLASSERT( *q == SEMICOLON );\r
+\r
+            delta = q-p;\r
+            --q;\r
+\r
+            while ( *q != 'x' ) {\r
+                unsigned int digit = 0;\r
+\r
+                if ( *q >= '0' && *q <= '9' ) {\r
+                    digit = *q - '0';\r
+                }\r
+                else if ( *q >= 'a' && *q <= 'f' ) {\r
+                    digit = *q - 'a' + 10;\r
+                }\r
+                else if ( *q >= 'A' && *q <= 'F' ) {\r
+                    digit = *q - 'A' + 10;\r
+                }\r
+                else {\r
+                    return 0;\r
+                }\r
+                TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );\r
+                               TIXMLASSERT( digit >= 0 && digit < 16);\r
+                const unsigned int digitScaled = mult * digit;\r
+                TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );\r
+                ucs += digitScaled;\r
+                TIXMLASSERT( mult <= UINT_MAX / 16 );\r
+                mult *= 16;\r
+                --q;\r
+            }\r
+        }\r
+        else {\r
+            // Decimal.\r
+            const char* q = p+2;\r
+            if ( !(*q) ) {\r
+                return 0;\r
+            }\r
+\r
+            q = strchr( q, SEMICOLON );\r
+\r
+            if ( !q ) {\r
+                return 0;\r
+            }\r
+            TIXMLASSERT( *q == SEMICOLON );\r
+\r
+            delta = q-p;\r
+            --q;\r
+\r
+            while ( *q != '#' ) {\r
+                if ( *q >= '0' && *q <= '9' ) {\r
+                    const unsigned int digit = *q - '0';\r
+                    TIXMLASSERT( digit == 0 || mult <= UINT_MAX / digit );\r
+                    const unsigned int digitScaled = mult * digit;\r
+                    TIXMLASSERT( ucs <= ULONG_MAX - digitScaled );\r
+                    ucs += digitScaled;\r
+                }\r
+                else {\r
+                    return 0;\r
+                }\r
+                TIXMLASSERT( mult <= UINT_MAX / 10 );\r
+                mult *= 10;\r
+                --q;\r
+            }\r
+        }\r
+        // convert the UCS to UTF-8\r
+        ConvertUTF32ToUTF8( ucs, value, length );\r
+        return p + delta + 1;\r
+    }\r
+    return p+1;\r
+}\r
+\r
+\r
+void XMLUtil::ToStr( int v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%d", v );\r
+}\r
+\r
+\r
+void XMLUtil::ToStr( unsigned v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%u", v );\r
+}\r
+\r
+\r
+void XMLUtil::ToStr( bool v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%d", v ? 1 : 0 );\r
+}\r
+\r
+/*\r
+       ToStr() of a number is a very tricky topic.\r
+       https://github.com/leethomason/tinyxml2/issues/106\r
+*/\r
+void XMLUtil::ToStr( float v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%.8g", v );\r
+}\r
+\r
+\r
+void XMLUtil::ToStr( double v, char* buffer, int bufferSize )\r
+{\r
+    TIXML_SNPRINTF( buffer, bufferSize, "%.17g", v );\r
+}\r
+\r
+\r
+bool XMLUtil::ToInt( const char* str, int* value )\r
+{\r
+    if ( TIXML_SSCANF( str, "%d", value ) == 1 ) {\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+bool XMLUtil::ToUnsigned( const char* str, unsigned *value )\r
+{\r
+    if ( TIXML_SSCANF( str, "%u", value ) == 1 ) {\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+bool XMLUtil::ToBool( const char* str, bool* value )\r
+{\r
+    int ival = 0;\r
+    if ( ToInt( str, &ival )) {\r
+        *value = (ival==0) ? false : true;\r
+        return true;\r
+    }\r
+    if ( StringEqual( str, "true" ) ) {\r
+        *value = true;\r
+        return true;\r
+    }\r
+    else if ( StringEqual( str, "false" ) ) {\r
+        *value = false;\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+\r
+bool XMLUtil::ToFloat( const char* str, float* value )\r
+{\r
+    if ( TIXML_SSCANF( str, "%f", value ) == 1 ) {\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+bool XMLUtil::ToDouble( const char* str, double* value )\r
+{\r
+    if ( TIXML_SSCANF( str, "%lf", value ) == 1 ) {\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+\r
+char* XMLDocument::Identify( char* p, XMLNode** node )\r
+{\r
+    TIXMLASSERT( node );\r
+    TIXMLASSERT( p );\r
+    char* const start = p;\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+    if( !*p ) {\r
+        *node = 0;\r
+        TIXMLASSERT( p );\r
+        return p;\r
+    }\r
+\r
+    // What is this thing?\r
+       // These strings define the matching patters:\r
+    static const char* xmlHeader               = { "<?" };\r
+    static const char* commentHeader   = { "<!--" };\r
+    static const char* dtdHeader               = { "<!" };\r
+    static const char* cdataHeader             = { "<![CDATA[" };\r
+    static const char* elementHeader   = { "<" };      // and a header for everything else; check last.\r
+\r
+    static const int xmlHeaderLen              = 2;\r
+    static const int commentHeaderLen  = 4;\r
+    static const int dtdHeaderLen              = 2;\r
+    static const int cdataHeaderLen            = 9;\r
+    static const int elementHeaderLen  = 1;\r
+\r
+    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLUnknown ) );               // use same memory pool\r
+    TIXMLASSERT( sizeof( XMLComment ) == sizeof( XMLDeclaration ) );   // use same memory pool\r
+    XMLNode* returnNode = 0;\r
+    if ( XMLUtil::StringEqual( p, xmlHeader, xmlHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLDeclaration ) == _commentPool.ItemSize() );\r
+        returnNode = new (_commentPool.Alloc()) XMLDeclaration( this );\r
+        returnNode->_memPool = &_commentPool;\r
+        p += xmlHeaderLen;\r
+    }\r
+    else if ( XMLUtil::StringEqual( p, commentHeader, commentHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLComment ) == _commentPool.ItemSize() );\r
+        returnNode = new (_commentPool.Alloc()) XMLComment( this );\r
+        returnNode->_memPool = &_commentPool;\r
+        p += commentHeaderLen;\r
+    }\r
+    else if ( XMLUtil::StringEqual( p, cdataHeader, cdataHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
+        XMLText* text = new (_textPool.Alloc()) XMLText( this );\r
+        returnNode = text;\r
+        returnNode->_memPool = &_textPool;\r
+        p += cdataHeaderLen;\r
+        text->SetCData( true );\r
+    }\r
+    else if ( XMLUtil::StringEqual( p, dtdHeader, dtdHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLUnknown ) == _commentPool.ItemSize() );\r
+        returnNode = new (_commentPool.Alloc()) XMLUnknown( this );\r
+        returnNode->_memPool = &_commentPool;\r
+        p += dtdHeaderLen;\r
+    }\r
+    else if ( XMLUtil::StringEqual( p, elementHeader, elementHeaderLen ) ) {\r
+        TIXMLASSERT( sizeof( XMLElement ) == _elementPool.ItemSize() );\r
+        returnNode = new (_elementPool.Alloc()) XMLElement( this );\r
+        returnNode->_memPool = &_elementPool;\r
+        p += elementHeaderLen;\r
+    }\r
+    else {\r
+        TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
+        returnNode = new (_textPool.Alloc()) XMLText( this );\r
+        returnNode->_memPool = &_textPool;\r
+        p = start;     // Back it up, all the text counts.\r
+    }\r
+\r
+    TIXMLASSERT( returnNode );\r
+    TIXMLASSERT( p );\r
+    *node = returnNode;\r
+    return p;\r
+}\r
+\r
+\r
+bool XMLDocument::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    if ( visitor->VisitEnter( *this ) ) {\r
+        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\r
+            if ( !node->Accept( visitor ) ) {\r
+                break;\r
+            }\r
+        }\r
+    }\r
+    return visitor->VisitExit( *this );\r
+}\r
+\r
+\r
+// --------- XMLNode ----------- //\r
+\r
+XMLNode::XMLNode( XMLDocument* doc ) :\r
+    _document( doc ),\r
+    _parent( 0 ),\r
+    _firstChild( 0 ), _lastChild( 0 ),\r
+    _prev( 0 ), _next( 0 ),\r
+    _memPool( 0 )\r
+{\r
+}\r
+\r
+\r
+XMLNode::~XMLNode()\r
+{\r
+    DeleteChildren();\r
+    if ( _parent ) {\r
+        _parent->Unlink( this );\r
+    }\r
+}\r
+\r
+const char* XMLNode::Value() const \r
+{\r
+    return _value.GetStr();\r
+}\r
+\r
+void XMLNode::SetValue( const char* str, bool staticMem )\r
+{\r
+    if ( staticMem ) {\r
+        _value.SetInternedStr( str );\r
+    }\r
+    else {\r
+        _value.SetStr( str );\r
+    }\r
+}\r
+\r
+\r
+void XMLNode::DeleteChildren()\r
+{\r
+    while( _firstChild ) {\r
+        TIXMLASSERT( _firstChild->_document == _document );\r
+        XMLNode* node = _firstChild;\r
+        Unlink( node );\r
+\r
+        DeleteNode( node );\r
+    }\r
+    _firstChild = _lastChild = 0;\r
+}\r
+\r
+\r
+void XMLNode::Unlink( XMLNode* child )\r
+{\r
+    TIXMLASSERT( child );\r
+    TIXMLASSERT( child->_document == _document );\r
+    if ( child == _firstChild ) {\r
+        _firstChild = _firstChild->_next;\r
+    }\r
+    if ( child == _lastChild ) {\r
+        _lastChild = _lastChild->_prev;\r
+    }\r
+\r
+    if ( child->_prev ) {\r
+        child->_prev->_next = child->_next;\r
+    }\r
+    if ( child->_next ) {\r
+        child->_next->_prev = child->_prev;\r
+    }\r
+       child->_parent = 0;\r
+}\r
+\r
+\r
+void XMLNode::DeleteChild( XMLNode* node )\r
+{\r
+    TIXMLASSERT( node );\r
+    TIXMLASSERT( node->_document == _document );\r
+    TIXMLASSERT( node->_parent == this );\r
+    DeleteNode( node );\r
+}\r
+\r
+\r
+XMLNode* XMLNode::InsertEndChild( XMLNode* addThis )\r
+{\r
+    TIXMLASSERT( addThis );\r
+    if ( addThis->_document != _document ) {\r
+        TIXMLASSERT( false );\r
+        return 0;\r
+    }\r
+    InsertChildPreamble( addThis );\r
+\r
+    if ( _lastChild ) {\r
+        TIXMLASSERT( _firstChild );\r
+        TIXMLASSERT( _lastChild->_next == 0 );\r
+        _lastChild->_next = addThis;\r
+        addThis->_prev = _lastChild;\r
+        _lastChild = addThis;\r
+\r
+        addThis->_next = 0;\r
+    }\r
+    else {\r
+        TIXMLASSERT( _firstChild == 0 );\r
+        _firstChild = _lastChild = addThis;\r
+\r
+        addThis->_prev = 0;\r
+        addThis->_next = 0;\r
+    }\r
+    addThis->_parent = this;\r
+    return addThis;\r
+}\r
+\r
+\r
+XMLNode* XMLNode::InsertFirstChild( XMLNode* addThis )\r
+{\r
+    TIXMLASSERT( addThis );\r
+    if ( addThis->_document != _document ) {\r
+        TIXMLASSERT( false );\r
+        return 0;\r
+    }\r
+    InsertChildPreamble( addThis );\r
+\r
+    if ( _firstChild ) {\r
+        TIXMLASSERT( _lastChild );\r
+        TIXMLASSERT( _firstChild->_prev == 0 );\r
+\r
+        _firstChild->_prev = addThis;\r
+        addThis->_next = _firstChild;\r
+        _firstChild = addThis;\r
+\r
+        addThis->_prev = 0;\r
+    }\r
+    else {\r
+        TIXMLASSERT( _lastChild == 0 );\r
+        _firstChild = _lastChild = addThis;\r
+\r
+        addThis->_prev = 0;\r
+        addThis->_next = 0;\r
+    }\r
+    addThis->_parent = this;\r
+    return addThis;\r
+}\r
+\r
+\r
+XMLNode* XMLNode::InsertAfterChild( XMLNode* afterThis, XMLNode* addThis )\r
+{\r
+    TIXMLASSERT( addThis );\r
+    if ( addThis->_document != _document ) {\r
+        TIXMLASSERT( false );\r
+        return 0;\r
+    }\r
+\r
+    TIXMLASSERT( afterThis );\r
+\r
+    if ( afterThis->_parent != this ) {\r
+        TIXMLASSERT( false );\r
+        return 0;\r
+    }\r
+\r
+    if ( afterThis->_next == 0 ) {\r
+        // The last node or the only node.\r
+        return InsertEndChild( addThis );\r
+    }\r
+    InsertChildPreamble( addThis );\r
+    addThis->_prev = afterThis;\r
+    addThis->_next = afterThis->_next;\r
+    afterThis->_next->_prev = addThis;\r
+    afterThis->_next = addThis;\r
+    addThis->_parent = this;\r
+    return addThis;\r
+}\r
+\r
+\r
+\r
+\r
+const XMLElement* XMLNode::FirstChildElement( const char* value ) const\r
+{\r
+    for( XMLNode* node=_firstChild; node; node=node->_next ) {\r
+        XMLElement* element = node->ToElement();\r
+        if ( element ) {\r
+            if ( !value || XMLUtil::StringEqual( element->Name(), value ) ) {\r
+                return element;\r
+            }\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const XMLElement* XMLNode::LastChildElement( const char* value ) const\r
+{\r
+    for( XMLNode* node=_lastChild; node; node=node->_prev ) {\r
+        XMLElement* element = node->ToElement();\r
+        if ( element ) {\r
+            if ( !value || XMLUtil::StringEqual( element->Name(), value ) ) {\r
+                return element;\r
+            }\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const XMLElement* XMLNode::NextSiblingElement( const char* value ) const\r
+{\r
+    for( XMLNode* node=this->_next; node; node = node->_next ) {\r
+        const XMLElement* element = node->ToElement();\r
+        if ( element\r
+                && (!value || XMLUtil::StringEqual( value, node->Value() ))) {\r
+            return element;\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const XMLElement* XMLNode::PreviousSiblingElement( const char* value ) const\r
+{\r
+    for( XMLNode* node=_prev; node; node = node->_prev ) {\r
+        const XMLElement* element = node->ToElement();\r
+        if ( element\r
+                && (!value || XMLUtil::StringEqual( value, node->Value() ))) {\r
+            return element;\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )\r
+{\r
+    // This is a recursive method, but thinking about it "at the current level"\r
+    // it is a pretty simple flat list:\r
+    //         <foo/>\r
+    //         <!-- comment -->\r
+    //\r
+    // With a special case:\r
+    //         <foo>\r
+    //         </foo>\r
+    //         <!-- comment -->\r
+    //\r
+    // Where the closing element (/foo) *must* be the next thing after the opening\r
+    // element, and the names must match. BUT the tricky bit is that the closing\r
+    // element will be read by the child.\r
+    //\r
+    // 'endTag' is the end tag for this node, it is returned by a call to a child.\r
+    // 'parentEnd' is the end tag for the parent, which is filled in and returned.\r
+\r
+    while( p && *p ) {\r
+        XMLNode* node = 0;\r
+\r
+        p = _document->Identify( p, &node );\r
+        if ( node == 0 ) {\r
+            break;\r
+        }\r
+\r
+        StrPair endTag;\r
+        p = node->ParseDeep( p, &endTag );\r
+        if ( !p ) {\r
+            DeleteNode( node );\r
+            if ( !_document->Error() ) {\r
+                _document->SetError( XML_ERROR_PARSING, 0, 0 );\r
+            }\r
+            break;\r
+        }\r
+\r
+        XMLElement* ele = node->ToElement();\r
+        if ( ele ) {\r
+            // We read the end tag. Return it to the parent.\r
+            if ( ele->ClosingType() == XMLElement::CLOSING ) {\r
+                if ( parentEnd ) {\r
+                    ele->_value.TransferTo( parentEnd );\r
+                }\r
+                node->_memPool->SetTracked();   // created and then immediately deleted.\r
+                DeleteNode( node );\r
+                return p;\r
+            }\r
+\r
+            // Handle an end tag returned to this level.\r
+            // And handle a bunch of annoying errors.\r
+            bool mismatch = false;\r
+            if ( endTag.Empty() ) {\r
+                if ( ele->ClosingType() == XMLElement::OPEN ) {\r
+                    mismatch = true;\r
+                }\r
+            }\r
+            else {\r
+                if ( ele->ClosingType() != XMLElement::OPEN ) {\r
+                    mismatch = true;\r
+                }\r
+                else if ( !XMLUtil::StringEqual( endTag.GetStr(), node->Value() ) ) {\r
+                    mismatch = true;\r
+                }\r
+            }\r
+            if ( mismatch ) {\r
+                _document->SetError( XML_ERROR_MISMATCHED_ELEMENT, node->Value(), 0 );\r
+                DeleteNode( node );\r
+                break;\r
+            }\r
+        }\r
+        InsertEndChild( node );\r
+    }\r
+    return 0;\r
+}\r
+\r
+void XMLNode::DeleteNode( XMLNode* node )\r
+{\r
+    if ( node == 0 ) {\r
+        return;\r
+    }\r
+    MemPool* pool = node->_memPool;\r
+    node->~XMLNode();\r
+    pool->Free( node );\r
+}\r
+\r
+void XMLNode::InsertChildPreamble( XMLNode* insertThis ) const\r
+{\r
+    TIXMLASSERT( insertThis );\r
+    TIXMLASSERT( insertThis->_document == _document );\r
+\r
+    if ( insertThis->_parent )\r
+        insertThis->_parent->Unlink( insertThis );\r
+    else\r
+        insertThis->_memPool->SetTracked();\r
+}\r
+\r
+// --------- XMLText ---------- //\r
+char* XMLText::ParseDeep( char* p, StrPair* )\r
+{\r
+    const char* start = p;\r
+    if ( this->CData() ) {\r
+        p = _value.ParseText( p, "]]>", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
+        if ( !p ) {\r
+            _document->SetError( XML_ERROR_PARSING_CDATA, start, 0 );\r
+        }\r
+        return p;\r
+    }\r
+    else {\r
+        int flags = _document->ProcessEntities() ? StrPair::TEXT_ELEMENT : StrPair::TEXT_ELEMENT_LEAVE_ENTITIES;\r
+        if ( _document->WhitespaceMode() == COLLAPSE_WHITESPACE ) {\r
+            flags |= StrPair::COLLAPSE_WHITESPACE;\r
+        }\r
+\r
+        p = _value.ParseText( p, "<", flags );\r
+        if ( p && *p ) {\r
+            return p-1;\r
+        }\r
+        if ( !p ) {\r
+            _document->SetError( XML_ERROR_PARSING_TEXT, start, 0 );\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+XMLNode* XMLText::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLText* text = doc->NewText( Value() );   // fixme: this will always allocate memory. Intern?\r
+    text->SetCData( this->CData() );\r
+    return text;\r
+}\r
+\r
+\r
+bool XMLText::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    const XMLText* text = compare->ToText();\r
+    return ( text && XMLUtil::StringEqual( text->Value(), Value() ) );\r
+}\r
+\r
+\r
+bool XMLText::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    return visitor->Visit( *this );\r
+}\r
+\r
+\r
+// --------- XMLComment ---------- //\r
+\r
+XMLComment::XMLComment( XMLDocument* doc ) : XMLNode( doc )\r
+{\r
+}\r
+\r
+\r
+XMLComment::~XMLComment()\r
+{\r
+}\r
+\r
+\r
+char* XMLComment::ParseDeep( char* p, StrPair* )\r
+{\r
+    // Comment parses as text.\r
+    const char* start = p;\r
+    p = _value.ParseText( p, "-->", StrPair::COMMENT );\r
+    if ( p == 0 ) {\r
+        _document->SetError( XML_ERROR_PARSING_COMMENT, start, 0 );\r
+    }\r
+    return p;\r
+}\r
+\r
+\r
+XMLNode* XMLComment::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLComment* comment = doc->NewComment( Value() );  // fixme: this will always allocate memory. Intern?\r
+    return comment;\r
+}\r
+\r
+\r
+bool XMLComment::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    TIXMLASSERT( compare );\r
+    const XMLComment* comment = compare->ToComment();\r
+    return ( comment && XMLUtil::StringEqual( comment->Value(), Value() ));\r
+}\r
+\r
+\r
+bool XMLComment::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    return visitor->Visit( *this );\r
+}\r
+\r
+\r
+// --------- XMLDeclaration ---------- //\r
+\r
+XMLDeclaration::XMLDeclaration( XMLDocument* doc ) : XMLNode( doc )\r
+{\r
+}\r
+\r
+\r
+XMLDeclaration::~XMLDeclaration()\r
+{\r
+    //printf( "~XMLDeclaration\n" );\r
+}\r
+\r
+\r
+char* XMLDeclaration::ParseDeep( char* p, StrPair* )\r
+{\r
+    // Declaration parses as text.\r
+    const char* start = p;\r
+    p = _value.ParseText( p, "?>", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
+    if ( p == 0 ) {\r
+        _document->SetError( XML_ERROR_PARSING_DECLARATION, start, 0 );\r
+    }\r
+    return p;\r
+}\r
+\r
+\r
+XMLNode* XMLDeclaration::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLDeclaration* dec = doc->NewDeclaration( Value() );      // fixme: this will always allocate memory. Intern?\r
+    return dec;\r
+}\r
+\r
+\r
+bool XMLDeclaration::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    TIXMLASSERT( compare );\r
+    const XMLDeclaration* declaration = compare->ToDeclaration();\r
+    return ( declaration && XMLUtil::StringEqual( declaration->Value(), Value() ));\r
+}\r
+\r
+\r
+\r
+bool XMLDeclaration::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    return visitor->Visit( *this );\r
+}\r
+\r
+// --------- XMLUnknown ---------- //\r
+\r
+XMLUnknown::XMLUnknown( XMLDocument* doc ) : XMLNode( doc )\r
+{\r
+}\r
+\r
+\r
+XMLUnknown::~XMLUnknown()\r
+{\r
+}\r
+\r
+\r
+char* XMLUnknown::ParseDeep( char* p, StrPair* )\r
+{\r
+    // Unknown parses as text.\r
+    const char* start = p;\r
+\r
+    p = _value.ParseText( p, ">", StrPair::NEEDS_NEWLINE_NORMALIZATION );\r
+    if ( !p ) {\r
+        _document->SetError( XML_ERROR_PARSING_UNKNOWN, start, 0 );\r
+    }\r
+    return p;\r
+}\r
+\r
+\r
+XMLNode* XMLUnknown::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLUnknown* text = doc->NewUnknown( Value() );     // fixme: this will always allocate memory. Intern?\r
+    return text;\r
+}\r
+\r
+\r
+bool XMLUnknown::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    TIXMLASSERT( compare );\r
+    const XMLUnknown* unknown = compare->ToUnknown();\r
+    return ( unknown && XMLUtil::StringEqual( unknown->Value(), Value() ));\r
+}\r
+\r
+\r
+bool XMLUnknown::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    return visitor->Visit( *this );\r
+}\r
+\r
+// --------- XMLAttribute ---------- //\r
+\r
+const char* XMLAttribute::Name() const \r
+{\r
+    return _name.GetStr();\r
+}\r
+\r
+const char* XMLAttribute::Value() const \r
+{\r
+    return _value.GetStr();\r
+}\r
+\r
+char* XMLAttribute::ParseDeep( char* p, bool processEntities )\r
+{\r
+    // Parse using the name rules: bug fix, was using ParseText before\r
+    p = _name.ParseName( p );\r
+    if ( !p || !*p ) {\r
+        return 0;\r
+    }\r
+\r
+    // Skip white space before =\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+    if ( *p != '=' ) {\r
+        return 0;\r
+    }\r
+\r
+    ++p;       // move up to opening quote\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+    if ( *p != '\"' && *p != '\'' ) {\r
+        return 0;\r
+    }\r
+\r
+    char endTag[2] = { *p, 0 };\r
+    ++p;       // move past opening quote\r
+\r
+    p = _value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES );\r
+    return p;\r
+}\r
+\r
+\r
+void XMLAttribute::SetName( const char* n )\r
+{\r
+    _name.SetStr( n );\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryIntValue( int* value ) const\r
+{\r
+    if ( XMLUtil::ToInt( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const\r
+{\r
+    if ( XMLUtil::ToUnsigned( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryBoolValue( bool* value ) const\r
+{\r
+    if ( XMLUtil::ToBool( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryFloatValue( float* value ) const\r
+{\r
+    if ( XMLUtil::ToFloat( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+XMLError XMLAttribute::QueryDoubleValue( double* value ) const\r
+{\r
+    if ( XMLUtil::ToDouble( Value(), value )) {\r
+        return XML_NO_ERROR;\r
+    }\r
+    return XML_WRONG_ATTRIBUTE_TYPE;\r
+}\r
+\r
+\r
+void XMLAttribute::SetAttribute( const char* v )\r
+{\r
+    _value.SetStr( v );\r
+}\r
+\r
+\r
+void XMLAttribute::SetAttribute( int v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+\r
+void XMLAttribute::SetAttribute( unsigned v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+\r
+void XMLAttribute::SetAttribute( bool v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+void XMLAttribute::SetAttribute( double v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+void XMLAttribute::SetAttribute( float v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    _value.SetStr( buf );\r
+}\r
+\r
+\r
+// --------- XMLElement ---------- //\r
+XMLElement::XMLElement( XMLDocument* doc ) : XMLNode( doc ),\r
+    _closingType( 0 ),\r
+    _rootAttribute( 0 )\r
+{\r
+}\r
+\r
+\r
+XMLElement::~XMLElement()\r
+{\r
+    while( _rootAttribute ) {\r
+        XMLAttribute* next = _rootAttribute->_next;\r
+        DeleteAttribute( _rootAttribute );\r
+        _rootAttribute = next;\r
+    }\r
+}\r
+\r
+\r
+const XMLAttribute* XMLElement::FindAttribute( const char* name ) const\r
+{\r
+    for( XMLAttribute* a = _rootAttribute; a; a = a->_next ) {\r
+        if ( XMLUtil::StringEqual( a->Name(), name ) ) {\r
+            return a;\r
+        }\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const char* XMLElement::Attribute( const char* name, const char* value ) const\r
+{\r
+    const XMLAttribute* a = FindAttribute( name );\r
+    if ( !a ) {\r
+        return 0;\r
+    }\r
+    if ( !value || XMLUtil::StringEqual( a->Value(), value )) {\r
+        return a->Value();\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+const char* XMLElement::GetText() const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        return FirstChild()->Value();\r
+    }\r
+    return 0;\r
+}\r
+\r
+\r
+void   XMLElement::SetText( const char* inText )\r
+{\r
+       if ( FirstChild() && FirstChild()->ToText() )\r
+               FirstChild()->SetValue( inText );\r
+       else {\r
+               XMLText*        theText = GetDocument()->NewText( inText );\r
+               InsertFirstChild( theText );\r
+       }\r
+}\r
+\r
+\r
+void XMLElement::SetText( int v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+void XMLElement::SetText( unsigned v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+void XMLElement::SetText( bool v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+void XMLElement::SetText( float v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+void XMLElement::SetText( double v ) \r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    SetText( buf );\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryIntText( int* ival ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToInt( t, ival ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryUnsignedText( unsigned* uval ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToUnsigned( t, uval ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryBoolText( bool* bval ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToBool( t, bval ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryDoubleText( double* dval ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToDouble( t, dval ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+XMLError XMLElement::QueryFloatText( float* fval ) const\r
+{\r
+    if ( FirstChild() && FirstChild()->ToText() ) {\r
+        const char* t = FirstChild()->Value();\r
+        if ( XMLUtil::ToFloat( t, fval ) ) {\r
+            return XML_SUCCESS;\r
+        }\r
+        return XML_CAN_NOT_CONVERT_TEXT;\r
+    }\r
+    return XML_NO_TEXT_NODE;\r
+}\r
+\r
+\r
+\r
+XMLAttribute* XMLElement::FindOrCreateAttribute( const char* name )\r
+{\r
+    XMLAttribute* last = 0;\r
+    XMLAttribute* attrib = 0;\r
+    for( attrib = _rootAttribute;\r
+            attrib;\r
+            last = attrib, attrib = attrib->_next ) {\r
+        if ( XMLUtil::StringEqual( attrib->Name(), name ) ) {\r
+            break;\r
+        }\r
+    }\r
+    if ( !attrib ) {\r
+        TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() );\r
+        attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\r
+        attrib->_memPool = &_document->_attributePool;\r
+        if ( last ) {\r
+            last->_next = attrib;\r
+        }\r
+        else {\r
+            _rootAttribute = attrib;\r
+        }\r
+        attrib->SetName( name );\r
+        attrib->_memPool->SetTracked(); // always created and linked.\r
+    }\r
+    return attrib;\r
+}\r
+\r
+\r
+void XMLElement::DeleteAttribute( const char* name )\r
+{\r
+    XMLAttribute* prev = 0;\r
+    for( XMLAttribute* a=_rootAttribute; a; a=a->_next ) {\r
+        if ( XMLUtil::StringEqual( name, a->Name() ) ) {\r
+            if ( prev ) {\r
+                prev->_next = a->_next;\r
+            }\r
+            else {\r
+                _rootAttribute = a->_next;\r
+            }\r
+            DeleteAttribute( a );\r
+            break;\r
+        }\r
+        prev = a;\r
+    }\r
+}\r
+\r
+\r
+char* XMLElement::ParseAttributes( char* p )\r
+{\r
+    const char* start = p;\r
+    XMLAttribute* prevAttribute = 0;\r
+\r
+    // Read the attributes.\r
+    while( p ) {\r
+        p = XMLUtil::SkipWhiteSpace( p );\r
+        if ( !(*p) ) {\r
+            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, Name() );\r
+            return 0;\r
+        }\r
+\r
+        // attribute.\r
+        if (XMLUtil::IsNameStartChar( *p ) ) {\r
+            TIXMLASSERT( sizeof( XMLAttribute ) == _document->_attributePool.ItemSize() );\r
+            XMLAttribute* attrib = new (_document->_attributePool.Alloc() ) XMLAttribute();\r
+            attrib->_memPool = &_document->_attributePool;\r
+                       attrib->_memPool->SetTracked();\r
+\r
+            p = attrib->ParseDeep( p, _document->ProcessEntities() );\r
+            if ( !p || Attribute( attrib->Name() ) ) {\r
+                DeleteAttribute( attrib );\r
+                _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, start, p );\r
+                return 0;\r
+            }\r
+            // There is a minor bug here: if the attribute in the source xml\r
+            // document is duplicated, it will not be detected and the\r
+            // attribute will be doubly added. However, tracking the 'prevAttribute'\r
+            // avoids re-scanning the attribute list. Preferring performance for\r
+            // now, may reconsider in the future.\r
+            if ( prevAttribute ) {\r
+                prevAttribute->_next = attrib;\r
+            }\r
+            else {\r
+                _rootAttribute = attrib;\r
+            }\r
+            prevAttribute = attrib;\r
+        }\r
+        // end of the tag\r
+        else if ( *p == '/' && *(p+1) == '>' ) {\r
+            _closingType = CLOSED;\r
+            return p+2;        // done; sealed element.\r
+        }\r
+        // end of the tag\r
+        else if ( *p == '>' ) {\r
+            ++p;\r
+            break;\r
+        }\r
+        else {\r
+            _document->SetError( XML_ERROR_PARSING_ELEMENT, start, p );\r
+            return 0;\r
+        }\r
+    }\r
+    return p;\r
+}\r
+\r
+void XMLElement::DeleteAttribute( XMLAttribute* attribute )\r
+{\r
+    if ( attribute == 0 ) {\r
+        return;\r
+    }\r
+    MemPool* pool = attribute->_memPool;\r
+    attribute->~XMLAttribute();\r
+    pool->Free( attribute );\r
+}\r
+\r
+//\r
+//     <ele></ele>\r
+//     <ele>foo<b>bar</b></ele>\r
+//\r
+char* XMLElement::ParseDeep( char* p, StrPair* strPair )\r
+{\r
+    // Read the element name.\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+\r
+    // The closing element is the </element> form. It is\r
+    // parsed just like a regular element then deleted from\r
+    // the DOM.\r
+    if ( *p == '/' ) {\r
+        _closingType = CLOSING;\r
+        ++p;\r
+    }\r
+\r
+    p = _value.ParseName( p );\r
+    if ( _value.Empty() ) {\r
+        return 0;\r
+    }\r
+\r
+    p = ParseAttributes( p );\r
+    if ( !p || !*p || _closingType ) {\r
+        return p;\r
+    }\r
+\r
+    p = XMLNode::ParseDeep( p, strPair );\r
+    return p;\r
+}\r
+\r
+\r
+\r
+XMLNode* XMLElement::ShallowClone( XMLDocument* doc ) const\r
+{\r
+    if ( !doc ) {\r
+        doc = _document;\r
+    }\r
+    XMLElement* element = doc->NewElement( Value() );                                  // fixme: this will always allocate memory. Intern?\r
+    for( const XMLAttribute* a=FirstAttribute(); a; a=a->Next() ) {\r
+        element->SetAttribute( a->Name(), a->Value() );                                        // fixme: this will always allocate memory. Intern?\r
+    }\r
+    return element;\r
+}\r
+\r
+\r
+bool XMLElement::ShallowEqual( const XMLNode* compare ) const\r
+{\r
+    TIXMLASSERT( compare );\r
+    const XMLElement* other = compare->ToElement();\r
+    if ( other && XMLUtil::StringEqual( other->Value(), Value() )) {\r
+\r
+        const XMLAttribute* a=FirstAttribute();\r
+        const XMLAttribute* b=other->FirstAttribute();\r
+\r
+        while ( a && b ) {\r
+            if ( !XMLUtil::StringEqual( a->Value(), b->Value() ) ) {\r
+                return false;\r
+            }\r
+            a = a->Next();\r
+            b = b->Next();\r
+        }\r
+        if ( a || b ) {\r
+            // different count\r
+            return false;\r
+        }\r
+        return true;\r
+    }\r
+    return false;\r
+}\r
+\r
+\r
+bool XMLElement::Accept( XMLVisitor* visitor ) const\r
+{\r
+    TIXMLASSERT( visitor );\r
+    if ( visitor->VisitEnter( *this, _rootAttribute ) ) {\r
+        for ( const XMLNode* node=FirstChild(); node; node=node->NextSibling() ) {\r
+            if ( !node->Accept( visitor ) ) {\r
+                break;\r
+            }\r
+        }\r
+    }\r
+    return visitor->VisitExit( *this );\r
+}\r
+\r
+\r
+// --------- XMLDocument ----------- //\r
+\r
+// Warning: List must match 'enum XMLError'\r
+const char* XMLDocument::_errorNames[XML_ERROR_COUNT] = {\r
+    "XML_SUCCESS",\r
+    "XML_NO_ATTRIBUTE",\r
+    "XML_WRONG_ATTRIBUTE_TYPE",\r
+    "XML_ERROR_FILE_NOT_FOUND",\r
+    "XML_ERROR_FILE_COULD_NOT_BE_OPENED",\r
+    "XML_ERROR_FILE_READ_ERROR",\r
+    "XML_ERROR_ELEMENT_MISMATCH",\r
+    "XML_ERROR_PARSING_ELEMENT",\r
+    "XML_ERROR_PARSING_ATTRIBUTE",\r
+    "XML_ERROR_IDENTIFYING_TAG",\r
+    "XML_ERROR_PARSING_TEXT",\r
+    "XML_ERROR_PARSING_CDATA",\r
+    "XML_ERROR_PARSING_COMMENT",\r
+    "XML_ERROR_PARSING_DECLARATION",\r
+    "XML_ERROR_PARSING_UNKNOWN",\r
+    "XML_ERROR_EMPTY_DOCUMENT",\r
+    "XML_ERROR_MISMATCHED_ELEMENT",\r
+    "XML_ERROR_PARSING",\r
+    "XML_CAN_NOT_CONVERT_TEXT",\r
+    "XML_NO_TEXT_NODE"\r
+};\r
+\r
+\r
+XMLDocument::XMLDocument( bool processEntities, Whitespace whitespace ) :\r
+    XMLNode( 0 ),\r
+    _writeBOM( false ),\r
+    _processEntities( processEntities ),\r
+    _errorID( XML_NO_ERROR ),\r
+    _whitespace( whitespace ),\r
+    _errorStr1( 0 ),\r
+    _errorStr2( 0 ),\r
+    _charBuffer( 0 )\r
+{\r
+    _document = this;  // avoid warning about 'this' in initializer list\r
+}\r
+\r
+\r
+XMLDocument::~XMLDocument()\r
+{\r
+    Clear();\r
+}\r
+\r
+\r
+void XMLDocument::Clear()\r
+{\r
+    DeleteChildren();\r
+\r
+#ifdef DEBUG\r
+    const bool hadError = Error();\r
+#endif\r
+    _errorID = XML_NO_ERROR;\r
+    _errorStr1 = 0;\r
+    _errorStr2 = 0;\r
+\r
+    delete [] _charBuffer;\r
+    _charBuffer = 0;\r
+\r
+#if 0\r
+    _textPool.Trace( "text" );\r
+    _elementPool.Trace( "element" );\r
+    _commentPool.Trace( "comment" );\r
+    _attributePool.Trace( "attribute" );\r
+#endif\r
+    \r
+#ifdef DEBUG\r
+    if ( !hadError ) {\r
+        TIXMLASSERT( _elementPool.CurrentAllocs()   == _elementPool.Untracked() );\r
+        TIXMLASSERT( _attributePool.CurrentAllocs() == _attributePool.Untracked() );\r
+        TIXMLASSERT( _textPool.CurrentAllocs()      == _textPool.Untracked() );\r
+        TIXMLASSERT( _commentPool.CurrentAllocs()   == _commentPool.Untracked() );\r
+    }\r
+#endif\r
+}\r
+\r
+\r
+XMLElement* XMLDocument::NewElement( const char* name )\r
+{\r
+    TIXMLASSERT( sizeof( XMLElement ) == _elementPool.ItemSize() );\r
+    XMLElement* ele = new (_elementPool.Alloc()) XMLElement( this );\r
+    ele->_memPool = &_elementPool;\r
+    ele->SetName( name );\r
+    return ele;\r
+}\r
+\r
+\r
+XMLComment* XMLDocument::NewComment( const char* str )\r
+{\r
+    TIXMLASSERT( sizeof( XMLComment ) == _commentPool.ItemSize() );\r
+    XMLComment* comment = new (_commentPool.Alloc()) XMLComment( this );\r
+    comment->_memPool = &_commentPool;\r
+    comment->SetValue( str );\r
+    return comment;\r
+}\r
+\r
+\r
+XMLText* XMLDocument::NewText( const char* str )\r
+{\r
+    TIXMLASSERT( sizeof( XMLText ) == _textPool.ItemSize() );\r
+    XMLText* text = new (_textPool.Alloc()) XMLText( this );\r
+    text->_memPool = &_textPool;\r
+    text->SetValue( str );\r
+    return text;\r
+}\r
+\r
+\r
+XMLDeclaration* XMLDocument::NewDeclaration( const char* str )\r
+{\r
+    TIXMLASSERT( sizeof( XMLDeclaration ) == _commentPool.ItemSize() );\r
+    XMLDeclaration* dec = new (_commentPool.Alloc()) XMLDeclaration( this );\r
+    dec->_memPool = &_commentPool;\r
+    dec->SetValue( str ? str : "xml version=\"1.0\" encoding=\"UTF-8\"" );\r
+    return dec;\r
+}\r
+\r
+\r
+XMLUnknown* XMLDocument::NewUnknown( const char* str )\r
+{\r
+    TIXMLASSERT( sizeof( XMLUnknown ) == _commentPool.ItemSize() );\r
+    XMLUnknown* unk = new (_commentPool.Alloc()) XMLUnknown( this );\r
+    unk->_memPool = &_commentPool;\r
+    unk->SetValue( str );\r
+    return unk;\r
+}\r
+\r
+static FILE* callfopen( const char* filepath, const char* mode )\r
+{\r
+    TIXMLASSERT( filepath );\r
+    TIXMLASSERT( mode );\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)\r
+    FILE* fp = 0;\r
+    errno_t err = fopen_s( &fp, filepath, mode );\r
+    if ( err ) {\r
+        return 0;\r
+    }\r
+#else\r
+    FILE* fp = fopen( filepath, mode );\r
+#endif\r
+    return fp;\r
+}\r
+    \r
+void XMLDocument::DeleteNode( XMLNode* node )  {\r
+    TIXMLASSERT( node );\r
+    TIXMLASSERT(node->_document == this );\r
+    if (node->_parent) {\r
+        node->_parent->DeleteChild( node );\r
+    }\r
+    else {\r
+        // Isn't in the tree.\r
+        // Use the parent delete.\r
+        // Also, we need to mark it tracked: we 'know'\r
+        // it was never used.\r
+        node->_memPool->SetTracked();\r
+        // Call the static XMLNode version:\r
+        XMLNode::DeleteNode(node);\r
+    }\r
+}\r
+\r
+\r
+XMLError XMLDocument::LoadFile( const char* filename )\r
+{\r
+    Clear();\r
+    FILE* fp = callfopen( filename, "rb" );\r
+    if ( !fp ) {\r
+        SetError( XML_ERROR_FILE_NOT_FOUND, filename, 0 );\r
+        return _errorID;\r
+    }\r
+    LoadFile( fp );\r
+    fclose( fp );\r
+    return _errorID;\r
+}\r
+\r
+\r
+XMLError XMLDocument::LoadFile( FILE* fp )\r
+{\r
+    Clear();\r
+\r
+    fseek( fp, 0, SEEK_SET );\r
+    if ( fgetc( fp ) == EOF && ferror( fp ) != 0 ) {\r
+        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+        return _errorID;\r
+    }\r
+\r
+    fseek( fp, 0, SEEK_END );\r
+    const long filelength = ftell( fp );\r
+    fseek( fp, 0, SEEK_SET );\r
+    if ( filelength == -1L ) {\r
+        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+        return _errorID;\r
+    }\r
+\r
+    const size_t size = filelength;\r
+    if ( size == 0 ) {\r
+        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+        return _errorID;\r
+    }\r
+\r
+    _charBuffer = new char[size+1];\r
+    size_t read = fread( _charBuffer, 1, size, fp );\r
+    if ( read != size ) {\r
+        SetError( XML_ERROR_FILE_READ_ERROR, 0, 0 );\r
+        return _errorID;\r
+    }\r
+\r
+    _charBuffer[size] = 0;\r
+\r
+    Parse();\r
+    return _errorID;\r
+}\r
+\r
+\r
+XMLError XMLDocument::SaveFile( const char* filename, bool compact )\r
+{\r
+    FILE* fp = callfopen( filename, "w" );\r
+    if ( !fp ) {\r
+        SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, filename, 0 );\r
+        return _errorID;\r
+    }\r
+    SaveFile(fp, compact);\r
+    fclose( fp );\r
+    return _errorID;\r
+}\r
+\r
+\r
+XMLError XMLDocument::SaveFile( FILE* fp, bool compact )\r
+{\r
+    XMLPrinter stream( fp, compact );\r
+    Print( &stream );\r
+    return _errorID;\r
+}\r
+\r
+\r
+XMLError XMLDocument::Parse( const char* p, size_t len )\r
+{\r
+    Clear();\r
+\r
+    if ( len == 0 || !p || !*p ) {\r
+        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+        return _errorID;\r
+    }\r
+    if ( len == (size_t)(-1) ) {\r
+        len = strlen( p );\r
+    }\r
+    _charBuffer = new char[ len+1 ];\r
+    memcpy( _charBuffer, p, len );\r
+    _charBuffer[len] = 0;\r
+\r
+    Parse();\r
+    if ( Error() ) {\r
+        // clean up now essentially dangling memory.\r
+        // and the parse fail can put objects in the\r
+        // pools that are dead and inaccessible.\r
+        DeleteChildren();\r
+        _elementPool.Clear();\r
+        _attributePool.Clear();\r
+        _textPool.Clear();\r
+        _commentPool.Clear();\r
+    }\r
+    return _errorID;\r
+}\r
+\r
+\r
+void XMLDocument::Print( XMLPrinter* streamer ) const\r
+{\r
+    XMLPrinter stdStreamer( stdout );\r
+    if ( !streamer ) {\r
+        streamer = &stdStreamer;\r
+    }\r
+    Accept( streamer );\r
+}\r
+\r
+\r
+void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )\r
+{\r
+    TIXMLASSERT( error >= 0 && error < XML_ERROR_COUNT );\r
+    _errorID = error;\r
+    _errorStr1 = str1;\r
+    _errorStr2 = str2;\r
+}\r
+\r
+const char* XMLDocument::ErrorName() const\r
+{\r
+       TIXMLASSERT( _errorID >= 0 && _errorID < XML_ERROR_COUNT );\r
+       return _errorNames[_errorID];\r
+}\r
+\r
+void XMLDocument::PrintError() const\r
+{\r
+    if ( Error() ) {\r
+        static const int LEN = 20;\r
+        char buf1[LEN] = { 0 };\r
+        char buf2[LEN] = { 0 };\r
+\r
+        if ( _errorStr1 ) {\r
+            TIXML_SNPRINTF( buf1, LEN, "%s", _errorStr1 );\r
+        }\r
+        if ( _errorStr2 ) {\r
+            TIXML_SNPRINTF( buf2, LEN, "%s", _errorStr2 );\r
+        }\r
+\r
+        printf( "XMLDocument error id=%d '%s' str1=%s str2=%s\n",\r
+                _errorID, ErrorName(), buf1, buf2 );\r
+    }\r
+}\r
+\r
+void XMLDocument::Parse()\r
+{\r
+    TIXMLASSERT( NoChildren() ); // Clear() must have been called previously\r
+    TIXMLASSERT( _charBuffer );\r
+    char* p = _charBuffer;\r
+    p = XMLUtil::SkipWhiteSpace( p );\r
+    p = const_cast<char*>( XMLUtil::ReadBOM( p, &_writeBOM ) );\r
+    if ( !*p ) {\r
+        SetError( XML_ERROR_EMPTY_DOCUMENT, 0, 0 );\r
+        return;\r
+    }\r
+    ParseDeep(p, 0 );\r
+}\r
+\r
+XMLPrinter::XMLPrinter( FILE* file, bool compact, int depth ) :\r
+    _elementJustOpened( false ),\r
+    _firstElement( true ),\r
+    _fp( file ),\r
+    _depth( depth ),\r
+    _textDepth( -1 ),\r
+    _processEntities( true ),\r
+    _compactMode( compact )\r
+{\r
+    for( int i=0; i<ENTITY_RANGE; ++i ) {\r
+        _entityFlag[i] = false;\r
+        _restrictedEntityFlag[i] = false;\r
+    }\r
+    for( int i=0; i<NUM_ENTITIES; ++i ) {\r
+        const char entityValue = entities[i].value;\r
+        TIXMLASSERT( 0 <= entityValue && entityValue < ENTITY_RANGE );\r
+        _entityFlag[ (unsigned char)entityValue ] = true;\r
+    }\r
+    _restrictedEntityFlag[(unsigned char)'&'] = true;\r
+    _restrictedEntityFlag[(unsigned char)'<'] = true;\r
+    _restrictedEntityFlag[(unsigned char)'>'] = true;  // not required, but consistency is nice\r
+    _buffer.Push( 0 );\r
+}\r
+\r
+\r
+void XMLPrinter::Print( const char* format, ... )\r
+{\r
+    va_list     va;\r
+    va_start( va, format );\r
+\r
+    if ( _fp ) {\r
+        vfprintf( _fp, format, va );\r
+    }\r
+    else {\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1400 )\r
+               #if defined(WINCE)\r
+               int len = 512;\r
+               do {\r
+                   len = len*2;\r
+                   char* str = new char[len]();\r
+                       len = _vsnprintf(str, len, format, va);\r
+                       delete[] str;\r
+               }while (len < 0);\r
+               #else\r
+        int len = _vscprintf( format, va );\r
+               #endif\r
+#else\r
+        int len = vsnprintf( 0, 0, format, va );\r
+#endif\r
+        // Close out and re-start the va-args\r
+        va_end( va );\r
+        va_start( va, format );\r
+        TIXMLASSERT( _buffer.Size() > 0 && _buffer[_buffer.Size() - 1] == 0 );\r
+        char* p = _buffer.PushArr( len ) - 1;  // back up over the null terminator.\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1400 )\r
+               #if defined(WINCE)\r
+               _vsnprintf( p, len+1, format, va );\r
+               #else\r
+               vsnprintf_s( p, len+1, _TRUNCATE, format, va );\r
+               #endif\r
+#else\r
+               vsnprintf( p, len+1, format, va );\r
+#endif\r
+    }\r
+    va_end( va );\r
+}\r
+\r
+\r
+void XMLPrinter::PrintSpace( int depth )\r
+{\r
+    for( int i=0; i<depth; ++i ) {\r
+        Print( "    " );\r
+    }\r
+}\r
+\r
+\r
+void XMLPrinter::PrintString( const char* p, bool restricted )\r
+{\r
+    // Look for runs of bytes between entities to print.\r
+    const char* q = p;\r
+\r
+    if ( _processEntities ) {\r
+        const bool* flag = restricted ? _restrictedEntityFlag : _entityFlag;\r
+        while ( *q ) {\r
+            // Remember, char is sometimes signed. (How many times has that bitten me?)\r
+            if ( *q > 0 && *q < ENTITY_RANGE ) {\r
+                // Check for entities. If one is found, flush\r
+                // the stream up until the entity, write the\r
+                // entity, and keep looking.\r
+                if ( flag[(unsigned char)(*q)] ) {\r
+                    while ( p < q ) {\r
+                        Print( "%c", *p );\r
+                        ++p;\r
+                    }\r
+                    for( int i=0; i<NUM_ENTITIES; ++i ) {\r
+                        if ( entities[i].value == *q ) {\r
+                            Print( "&%s;", entities[i].pattern );\r
+                            break;\r
+                        }\r
+                    }\r
+                    ++p;\r
+                }\r
+            }\r
+            ++q;\r
+        }\r
+    }\r
+    // Flush the remaining string. This will be the entire\r
+    // string if an entity wasn't found.\r
+    if ( !_processEntities || (q-p > 0) ) {\r
+        Print( "%s", p );\r
+    }\r
+}\r
+\r
+\r
+void XMLPrinter::PushHeader( bool writeBOM, bool writeDec )\r
+{\r
+    if ( writeBOM ) {\r
+        static const unsigned char bom[] = { TIXML_UTF_LEAD_0, TIXML_UTF_LEAD_1, TIXML_UTF_LEAD_2, 0 };\r
+        Print( "%s", bom );\r
+    }\r
+    if ( writeDec ) {\r
+        PushDeclaration( "xml version=\"1.0\"" );\r
+    }\r
+}\r
+\r
+\r
+void XMLPrinter::OpenElement( const char* name, bool compactMode )\r
+{\r
+    SealElementIfJustOpened();\r
+    _stack.Push( name );\r
+\r
+    if ( _textDepth < 0 && !_firstElement && !compactMode ) {\r
+        Print( "\n" );\r
+    }\r
+    if ( !compactMode ) {\r
+        PrintSpace( _depth );\r
+    }\r
+\r
+    Print( "<%s", name );\r
+    _elementJustOpened = true;\r
+    _firstElement = false;\r
+    ++_depth;\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, const char* value )\r
+{\r
+    TIXMLASSERT( _elementJustOpened );\r
+    Print( " %s=\"", name );\r
+    PrintString( value, false );\r
+    Print( "\"" );\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, int v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    PushAttribute( name, buf );\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, unsigned v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    PushAttribute( name, buf );\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, bool v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    PushAttribute( name, buf );\r
+}\r
+\r
+\r
+void XMLPrinter::PushAttribute( const char* name, double v )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( v, buf, BUF_SIZE );\r
+    PushAttribute( name, buf );\r
+}\r
+\r
+\r
+void XMLPrinter::CloseElement( bool compactMode )\r
+{\r
+    --_depth;\r
+    const char* name = _stack.Pop();\r
+\r
+    if ( _elementJustOpened ) {\r
+        Print( "/>" );\r
+    }\r
+    else {\r
+        if ( _textDepth < 0 && !compactMode) {\r
+            Print( "\n" );\r
+            PrintSpace( _depth );\r
+        }\r
+        Print( "</%s>", name );\r
+    }\r
+\r
+    if ( _textDepth == _depth ) {\r
+        _textDepth = -1;\r
+    }\r
+    if ( _depth == 0 && !compactMode) {\r
+        Print( "\n" );\r
+    }\r
+    _elementJustOpened = false;\r
+}\r
+\r
+\r
+void XMLPrinter::SealElementIfJustOpened()\r
+{\r
+    if ( !_elementJustOpened ) {\r
+        return;\r
+    }\r
+    _elementJustOpened = false;\r
+    Print( ">" );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( const char* text, bool cdata )\r
+{\r
+    _textDepth = _depth-1;\r
+\r
+    SealElementIfJustOpened();\r
+    if ( cdata ) {\r
+        Print( "<![CDATA[" );\r
+        Print( "%s", text );\r
+        Print( "]]>" );\r
+    }\r
+    else {\r
+        PrintString( text, true );\r
+    }\r
+}\r
+\r
+void XMLPrinter::PushText( int value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( unsigned value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( bool value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( float value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushText( double value )\r
+{\r
+    char buf[BUF_SIZE];\r
+    XMLUtil::ToStr( value, buf, BUF_SIZE );\r
+    PushText( buf, false );\r
+}\r
+\r
+\r
+void XMLPrinter::PushComment( const char* comment )\r
+{\r
+    SealElementIfJustOpened();\r
+    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print( "\n" );\r
+        PrintSpace( _depth );\r
+    }\r
+    _firstElement = false;\r
+    Print( "<!--%s-->", comment );\r
+}\r
+\r
+\r
+void XMLPrinter::PushDeclaration( const char* value )\r
+{\r
+    SealElementIfJustOpened();\r
+    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print( "\n" );\r
+        PrintSpace( _depth );\r
+    }\r
+    _firstElement = false;\r
+    Print( "<?%s?>", value );\r
+}\r
+\r
+\r
+void XMLPrinter::PushUnknown( const char* value )\r
+{\r
+    SealElementIfJustOpened();\r
+    if ( _textDepth < 0 && !_firstElement && !_compactMode) {\r
+        Print( "\n" );\r
+        PrintSpace( _depth );\r
+    }\r
+    _firstElement = false;\r
+    Print( "<!%s>", value );\r
+}\r
+\r
+\r
+bool XMLPrinter::VisitEnter( const XMLDocument& doc )\r
+{\r
+    _processEntities = doc.ProcessEntities();\r
+    if ( doc.HasBOM() ) {\r
+        PushHeader( true, false );\r
+    }\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::VisitEnter( const XMLElement& element, const XMLAttribute* attribute )\r
+{\r
+       const XMLElement*       parentElem = element.Parent()->ToElement();\r
+       bool            compactMode = parentElem ? CompactMode(*parentElem) : _compactMode;\r
+    OpenElement( element.Name(), compactMode );\r
+    while ( attribute ) {\r
+        PushAttribute( attribute->Name(), attribute->Value() );\r
+        attribute = attribute->Next();\r
+    }\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::VisitExit( const XMLElement& element )\r
+{\r
+    CloseElement( CompactMode(element) );\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::Visit( const XMLText& text )\r
+{\r
+    PushText( text.Value(), text.CData() );\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::Visit( const XMLComment& comment )\r
+{\r
+    PushComment( comment.Value() );\r
+    return true;\r
+}\r
+\r
+bool XMLPrinter::Visit( const XMLDeclaration& declaration )\r
+{\r
+    PushDeclaration( declaration.Value() );\r
+    return true;\r
+}\r
+\r
+\r
+bool XMLPrinter::Visit( const XMLUnknown& unknown )\r
+{\r
+    PushUnknown( unknown.Value() );\r
+    return true;\r
+}\r
+\r
+}   // namespace tinyxml2\r
+\r
diff --git a/tinyxml2.h b/tinyxml2.h
new file mode 100755 (executable)
index 0000000..a6da2ec
--- /dev/null
@@ -0,0 +1,2130 @@
+/*\r
+Original code by Lee Thomason (www.grinninglizard.com)\r
+\r
+This software is provided 'as-is', without any express or implied\r
+warranty. In no event will the authors be held liable for any\r
+damages arising from the use of this software.\r
+\r
+Permission is granted to anyone to use this software for any\r
+purpose, including commercial applications, and to alter it and\r
+redistribute it freely, subject to the following restrictions:\r
+\r
+1. The origin of this software must not be misrepresented; you must\r
+not claim that you wrote the original software. If you use this\r
+software in a product, an acknowledgment in the product documentation\r
+would be appreciated but is not required.\r
+\r
+2. Altered source versions must be plainly marked as such, and\r
+must not be misrepresented as being the original software.\r
+\r
+3. This notice may not be removed or altered from any source\r
+distribution.\r
+*/\r
+\r
+#ifndef TINYXML2_INCLUDED\r
+#define TINYXML2_INCLUDED\r
+\r
+#if defined(ANDROID_NDK) || defined(__BORLANDC__) || defined(__QNXNTO__)\r
+#   include <ctype.h>\r
+#   include <limits.h>\r
+#   include <stdio.h>\r
+#   include <stdlib.h>\r
+#   include <string.h>\r
+#   include <stdarg.h>\r
+#else\r
+#   include <cctype>\r
+#   include <climits>\r
+#   include <cstdio>\r
+#   include <cstdlib>\r
+#   include <cstring>\r
+#   include <cstdarg>\r
+#endif\r
+\r
+/*\r
+   TODO: intern strings instead of allocation.\r
+*/\r
+/*\r
+       gcc:\r
+        g++ -Wall -DDEBUG tinyxml2.cpp xmltest.cpp -o gccxmltest.exe\r
+\r
+    Formatting, Artistic Style:\r
+        AStyle.exe --style=1tbs --indent-switches --break-closing-brackets --indent-preprocessor tinyxml2.cpp tinyxml2.h\r
+*/\r
+\r
+#if defined( _DEBUG ) || defined( DEBUG ) || defined (__DEBUG__)\r
+#   ifndef DEBUG\r
+#       define DEBUG\r
+#   endif\r
+#endif\r
+\r
+#ifdef _MSC_VER\r
+#   pragma warning(push)\r
+#   pragma warning(disable: 4251)\r
+#endif\r
+\r
+#ifdef _WIN32\r
+#   ifdef TINYXML2_EXPORT\r
+#       define TINYXML2_LIB __declspec(dllexport)\r
+#   elif defined(TINYXML2_IMPORT)\r
+#       define TINYXML2_LIB __declspec(dllimport)\r
+#   else\r
+#       define TINYXML2_LIB\r
+#   endif\r
+#else\r
+#   define TINYXML2_LIB\r
+#endif\r
+\r
+\r
+#if defined(DEBUG)\r
+#   if defined(_MSC_VER)\r
+#       // "(void)0," is for suppressing C4127 warning in "assert(false)", "assert(true)" and the like\r
+#       define TIXMLASSERT( x )           if ( !((void)0,(x))) { __debugbreak(); } //if ( !(x)) WinDebugBreak()\r
+#   elif defined (ANDROID_NDK)\r
+#       include <android/log.h>\r
+#       define TIXMLASSERT( x )           if ( !(x)) { __android_log_assert( "assert", "grinliz", "ASSERT in '%s' at %d.", __FILE__, __LINE__ ); }\r
+#   else\r
+#       include <assert.h>\r
+#       define TIXMLASSERT                assert\r
+#   endif\r
+#   else\r
+#       define TIXMLASSERT( x )           {}\r
+#endif\r
+\r
+\r
+#if defined(_MSC_VER) && (_MSC_VER >= 1400 ) && (!defined WINCE)\r
+// Microsoft visual studio, version 2005 and higher.\r
+/*int _snprintf_s(\r
+   char *buffer,\r
+   size_t sizeOfBuffer,\r
+   size_t count,\r
+   const char *format [,\r
+         argument] ...\r
+);*/\r
+inline int TIXML_SNPRINTF( char* buffer, size_t size, const char* format, ... )\r
+{\r
+    va_list va;\r
+    va_start( va, format );\r
+    int result = vsnprintf_s( buffer, size, _TRUNCATE, format, va );\r
+    va_end( va );\r
+    return result;\r
+}\r
+#define TIXML_SSCANF   sscanf_s\r
+#elif defined WINCE\r
+#define TIXML_SNPRINTF _snprintf\r
+#define TIXML_SSCANF   sscanf\r
+#else\r
+// GCC version 3 and higher\r
+//#warning( "Using sn* functions." )\r
+#define TIXML_SNPRINTF snprintf\r
+#define TIXML_SSCANF   sscanf\r
+#endif\r
+\r
+/* Versioning, past 1.0.14:\r
+       http://semver.org/\r
+*/\r
+static const int TIXML2_MAJOR_VERSION = 3;
+static const int TIXML2_MINOR_VERSION = 0;
+static const int TIXML2_PATCH_VERSION = 0;
+\r
+namespace tinyxml2\r
+{\r
+class XMLDocument;\r
+class XMLElement;\r
+class XMLAttribute;\r
+class XMLComment;\r
+class XMLText;\r
+class XMLDeclaration;\r
+class XMLUnknown;\r
+class XMLPrinter;\r
+\r
+/*\r
+       A class that wraps strings. Normally stores the start and end\r
+       pointers into the XML file itself, and will apply normalization\r
+       and entity translation if actually read. Can also store (and memory\r
+       manage) a traditional char[]\r
+*/\r
+class StrPair\r
+{\r
+public:\r
+    enum {\r
+        NEEDS_ENTITY_PROCESSING                        = 0x01,\r
+        NEEDS_NEWLINE_NORMALIZATION            = 0x02,\r
+        COLLAPSE_WHITESPACE                    = 0x04,\r
+\r
+        TEXT_ELEMENT                           = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,\r
+        TEXT_ELEMENT_LEAVE_ENTITIES            = NEEDS_NEWLINE_NORMALIZATION,\r
+        ATTRIBUTE_NAME                         = 0,\r
+        ATTRIBUTE_VALUE                                = NEEDS_ENTITY_PROCESSING | NEEDS_NEWLINE_NORMALIZATION,\r
+        ATTRIBUTE_VALUE_LEAVE_ENTITIES         = NEEDS_NEWLINE_NORMALIZATION,\r
+        COMMENT                                        = NEEDS_NEWLINE_NORMALIZATION\r
+    };\r
+\r
+    StrPair() : _flags( 0 ), _start( 0 ), _end( 0 ) {}\r
+    ~StrPair();\r
+\r
+    void Set( char* start, char* end, int flags ) {\r
+        Reset();\r
+        _start  = start;\r
+        _end    = end;\r
+        _flags  = flags | NEEDS_FLUSH;\r
+    }\r
+\r
+    const char* GetStr();\r
+\r
+    bool Empty() const {\r
+        return _start == _end;\r
+    }\r
+\r
+    void SetInternedStr( const char* str ) {\r
+        Reset();\r
+        _start = const_cast<char*>(str);\r
+    }\r
+\r
+    void SetStr( const char* str, int flags=0 );\r
+\r
+    char* ParseText( char* in, const char* endTag, int strFlags );\r
+    char* ParseName( char* in );\r
+\r
+    void TransferTo( StrPair* other );\r
+\r
+private:\r
+    void Reset();\r
+    void CollapseWhitespace();\r
+\r
+    enum {\r
+        NEEDS_FLUSH = 0x100,\r
+        NEEDS_DELETE = 0x200\r
+    };\r
+\r
+    // After parsing, if *_end != 0, it can be set to zero.\r
+    int     _flags;\r
+    char*   _start;\r
+    char*   _end;\r
+\r
+    StrPair( const StrPair& other );   // not supported\r
+    void operator=( StrPair& other );  // not supported, use TransferTo()\r
+};\r
+\r
+\r
+/*\r
+       A dynamic array of Plain Old Data. Doesn't support constructors, etc.\r
+       Has a small initial memory pool, so that low or no usage will not\r
+       cause a call to new/delete\r
+*/\r
+template <class T, int INIT>\r
+class DynArray\r
+{\r
+public:\r
+    DynArray() {\r
+        _mem = _pool;\r
+        _allocated = INIT;\r
+        _size = 0;\r
+    }\r
+\r
+    ~DynArray() {\r
+        if ( _mem != _pool ) {\r
+            delete [] _mem;\r
+        }\r
+    }\r
+\r
+    void Clear() {\r
+        _size = 0;\r
+    }\r
+\r
+    void Push( T t ) {\r
+        TIXMLASSERT( _size < INT_MAX );\r
+        EnsureCapacity( _size+1 );\r
+        _mem[_size++] = t;\r
+    }\r
+\r
+    T* PushArr( int count ) {\r
+        TIXMLASSERT( count >= 0 );\r
+        TIXMLASSERT( _size <= INT_MAX - count );\r
+        EnsureCapacity( _size+count );\r
+        T* ret = &_mem[_size];\r
+        _size += count;\r
+        return ret;\r
+    }\r
+\r
+    T Pop() {\r
+        TIXMLASSERT( _size > 0 );\r
+        return _mem[--_size];\r
+    }\r
+\r
+    void PopArr( int count ) {\r
+        TIXMLASSERT( _size >= count );\r
+        _size -= count;\r
+    }\r
+\r
+    bool Empty() const                                 {\r
+        return _size == 0;\r
+    }\r
+\r
+    T& operator[](int i)                               {\r
+        TIXMLASSERT( i>= 0 && i < _size );\r
+        return _mem[i];\r
+    }\r
+\r
+    const T& operator[](int i) const   {\r
+        TIXMLASSERT( i>= 0 && i < _size );\r
+        return _mem[i];\r
+    }\r
+\r
+    const T& PeekTop() const            {\r
+        TIXMLASSERT( _size > 0 );\r
+        return _mem[ _size - 1];\r
+    }\r
+\r
+    int Size() const                                   {\r
+        TIXMLASSERT( _size >= 0 );\r
+        return _size;\r
+    }\r
+\r
+    int Capacity() const                               {\r
+        return _allocated;\r
+    }\r
+\r
+    const T* Mem() const                               {\r
+        return _mem;\r
+    }\r
+\r
+    T* Mem()                                                   {\r
+        return _mem;\r
+    }\r
+\r
+private:\r
+    DynArray( const DynArray& ); // not supported\r
+    void operator=( const DynArray& ); // not supported\r
+\r
+    void EnsureCapacity( int cap ) {\r
+        TIXMLASSERT( cap > 0 );\r
+        if ( cap > _allocated ) {\r
+            TIXMLASSERT( cap <= INT_MAX / 2 );\r
+            int newAllocated = cap * 2;\r
+            T* newMem = new T[newAllocated];\r
+            memcpy( newMem, _mem, sizeof(T)*_size );   // warning: not using constructors, only works for PODs\r
+            if ( _mem != _pool ) {\r
+                delete [] _mem;\r
+            }\r
+            _mem = newMem;\r
+            _allocated = newAllocated;\r
+        }\r
+    }\r
+\r
+    T*  _mem;\r
+    T   _pool[INIT];\r
+    int _allocated;            // objects allocated\r
+    int _size;                 // number objects in use\r
+};\r
+\r
+\r
+/*\r
+       Parent virtual class of a pool for fast allocation\r
+       and deallocation of objects.\r
+*/\r
+class MemPool\r
+{\r
+public:\r
+    MemPool() {}\r
+    virtual ~MemPool() {}\r
+\r
+    virtual int ItemSize() const = 0;\r
+    virtual void* Alloc() = 0;\r
+    virtual void Free( void* ) = 0;\r
+    virtual void SetTracked() = 0;\r
+    virtual void Clear() = 0;\r
+};\r
+\r
+\r
+/*\r
+       Template child class to create pools of the correct type.\r
+*/\r
+template< int SIZE >\r
+class MemPoolT : public MemPool\r
+{\r
+public:\r
+    MemPoolT() : _root(0), _currentAllocs(0), _nAllocs(0), _maxAllocs(0), _nUntracked(0)       {}\r
+    ~MemPoolT() {\r
+        Clear();\r
+    }\r
+    \r
+    void Clear() {\r
+        // Delete the blocks.\r
+        while( !_blockPtrs.Empty()) {\r
+            Block* b  = _blockPtrs.Pop();\r
+            delete b;\r
+        }\r
+        _root = 0;\r
+        _currentAllocs = 0;\r
+        _nAllocs = 0;\r
+        _maxAllocs = 0;\r
+        _nUntracked = 0;\r
+    }\r
+\r
+    virtual int ItemSize() const       {\r
+        return SIZE;\r
+    }\r
+    int CurrentAllocs() const          {\r
+        return _currentAllocs;\r
+    }\r
+\r
+    virtual void* Alloc() {\r
+        if ( !_root ) {\r
+            // Need a new block.\r
+            Block* block = new Block();\r
+            _blockPtrs.Push( block );\r
+\r
+            for( int i=0; i<COUNT-1; ++i ) {\r
+                block->chunk[i].next = &block->chunk[i+1];\r
+            }\r
+            block->chunk[COUNT-1].next = 0;\r
+            _root = block->chunk;\r
+        }\r
+        void* result = _root;\r
+        _root = _root->next;\r
+\r
+        ++_currentAllocs;\r
+        if ( _currentAllocs > _maxAllocs ) {\r
+            _maxAllocs = _currentAllocs;\r
+        }\r
+        _nAllocs++;\r
+        _nUntracked++;\r
+        return result;\r
+    }\r
+    \r
+    virtual void Free( void* mem ) {\r
+        if ( !mem ) {\r
+            return;\r
+        }\r
+        --_currentAllocs;\r
+        Chunk* chunk = static_cast<Chunk*>( mem );\r
+#ifdef DEBUG\r
+        memset( chunk, 0xfe, sizeof(Chunk) );\r
+#endif\r
+        chunk->next = _root;\r
+        _root = chunk;\r
+    }\r
+    void Trace( const char* name ) {\r
+        printf( "Mempool %s watermark=%d [%dk] current=%d size=%d nAlloc=%d blocks=%d\n",\r
+                name, _maxAllocs, _maxAllocs*SIZE/1024, _currentAllocs, SIZE, _nAllocs, _blockPtrs.Size() );\r
+    }\r
+\r
+    void SetTracked() {\r
+        _nUntracked--;\r
+    }\r
+\r
+    int Untracked() const {\r
+        return _nUntracked;\r
+    }\r
+\r
+       // This number is perf sensitive. 4k seems like a good tradeoff on my machine.\r
+       // The test file is large, 170k.\r
+       // Release:             VS2010 gcc(no opt)\r
+       //              1k:             4000\r
+       //              2k:             4000\r
+       //              4k:             3900    21000\r
+       //              16k:    5200\r
+       //              32k:    4300\r
+       //              64k:    4000    21000\r
+    enum { COUNT = (4*1024)/SIZE }; // Some compilers do not accept to use COUNT in private part if COUNT is private\r
+\r
+private:\r
+    MemPoolT( const MemPoolT& ); // not supported\r
+    void operator=( const MemPoolT& ); // not supported\r
+\r
+    union Chunk {\r
+        Chunk*  next;\r
+        char    mem[SIZE];\r
+    };\r
+    struct Block {\r
+        Chunk chunk[COUNT];\r
+    };\r
+    DynArray< Block*, 10 > _blockPtrs;\r
+    Chunk* _root;\r
+\r
+    int _currentAllocs;\r
+    int _nAllocs;\r
+    int _maxAllocs;\r
+    int _nUntracked;\r
+};\r
+\r
+\r
+\r
+/**\r
+       Implements the interface to the "Visitor pattern" (see the Accept() method.)\r
+       If you call the Accept() method, it requires being passed a XMLVisitor\r
+       class to handle callbacks. For nodes that contain other nodes (Document, Element)\r
+       you will get called with a VisitEnter/VisitExit pair. Nodes that are always leafs\r
+       are simply called with Visit().\r
+\r
+       If you return 'true' from a Visit method, recursive parsing will continue. If you return\r
+       false, <b>no children of this node or its siblings</b> will be visited.\r
+\r
+       All flavors of Visit methods have a default implementation that returns 'true' (continue\r
+       visiting). You need to only override methods that are interesting to you.\r
+\r
+       Generally Accept() is called on the XMLDocument, although all nodes support visiting.\r
+\r
+       You should never change the document from a callback.\r
+\r
+       @sa XMLNode::Accept()\r
+*/\r
+class TINYXML2_LIB XMLVisitor\r
+{\r
+public:\r
+    virtual ~XMLVisitor() {}\r
+\r
+    /// Visit a document.\r
+    virtual bool VisitEnter( const XMLDocument& /*doc*/ )                      {\r
+        return true;\r
+    }\r
+    /// Visit a document.\r
+    virtual bool VisitExit( const XMLDocument& /*doc*/ )                       {\r
+        return true;\r
+    }\r
+\r
+    /// Visit an element.\r
+    virtual bool VisitEnter( const XMLElement& /*element*/, const XMLAttribute* /*firstAttribute*/ )   {\r
+        return true;\r
+    }\r
+    /// Visit an element.\r
+    virtual bool VisitExit( const XMLElement& /*element*/ )                    {\r
+        return true;\r
+    }\r
+\r
+    /// Visit a declaration.\r
+    virtual bool Visit( const XMLDeclaration& /*declaration*/ )                {\r
+        return true;\r
+    }\r
+    /// Visit a text node.\r
+    virtual bool Visit( const XMLText& /*text*/ )                                      {\r
+        return true;\r
+    }\r
+    /// Visit a comment node.\r
+    virtual bool Visit( const XMLComment& /*comment*/ )                                {\r
+        return true;\r
+    }\r
+    /// Visit an unknown node.\r
+    virtual bool Visit( const XMLUnknown& /*unknown*/ )                                {\r
+        return true;\r
+    }\r
+};\r
+\r
+// WARNING: must match XMLDocument::_errorNames[]\r
+enum XMLError {\r
+    XML_SUCCESS = 0,\r
+    XML_NO_ERROR = 0,\r
+    XML_NO_ATTRIBUTE,\r
+    XML_WRONG_ATTRIBUTE_TYPE,\r
+    XML_ERROR_FILE_NOT_FOUND,\r
+    XML_ERROR_FILE_COULD_NOT_BE_OPENED,\r
+    XML_ERROR_FILE_READ_ERROR,\r
+    XML_ERROR_ELEMENT_MISMATCH,\r
+    XML_ERROR_PARSING_ELEMENT,\r
+    XML_ERROR_PARSING_ATTRIBUTE,\r
+    XML_ERROR_IDENTIFYING_TAG,\r
+    XML_ERROR_PARSING_TEXT,\r
+    XML_ERROR_PARSING_CDATA,\r
+    XML_ERROR_PARSING_COMMENT,\r
+    XML_ERROR_PARSING_DECLARATION,\r
+    XML_ERROR_PARSING_UNKNOWN,\r
+    XML_ERROR_EMPTY_DOCUMENT,\r
+    XML_ERROR_MISMATCHED_ELEMENT,\r
+    XML_ERROR_PARSING,\r
+    XML_CAN_NOT_CONVERT_TEXT,\r
+    XML_NO_TEXT_NODE,\r
+\r
+       XML_ERROR_COUNT\r
+};\r
+\r
+\r
+/*\r
+       Utility functionality.\r
+*/\r
+class XMLUtil\r
+{\r
+public:\r
+    static const char* SkipWhiteSpace( const char* p ) {\r
+        TIXMLASSERT( p );\r
+        while( IsWhiteSpace(*p) ) {\r
+            ++p;\r
+        }\r
+        TIXMLASSERT( p );\r
+        return p;\r
+    }\r
+    static char* SkipWhiteSpace( char* p )                             {\r
+        return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p) ) );\r
+    }\r
+\r
+    // Anything in the high order range of UTF-8 is assumed to not be whitespace. This isn't\r
+    // correct, but simple, and usually works.\r
+    static bool IsWhiteSpace( char p )                                 {\r
+        return !IsUTF8Continuation(p) && isspace( static_cast<unsigned char>(p) );\r
+    }\r
+    \r
+    inline static bool IsNameStartChar( unsigned char ch ) {\r
+        if ( ch >= 128 ) {\r
+            // This is a heuristic guess in attempt to not implement Unicode-aware isalpha()\r
+            return true;\r
+        }\r
+        if ( isalpha( ch ) ) {\r
+            return true;\r
+        }\r
+        return ch == ':' || ch == '_';\r
+    }\r
+    \r
+    inline static bool IsNameChar( unsigned char ch ) {\r
+        return IsNameStartChar( ch )\r
+               || isdigit( ch )\r
+               || ch == '.'\r
+               || ch == '-';\r
+    }\r
+\r
+    inline static bool StringEqual( const char* p, const char* q, int nChar=INT_MAX )  {\r
+        if ( p == q ) {\r
+            return true;\r
+        }\r
+        int n = 0;\r
+        while( *p && *q && *p == *q && n<nChar ) {\r
+            ++p;\r
+            ++q;\r
+            ++n;\r
+        }\r
+        if ( (n == nChar) || ( *p == 0 && *q == 0 ) ) {\r
+            return true;\r
+        }\r
+        return false;\r
+    }\r
+    \r
+    inline static bool IsUTF8Continuation( const char p ) {\r
+        return ( p & 0x80 ) != 0;\r
+    }\r
+\r
+    static const char* ReadBOM( const char* p, bool* hasBOM );\r
+    // p is the starting location,\r
+    // the UTF-8 value of the entity will be placed in value, and length filled in.\r
+    static const char* GetCharacterRef( const char* p, char* value, int* length );\r
+    static void ConvertUTF32ToUTF8( unsigned long input, char* output, int* length );\r
+\r
+    // converts primitive types to strings\r
+    static void ToStr( int v, char* buffer, int bufferSize );\r
+    static void ToStr( unsigned v, char* buffer, int bufferSize );\r
+    static void ToStr( bool v, char* buffer, int bufferSize );\r
+    static void ToStr( float v, char* buffer, int bufferSize );\r
+    static void ToStr( double v, char* buffer, int bufferSize );\r
+\r
+    // converts strings to primitive types\r
+    static bool        ToInt( const char* str, int* value );\r
+    static bool ToUnsigned( const char* str, unsigned* value );\r
+    static bool        ToBool( const char* str, bool* value );\r
+    static bool        ToFloat( const char* str, float* value );\r
+    static bool ToDouble( const char* str, double* value );\r
+};\r
+\r
+\r
+/** XMLNode is a base class for every object that is in the\r
+       XML Document Object Model (DOM), except XMLAttributes.\r
+       Nodes have siblings, a parent, and children which can\r
+       be navigated. A node is always in a XMLDocument.\r
+       The type of a XMLNode can be queried, and it can\r
+       be cast to its more defined type.\r
+\r
+       A XMLDocument allocates memory for all its Nodes.\r
+       When the XMLDocument gets deleted, all its Nodes\r
+       will also be deleted.\r
+\r
+       @verbatim\r
+       A Document can contain: Element (container or leaf)\r
+                                                       Comment (leaf)\r
+                                                       Unknown (leaf)\r
+                                                       Declaration( leaf )\r
+\r
+       An Element can contain: Element (container or leaf)\r
+                                                       Text    (leaf)\r
+                                                       Attributes (not on tree)\r
+                                                       Comment (leaf)\r
+                                                       Unknown (leaf)\r
+\r
+       @endverbatim\r
+*/\r
+class TINYXML2_LIB XMLNode\r
+{\r
+    friend class XMLDocument;\r
+    friend class XMLElement;\r
+public:\r
+\r
+    /// Get the XMLDocument that owns this XMLNode.\r
+    const XMLDocument* GetDocument() const     {\r
+        return _document;\r
+    }\r
+    /// Get the XMLDocument that owns this XMLNode.\r
+    XMLDocument* GetDocument()                         {\r
+        return _document;\r
+    }\r
+\r
+    /// Safely cast to an Element, or null.\r
+    virtual XMLElement*                ToElement()             {\r
+        return 0;\r
+    }\r
+    /// Safely cast to Text, or null.\r
+    virtual XMLText*           ToText()                {\r
+        return 0;\r
+    }\r
+    /// Safely cast to a Comment, or null.\r
+    virtual XMLComment*                ToComment()             {\r
+        return 0;\r
+    }\r
+    /// Safely cast to a Document, or null.\r
+    virtual XMLDocument*       ToDocument()    {\r
+        return 0;\r
+    }\r
+    /// Safely cast to a Declaration, or null.\r
+    virtual XMLDeclaration*    ToDeclaration() {\r
+        return 0;\r
+    }\r
+    /// Safely cast to an Unknown, or null.\r
+    virtual XMLUnknown*                ToUnknown()             {\r
+        return 0;\r
+    }\r
+\r
+    virtual const XMLElement*          ToElement() const               {\r
+        return 0;\r
+    }\r
+    virtual const XMLText*                     ToText() const                  {\r
+        return 0;\r
+    }\r
+    virtual const XMLComment*          ToComment() const               {\r
+        return 0;\r
+    }\r
+    virtual const XMLDocument*         ToDocument() const              {\r
+        return 0;\r
+    }\r
+    virtual const XMLDeclaration*      ToDeclaration() const   {\r
+        return 0;\r
+    }\r
+    virtual const XMLUnknown*          ToUnknown() const               {\r
+        return 0;\r
+    }\r
+\r
+    /** The meaning of 'value' changes for the specific type.\r
+       @verbatim\r
+       Document:       empty\r
+       Element:        name of the element\r
+       Comment:        the comment text\r
+       Unknown:        the tag contents\r
+       Text:           the text string\r
+       @endverbatim\r
+    */\r
+    const char* Value() const;\r
+\r
+    /** Set the Value of an XML node.\r
+       @sa Value()\r
+    */\r
+    void SetValue( const char* val, bool staticMem=false );\r
+\r
+    /// Get the parent of this node on the DOM.\r
+    const XMLNode*     Parent() const                  {\r
+        return _parent;\r
+    }\r
+\r
+    XMLNode* Parent()                                          {\r
+        return _parent;\r
+    }\r
+\r
+    /// Returns true if this node has no children.\r
+    bool NoChildren() const                                    {\r
+        return !_firstChild;\r
+    }\r
+\r
+    /// Get the first child node, or null if none exists.\r
+    const XMLNode*  FirstChild() const         {\r
+        return _firstChild;\r
+    }\r
+\r
+    XMLNode*           FirstChild()                    {\r
+        return _firstChild;\r
+    }\r
+\r
+    /** Get the first child element, or optionally the first child\r
+        element with the specified name.\r
+    */\r
+    const XMLElement* FirstChildElement( const char* value=0 ) const;\r
+\r
+    XMLElement* FirstChildElement( const char* value=0 )       {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->FirstChildElement( value ));\r
+    }\r
+\r
+    /// Get the last child node, or null if none exists.\r
+    const XMLNode*     LastChild() const                                               {\r
+        return _lastChild;\r
+    }\r
+\r
+    XMLNode*           LastChild()                                                             {\r
+        return const_cast<XMLNode*>(const_cast<const XMLNode*>(this)->LastChild() );\r
+    }\r
+\r
+    /** Get the last child element or optionally the last child\r
+        element with the specified name.\r
+    */\r
+    const XMLElement* LastChildElement( const char* value=0 ) const;\r
+\r
+    XMLElement* LastChildElement( const char* value=0 )        {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->LastChildElement(value) );\r
+    }\r
+\r
+    /// Get the previous (left) sibling node of this node.\r
+    const XMLNode*     PreviousSibling() const                                 {\r
+        return _prev;\r
+    }\r
+\r
+    XMLNode*   PreviousSibling()                                                       {\r
+        return _prev;\r
+    }\r
+\r
+    /// Get the previous (left) sibling element of this node, with an optionally supplied name.\r
+    const XMLElement*  PreviousSiblingElement( const char* value=0 ) const ;\r
+\r
+    XMLElement*        PreviousSiblingElement( const char* value=0 ) {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->PreviousSiblingElement( value ) );\r
+    }\r
+\r
+    /// Get the next (right) sibling node of this node.\r
+    const XMLNode*     NextSibling() const                                             {\r
+        return _next;\r
+    }\r
+\r
+    XMLNode*   NextSibling()                                                           {\r
+        return _next;\r
+    }\r
+\r
+    /// Get the next (right) sibling element of this node, with an optionally supplied name.\r
+    const XMLElement*  NextSiblingElement( const char* value=0 ) const;\r
+\r
+    XMLElement*        NextSiblingElement( const char* value=0 )       {\r
+        return const_cast<XMLElement*>(const_cast<const XMLNode*>(this)->NextSiblingElement( value ) );\r
+    }\r
+\r
+    /**\r
+       Add a child node as the last (right) child.\r
+               If the child node is already part of the document,\r
+               it is moved from its old location to the new location.\r
+               Returns the addThis argument or 0 if the node does not\r
+               belong to the same document.\r
+    */\r
+    XMLNode* InsertEndChild( XMLNode* addThis );\r
+\r
+    XMLNode* LinkEndChild( XMLNode* addThis )  {\r
+        return InsertEndChild( addThis );\r
+    }\r
+    /**\r
+       Add a child node as the first (left) child.\r
+               If the child node is already part of the document,\r
+               it is moved from its old location to the new location.\r
+               Returns the addThis argument or 0 if the node does not\r
+               belong to the same document.\r
+    */\r
+    XMLNode* InsertFirstChild( XMLNode* addThis );\r
+    /**\r
+       Add a node after the specified child node.\r
+               If the child node is already part of the document,\r
+               it is moved from its old location to the new location.\r
+               Returns the addThis argument or 0 if the afterThis node\r
+               is not a child of this node, or if the node does not\r
+               belong to the same document.\r
+    */\r
+    XMLNode* InsertAfterChild( XMLNode* afterThis, XMLNode* addThis );\r
+\r
+    /**\r
+       Delete all the children of this node.\r
+    */\r
+    void DeleteChildren();\r
+\r
+    /**\r
+       Delete a child of this node.\r
+    */\r
+    void DeleteChild( XMLNode* node );\r
+\r
+    /**\r
+       Make a copy of this node, but not its children.\r
+       You may pass in a Document pointer that will be\r
+       the owner of the new Node. If the 'document' is\r
+       null, then the node returned will be allocated\r
+       from the current Document. (this->GetDocument())\r
+\r
+       Note: if called on a XMLDocument, this will return null.\r
+    */\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const = 0;\r
+\r
+    /**\r
+       Test if 2 nodes are the same, but don't test children.\r
+       The 2 nodes do not need to be in the same Document.\r
+\r
+       Note: if called on a XMLDocument, this will return false.\r
+    */\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const = 0;\r
+\r
+    /** Accept a hierarchical visit of the nodes in the TinyXML-2 DOM. Every node in the\r
+       XML tree will be conditionally visited and the host will be called back\r
+       via the XMLVisitor interface.\r
+\r
+       This is essentially a SAX interface for TinyXML-2. (Note however it doesn't re-parse\r
+       the XML for the callbacks, so the performance of TinyXML-2 is unchanged by using this\r
+       interface versus any other.)\r
+\r
+       The interface has been based on ideas from:\r
+\r
+       - http://www.saxproject.org/\r
+       - http://c2.com/cgi/wiki?HierarchicalVisitorPattern\r
+\r
+       Which are both good references for "visiting".\r
+\r
+       An example of using Accept():\r
+       @verbatim\r
+       XMLPrinter printer;\r
+       tinyxmlDoc.Accept( &printer );\r
+       const char* xmlcstr = printer.CStr();\r
+       @endverbatim\r
+    */\r
+    virtual bool Accept( XMLVisitor* visitor ) const = 0;\r
+\r
+    // internal\r
+    virtual char* ParseDeep( char*, StrPair* );\r
+\r
+protected:\r
+    XMLNode( XMLDocument* );\r
+    virtual ~XMLNode();\r
+\r
+    XMLDocument*       _document;\r
+    XMLNode*           _parent;\r
+    mutable StrPair    _value;\r
+\r
+    XMLNode*           _firstChild;\r
+    XMLNode*           _lastChild;\r
+\r
+    XMLNode*           _prev;\r
+    XMLNode*           _next;\r
+\r
+private:\r
+    MemPool*           _memPool;\r
+    void Unlink( XMLNode* child );\r
+    static void DeleteNode( XMLNode* node );\r
+    void InsertChildPreamble( XMLNode* insertThis ) const;\r
+\r
+    XMLNode( const XMLNode& ); // not supported\r
+    XMLNode& operator=( const XMLNode& );      // not supported\r
+};\r
+\r
+\r
+/** XML text.\r
+\r
+       Note that a text node can have child element nodes, for example:\r
+       @verbatim\r
+       <root>This is <b>bold</b></root>\r
+       @endverbatim\r
+\r
+       A text node can have 2 ways to output the next. "normal" output\r
+       and CDATA. It will default to the mode it was parsed from the XML file and\r
+       you generally want to leave it alone, but you can change the output mode with\r
+       SetCData() and query it with CData().\r
+*/\r
+class TINYXML2_LIB XMLText : public XMLNode\r
+{\r
+    friend class XMLBase;\r
+    friend class XMLDocument;\r
+public:\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    virtual XMLText* ToText()                  {\r
+        return this;\r
+    }\r
+    virtual const XMLText* ToText() const      {\r
+        return this;\r
+    }\r
+\r
+    /// Declare whether this should be CDATA or standard text.\r
+    void SetCData( bool isCData )                      {\r
+        _isCData = isCData;\r
+    }\r
+    /// Returns true if this is a CDATA text element.\r
+    bool CData() const                                         {\r
+        return _isCData;\r
+    }\r
+\r
+    char* ParseDeep( char*, StrPair* endTag );\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    XMLText( XMLDocument* doc )        : XMLNode( doc ), _isCData( false )     {}\r
+    virtual ~XMLText()                                                                                         {}\r
+\r
+private:\r
+    bool _isCData;\r
+\r
+    XMLText( const XMLText& ); // not supported\r
+    XMLText& operator=( const XMLText& );      // not supported\r
+};\r
+\r
+\r
+/** An XML Comment. */\r
+class TINYXML2_LIB XMLComment : public XMLNode\r
+{\r
+    friend class XMLDocument;\r
+public:\r
+    virtual XMLComment*        ToComment()                                     {\r
+        return this;\r
+    }\r
+    virtual const XMLComment* ToComment() const                {\r
+        return this;\r
+    }\r
+\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    char* ParseDeep( char*, StrPair* endTag );\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    XMLComment( XMLDocument* doc );\r
+    virtual ~XMLComment();\r
+\r
+private:\r
+    XMLComment( const XMLComment& );   // not supported\r
+    XMLComment& operator=( const XMLComment& );        // not supported\r
+};\r
+\r
+\r
+/** In correct XML the declaration is the first entry in the file.\r
+       @verbatim\r
+               <?xml version="1.0" standalone="yes"?>\r
+       @endverbatim\r
+\r
+       TinyXML-2 will happily read or write files without a declaration,\r
+       however.\r
+\r
+       The text of the declaration isn't interpreted. It is parsed\r
+       and written as a string.\r
+*/\r
+class TINYXML2_LIB XMLDeclaration : public XMLNode\r
+{\r
+    friend class XMLDocument;\r
+public:\r
+    virtual XMLDeclaration*    ToDeclaration()                                 {\r
+        return this;\r
+    }\r
+    virtual const XMLDeclaration* ToDeclaration() const                {\r
+        return this;\r
+    }\r
+\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    char* ParseDeep( char*, StrPair* endTag );\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    XMLDeclaration( XMLDocument* doc );\r
+    virtual ~XMLDeclaration();\r
+\r
+private:\r
+    XMLDeclaration( const XMLDeclaration& );   // not supported\r
+    XMLDeclaration& operator=( const XMLDeclaration& );        // not supported\r
+};\r
+\r
+\r
+/** Any tag that TinyXML-2 doesn't recognize is saved as an\r
+       unknown. It is a tag of text, but should not be modified.\r
+       It will be written back to the XML, unchanged, when the file\r
+       is saved.\r
+\r
+       DTD tags get thrown into XMLUnknowns.\r
+*/\r
+class TINYXML2_LIB XMLUnknown : public XMLNode\r
+{\r
+    friend class XMLDocument;\r
+public:\r
+    virtual XMLUnknown*        ToUnknown()                                     {\r
+        return this;\r
+    }\r
+    virtual const XMLUnknown* ToUnknown() const                {\r
+        return this;\r
+    }\r
+\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    char* ParseDeep( char*, StrPair* endTag );\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+protected:\r
+    XMLUnknown( XMLDocument* doc );\r
+    virtual ~XMLUnknown();\r
+\r
+private:\r
+    XMLUnknown( const XMLUnknown& );   // not supported\r
+    XMLUnknown& operator=( const XMLUnknown& );        // not supported\r
+};\r
+\r
+\r
+\r
+/** An attribute is a name-value pair. Elements have an arbitrary\r
+       number of attributes, each with a unique name.\r
+\r
+       @note The attributes are not XMLNodes. You may only query the\r
+       Next() attribute in a list.\r
+*/\r
+class TINYXML2_LIB XMLAttribute\r
+{\r
+    friend class XMLElement;\r
+public:\r
+    /// The name of the attribute.\r
+    const char* Name() const;\r
+\r
+    /// The value of the attribute.\r
+    const char* Value() const;\r
+\r
+    /// The next attribute in the list.\r
+    const XMLAttribute* Next() const {\r
+        return _next;\r
+    }\r
+\r
+    /** IntValue interprets the attribute as an integer, and returns the value.\r
+        If the value isn't an integer, 0 will be returned. There is no error checking;\r
+       use QueryIntValue() if you need error checking.\r
+    */\r
+    int                 IntValue() const                               {\r
+        int i=0;\r
+        QueryIntValue( &i );\r
+        return i;\r
+    }\r
+    /// Query as an unsigned integer. See IntValue()\r
+    unsigned UnsignedValue() const                     {\r
+        unsigned i=0;\r
+        QueryUnsignedValue( &i );\r
+        return i;\r
+    }\r
+    /// Query as a boolean. See IntValue()\r
+    bool        BoolValue() const                              {\r
+        bool b=false;\r
+        QueryBoolValue( &b );\r
+        return b;\r
+    }\r
+    /// Query as a double. See IntValue()\r
+    double      DoubleValue() const                    {\r
+        double d=0;\r
+        QueryDoubleValue( &d );\r
+        return d;\r
+    }\r
+    /// Query as a float. See IntValue()\r
+    float       FloatValue() const                             {\r
+        float f=0;\r
+        QueryFloatValue( &f );\r
+        return f;\r
+    }\r
+\r
+    /** QueryIntValue interprets the attribute as an integer, and returns the value\r
+       in the provided parameter. The function will return XML_NO_ERROR on success,\r
+       and XML_WRONG_ATTRIBUTE_TYPE if the conversion is not successful.\r
+    */\r
+    XMLError QueryIntValue( int* value ) const;\r
+    /// See QueryIntValue\r
+    XMLError QueryUnsignedValue( unsigned int* value ) const;\r
+    /// See QueryIntValue\r
+    XMLError QueryBoolValue( bool* value ) const;\r
+    /// See QueryIntValue\r
+    XMLError QueryDoubleValue( double* value ) const;\r
+    /// See QueryIntValue\r
+    XMLError QueryFloatValue( float* value ) const;\r
+\r
+    /// Set the attribute to a string value.\r
+    void SetAttribute( const char* value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( int value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( unsigned value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( bool value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( double value );\r
+    /// Set the attribute to value.\r
+    void SetAttribute( float value );\r
+\r
+private:\r
+    enum { BUF_SIZE = 200 };\r
+\r
+    XMLAttribute() : _next( 0 ), _memPool( 0 ) {}\r
+    virtual ~XMLAttribute()    {}\r
+\r
+    XMLAttribute( const XMLAttribute& );       // not supported\r
+    void operator=( const XMLAttribute& );     // not supported\r
+    void SetName( const char* name );\r
+\r
+    char* ParseDeep( char* p, bool processEntities );\r
+\r
+    mutable StrPair _name;\r
+    mutable StrPair _value;\r
+    XMLAttribute*   _next;\r
+    MemPool*        _memPool;\r
+};\r
+\r
+\r
+/** The element is a container class. It has a value, the element name,\r
+       and can contain other elements, text, comments, and unknowns.\r
+       Elements also contain an arbitrary number of attributes.\r
+*/\r
+class TINYXML2_LIB XMLElement : public XMLNode\r
+{\r
+    friend class XMLBase;\r
+    friend class XMLDocument;\r
+public:\r
+    /// Get the name of an element (which is the Value() of the node.)\r
+    const char* Name() const           {\r
+        return Value();\r
+    }\r
+    /// Set the name of the element.\r
+    void SetName( const char* str, bool staticMem=false )      {\r
+        SetValue( str, staticMem );\r
+    }\r
+\r
+    virtual XMLElement* ToElement()                            {\r
+        return this;\r
+    }\r
+    virtual const XMLElement* ToElement() const {\r
+        return this;\r
+    }\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    /** Given an attribute name, Attribute() returns the value\r
+       for the attribute of that name, or null if none\r
+       exists. For example:\r
+\r
+       @verbatim\r
+       const char* value = ele->Attribute( "foo" );\r
+       @endverbatim\r
+\r
+       The 'value' parameter is normally null. However, if specified,\r
+       the attribute will only be returned if the 'name' and 'value'\r
+       match. This allow you to write code:\r
+\r
+       @verbatim\r
+       if ( ele->Attribute( "foo", "bar" ) ) callFooIsBar();\r
+       @endverbatim\r
+\r
+       rather than:\r
+       @verbatim\r
+       if ( ele->Attribute( "foo" ) ) {\r
+               if ( strcmp( ele->Attribute( "foo" ), "bar" ) == 0 ) callFooIsBar();\r
+       }\r
+       @endverbatim\r
+    */\r
+    const char* Attribute( const char* name, const char* value=0 ) const;\r
+\r
+    /** Given an attribute name, IntAttribute() returns the value\r
+       of the attribute interpreted as an integer. 0 will be\r
+       returned if there is an error. For a method with error\r
+       checking, see QueryIntAttribute()\r
+    */\r
+    int                 IntAttribute( const char* name ) const         {\r
+        int i=0;\r
+        QueryIntAttribute( name, &i );\r
+        return i;\r
+    }\r
+    /// See IntAttribute()\r
+    unsigned UnsignedAttribute( const char* name ) const {\r
+        unsigned i=0;\r
+        QueryUnsignedAttribute( name, &i );\r
+        return i;\r
+    }\r
+    /// See IntAttribute()\r
+    bool        BoolAttribute( const char* name ) const        {\r
+        bool b=false;\r
+        QueryBoolAttribute( name, &b );\r
+        return b;\r
+    }\r
+    /// See IntAttribute()\r
+    double      DoubleAttribute( const char* name ) const      {\r
+        double d=0;\r
+        QueryDoubleAttribute( name, &d );\r
+        return d;\r
+    }\r
+    /// See IntAttribute()\r
+    float       FloatAttribute( const char* name ) const       {\r
+        float f=0;\r
+        QueryFloatAttribute( name, &f );\r
+        return f;\r
+    }\r
+\r
+    /** Given an attribute name, QueryIntAttribute() returns\r
+       XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion\r
+       can't be performed, or XML_NO_ATTRIBUTE if the attribute\r
+       doesn't exist. If successful, the result of the conversion\r
+       will be written to 'value'. If not successful, nothing will\r
+       be written to 'value'. This allows you to provide default\r
+       value:\r
+\r
+       @verbatim\r
+       int value = 10;\r
+       QueryIntAttribute( "foo", &value );             // if "foo" isn't found, value will still be 10\r
+       @endverbatim\r
+    */\r
+    XMLError QueryIntAttribute( const char* name, int* value ) const                           {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryIntValue( value );\r
+    }\r
+    /// See QueryIntAttribute()\r
+    XMLError QueryUnsignedAttribute( const char* name, unsigned int* value ) const     {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryUnsignedValue( value );\r
+    }\r
+    /// See QueryIntAttribute()\r
+    XMLError QueryBoolAttribute( const char* name, bool* value ) const                         {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryBoolValue( value );\r
+    }\r
+    /// See QueryIntAttribute()\r
+    XMLError QueryDoubleAttribute( const char* name, double* value ) const                     {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryDoubleValue( value );\r
+    }\r
+    /// See QueryIntAttribute()\r
+    XMLError QueryFloatAttribute( const char* name, float* value ) const                       {\r
+        const XMLAttribute* a = FindAttribute( name );\r
+        if ( !a ) {\r
+            return XML_NO_ATTRIBUTE;\r
+        }\r
+        return a->QueryFloatValue( value );\r
+    }\r
+\r
+       \r
+    /** Given an attribute name, QueryAttribute() returns\r
+       XML_NO_ERROR, XML_WRONG_ATTRIBUTE_TYPE if the conversion\r
+       can't be performed, or XML_NO_ATTRIBUTE if the attribute\r
+       doesn't exist. It is overloaded for the primitive types,\r
+               and is a generally more convenient replacement of\r
+               QueryIntAttribute() and related functions.\r
+               \r
+               If successful, the result of the conversion\r
+       will be written to 'value'. If not successful, nothing will\r
+       be written to 'value'. This allows you to provide default\r
+       value:\r
+\r
+       @verbatim\r
+       int value = 10;\r
+       QueryAttribute( "foo", &value );                // if "foo" isn't found, value will still be 10\r
+       @endverbatim\r
+    */\r
+       int QueryAttribute( const char* name, int* value ) const {\r
+               return QueryIntAttribute( name, value );\r
+       }\r
+\r
+       int QueryAttribute( const char* name, unsigned int* value ) const {\r
+               return QueryUnsignedAttribute( name, value );\r
+       }\r
+\r
+       int QueryAttribute( const char* name, bool* value ) const {\r
+               return QueryBoolAttribute( name, value );\r
+       }\r
+\r
+       int QueryAttribute( const char* name, double* value ) const {\r
+               return QueryDoubleAttribute( name, value );\r
+       }\r
+\r
+       int QueryAttribute( const char* name, float* value ) const {\r
+               return QueryFloatAttribute( name, value );\r
+       }\r
+\r
+       /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, const char* value )   {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, int value )                   {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, unsigned value )              {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, bool value )                  {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, double value )                {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+    /// Sets the named attribute to value.\r
+    void SetAttribute( const char* name, float value )         {\r
+        XMLAttribute* a = FindOrCreateAttribute( name );\r
+        a->SetAttribute( value );\r
+    }\r
+\r
+    /**\r
+       Delete an attribute.\r
+    */\r
+    void DeleteAttribute( const char* name );\r
+\r
+    /// Return the first attribute in the list.\r
+    const XMLAttribute* FirstAttribute() const {\r
+        return _rootAttribute;\r
+    }\r
+    /// Query a specific attribute in the list.\r
+    const XMLAttribute* FindAttribute( const char* name ) const;\r
+\r
+    /** Convenience function for easy access to the text inside an element. Although easy\r
+       and concise, GetText() is limited compared to getting the XMLText child\r
+       and accessing it directly.\r
+\r
+       If the first child of 'this' is a XMLText, the GetText()\r
+       returns the character string of the Text node, else null is returned.\r
+\r
+       This is a convenient method for getting the text of simple contained text:\r
+       @verbatim\r
+       <foo>This is text</foo>\r
+               const char* str = fooElement->GetText();\r
+       @endverbatim\r
+\r
+       'str' will be a pointer to "This is text".\r
+\r
+       Note that this function can be misleading. If the element foo was created from\r
+       this XML:\r
+       @verbatim\r
+               <foo><b>This is text</b></foo>\r
+       @endverbatim\r
+\r
+       then the value of str would be null. The first child node isn't a text node, it is\r
+       another element. From this XML:\r
+       @verbatim\r
+               <foo>This is <b>text</b></foo>\r
+       @endverbatim\r
+       GetText() will return "This is ".\r
+    */\r
+    const char* GetText() const;\r
+\r
+    /** Convenience function for easy access to the text inside an element. Although easy\r
+       and concise, SetText() is limited compared to creating an XMLText child\r
+       and mutating it directly.\r
+\r
+       If the first child of 'this' is a XMLText, SetText() sets its value to\r
+               the given string, otherwise it will create a first child that is an XMLText.\r
+\r
+       This is a convenient method for setting the text of simple contained text:\r
+       @verbatim\r
+       <foo>This is text</foo>\r
+               fooElement->SetText( "Hullaballoo!" );\r
+       <foo>Hullaballoo!</foo>\r
+               @endverbatim\r
+\r
+       Note that this function can be misleading. If the element foo was created from\r
+       this XML:\r
+       @verbatim\r
+               <foo><b>This is text</b></foo>\r
+       @endverbatim\r
+\r
+       then it will not change "This is text", but rather prefix it with a text element:\r
+       @verbatim\r
+               <foo>Hullaballoo!<b>This is text</b></foo>\r
+       @endverbatim\r
+               \r
+               For this XML:\r
+       @verbatim\r
+               <foo />\r
+       @endverbatim\r
+       SetText() will generate\r
+       @verbatim\r
+               <foo>Hullaballoo!</foo>\r
+       @endverbatim\r
+    */\r
+       void SetText( const char* inText );\r
+    /// Convenience method for setting text inside and element. See SetText() for important limitations.\r
+    void SetText( int value );\r
+    /// Convenience method for setting text inside and element. See SetText() for important limitations.\r
+    void SetText( unsigned value );  \r
+    /// Convenience method for setting text inside and element. See SetText() for important limitations.\r
+    void SetText( bool value );  \r
+    /// Convenience method for setting text inside and element. See SetText() for important limitations.\r
+    void SetText( double value );  \r
+    /// Convenience method for setting text inside and element. See SetText() for important limitations.\r
+    void SetText( float value );  \r
+\r
+    /**\r
+       Convenience method to query the value of a child text node. This is probably best\r
+       shown by example. Given you have a document is this form:\r
+       @verbatim\r
+               <point>\r
+                       <x>1</x>\r
+                       <y>1.4</y>\r
+               </point>\r
+       @endverbatim\r
+\r
+       The QueryIntText() and similar functions provide a safe and easier way to get to the\r
+       "value" of x and y.\r
+\r
+       @verbatim\r
+               int x = 0;\r
+               float y = 0;    // types of x and y are contrived for example\r
+               const XMLElement* xElement = pointElement->FirstChildElement( "x" );\r
+               const XMLElement* yElement = pointElement->FirstChildElement( "y" );\r
+               xElement->QueryIntText( &x );\r
+               yElement->QueryFloatText( &y );\r
+       @endverbatim\r
+\r
+       @returns XML_SUCCESS (0) on success, XML_CAN_NOT_CONVERT_TEXT if the text cannot be converted\r
+                        to the requested type, and XML_NO_TEXT_NODE if there is no child text to query.\r
+\r
+    */\r
+    XMLError QueryIntText( int* ival ) const;\r
+    /// See QueryIntText()\r
+    XMLError QueryUnsignedText( unsigned* uval ) const;\r
+    /// See QueryIntText()\r
+    XMLError QueryBoolText( bool* bval ) const;\r
+    /// See QueryIntText()\r
+    XMLError QueryDoubleText( double* dval ) const;\r
+    /// See QueryIntText()\r
+    XMLError QueryFloatText( float* fval ) const;\r
+\r
+    // internal:\r
+    enum {\r
+        OPEN,          // <foo>\r
+        CLOSED,                // <foo/>\r
+        CLOSING                // </foo>\r
+    };\r
+    int ClosingType() const {\r
+        return _closingType;\r
+    }\r
+    char* ParseDeep( char* p, StrPair* endTag );\r
+    virtual XMLNode* ShallowClone( XMLDocument* document ) const;\r
+    virtual bool ShallowEqual( const XMLNode* compare ) const;\r
+\r
+private:\r
+    XMLElement( XMLDocument* doc );\r
+    virtual ~XMLElement();\r
+    XMLElement( const XMLElement& );   // not supported\r
+    void operator=( const XMLElement& );       // not supported\r
+\r
+    XMLAttribute* FindAttribute( const char* name ) {\r
+        return const_cast<XMLAttribute*>(const_cast<const XMLElement*>(this)->FindAttribute( name ));\r
+    }\r
+    XMLAttribute* FindOrCreateAttribute( const char* name );\r
+    //void LinkAttribute( XMLAttribute* attrib );\r
+    char* ParseAttributes( char* p );\r
+    static void DeleteAttribute( XMLAttribute* attribute );\r
+\r
+    enum { BUF_SIZE = 200 };\r
+    int _closingType;\r
+    // The attribute list is ordered; there is no 'lastAttribute'\r
+    // because the list needs to be scanned for dupes before adding\r
+    // a new attribute.\r
+    XMLAttribute* _rootAttribute;\r
+};\r
+\r
+\r
+enum Whitespace {\r
+    PRESERVE_WHITESPACE,\r
+    COLLAPSE_WHITESPACE\r
+};\r
+\r
+\r
+/** A Document binds together all the functionality.\r
+       It can be saved, loaded, and printed to the screen.\r
+       All Nodes are connected and allocated to a Document.\r
+       If the Document is deleted, all its Nodes are also deleted.\r
+*/\r
+class TINYXML2_LIB XMLDocument : public XMLNode\r
+{\r
+    friend class XMLElement;\r
+public:\r
+    /// constructor\r
+    XMLDocument( bool processEntities = true, Whitespace = PRESERVE_WHITESPACE );\r
+    ~XMLDocument();\r
+\r
+    virtual XMLDocument* ToDocument()                          {\r
+        return this;\r
+    }\r
+    virtual const XMLDocument* ToDocument() const      {\r
+        return this;\r
+    }\r
+\r
+    /**\r
+       Parse an XML file from a character string.\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+\r
+       You may optionally pass in the 'nBytes', which is\r
+       the number of bytes which will be parsed. If not\r
+       specified, TinyXML-2 will assume 'xml' points to a\r
+       null terminated string.\r
+    */\r
+    XMLError Parse( const char* xml, size_t nBytes=(size_t)(-1) );\r
+\r
+    /**\r
+       Load an XML file from disk.\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+    */\r
+    XMLError LoadFile( const char* filename );\r
+\r
+    /**\r
+       Load an XML file from disk. You are responsible\r
+       for providing and closing the FILE*. \r
+     \r
+        NOTE: The file should be opened as binary ("rb")\r
+        not text in order for TinyXML-2 to correctly\r
+        do newline normalization.\r
+\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+    */\r
+    XMLError LoadFile( FILE* );\r
+\r
+    /**\r
+       Save the XML file to disk.\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+    */\r
+    XMLError SaveFile( const char* filename, bool compact = false );\r
+\r
+    /**\r
+       Save the XML file to disk. You are responsible\r
+       for providing and closing the FILE*.\r
+\r
+       Returns XML_NO_ERROR (0) on success, or\r
+       an errorID.\r
+    */\r
+    XMLError SaveFile( FILE* fp, bool compact = false );\r
+\r
+    bool ProcessEntities() const               {\r
+        return _processEntities;\r
+    }\r
+    Whitespace WhitespaceMode() const  {\r
+        return _whitespace;\r
+    }\r
+\r
+    /**\r
+       Returns true if this document has a leading Byte Order Mark of UTF8.\r
+    */\r
+    bool HasBOM() const {\r
+        return _writeBOM;\r
+    }\r
+    /** Sets whether to write the BOM when writing the file.\r
+    */\r
+    void SetBOM( bool useBOM ) {\r
+        _writeBOM = useBOM;\r
+    }\r
+\r
+    /** Return the root element of DOM. Equivalent to FirstChildElement().\r
+        To get the first node, use FirstChild().\r
+    */\r
+    XMLElement* RootElement()                          {\r
+        return FirstChildElement();\r
+    }\r
+    const XMLElement* RootElement() const      {\r
+        return FirstChildElement();\r
+    }\r
+\r
+    /** Print the Document. If the Printer is not provided, it will\r
+        print to stdout. If you provide Printer, this can print to a file:\r
+       @verbatim\r
+       XMLPrinter printer( fp );\r
+       doc.Print( &printer );\r
+       @endverbatim\r
+\r
+       Or you can use a printer to print to memory:\r
+       @verbatim\r
+       XMLPrinter printer;\r
+       doc.Print( &printer );\r
+       // printer.CStr() has a const char* to the XML\r
+       @endverbatim\r
+    */\r
+    void Print( XMLPrinter* streamer=0 ) const;\r
+    virtual bool Accept( XMLVisitor* visitor ) const;\r
+\r
+    /**\r
+       Create a new Element associated with\r
+       this Document. The memory for the Element\r
+       is managed by the Document.\r
+    */\r
+    XMLElement* NewElement( const char* name );\r
+    /**\r
+       Create a new Comment associated with\r
+       this Document. The memory for the Comment\r
+       is managed by the Document.\r
+    */\r
+    XMLComment* NewComment( const char* comment );\r
+    /**\r
+       Create a new Text associated with\r
+       this Document. The memory for the Text\r
+       is managed by the Document.\r
+    */\r
+    XMLText* NewText( const char* text );\r
+    /**\r
+       Create a new Declaration associated with\r
+       this Document. The memory for the object\r
+       is managed by the Document.\r
+\r
+       If the 'text' param is null, the standard\r
+       declaration is used.:\r
+       @verbatim\r
+               <?xml version="1.0" encoding="UTF-8"?>\r
+       @endverbatim\r
+    */\r
+    XMLDeclaration* NewDeclaration( const char* text=0 );\r
+    /**\r
+       Create a new Unknown associated with\r
+       this Document. The memory for the object\r
+       is managed by the Document.\r
+    */\r
+    XMLUnknown* NewUnknown( const char* text );\r
+\r
+    /**\r
+       Delete a node associated with this document.\r
+       It will be unlinked from the DOM.\r
+    */\r
+    void DeleteNode( XMLNode* node );\r
+\r
+    void SetError( XMLError error, const char* str1, const char* str2 );\r
+\r
+    /// Return true if there was an error parsing the document.\r
+    bool Error() const {\r
+        return _errorID != XML_NO_ERROR;\r
+    }\r
+    /// Return the errorID.\r
+    XMLError  ErrorID() const {\r
+        return _errorID;\r
+    }\r
+       const char* ErrorName() const;\r
+\r
+    /// Return a possibly helpful diagnostic location or string.\r
+    const char* GetErrorStr1() const {\r
+        return _errorStr1;\r
+    }\r
+    /// Return a possibly helpful secondary diagnostic location or string.\r
+    const char* GetErrorStr2() const {\r
+        return _errorStr2;\r
+    }\r
+    /// If there is an error, print it to stdout.\r
+    void PrintError() const;\r
+    \r
+    /// Clear the document, resetting it to the initial state.\r
+    void Clear();\r
+\r
+    // internal\r
+    char* Identify( char* p, XMLNode** node );\r
+\r
+    virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const   {\r
+        return 0;\r
+    }\r
+    virtual bool ShallowEqual( const XMLNode* /*compare*/ ) const      {\r
+        return false;\r
+    }\r
+\r
+private:\r
+    XMLDocument( const XMLDocument& ); // not supported\r
+    void operator=( const XMLDocument& );      // not supported\r
+\r
+    bool        _writeBOM;\r
+    bool        _processEntities;\r
+    XMLError    _errorID;\r
+    Whitespace  _whitespace;\r
+    const char* _errorStr1;\r
+    const char* _errorStr2;\r
+    char*       _charBuffer;\r
+\r
+    MemPoolT< sizeof(XMLElement) >      _elementPool;\r
+    MemPoolT< sizeof(XMLAttribute) > _attributePool;\r
+    MemPoolT< sizeof(XMLText) >                 _textPool;\r
+    MemPoolT< sizeof(XMLComment) >      _commentPool;\r
+\r
+       static const char* _errorNames[XML_ERROR_COUNT];\r
+\r
+    void Parse();\r
+};\r
+\r
+\r
+/**\r
+       A XMLHandle is a class that wraps a node pointer with null checks; this is\r
+       an incredibly useful thing. Note that XMLHandle is not part of the TinyXML-2\r
+       DOM structure. It is a separate utility class.\r
+\r
+       Take an example:\r
+       @verbatim\r
+       <Document>\r
+               <Element attributeA = "valueA">\r
+                       <Child attributeB = "value1" />\r
+                       <Child attributeB = "value2" />\r
+               </Element>\r
+       </Document>\r
+       @endverbatim\r
+\r
+       Assuming you want the value of "attributeB" in the 2nd "Child" element, it's very\r
+       easy to write a *lot* of code that looks like:\r
+\r
+       @verbatim\r
+       XMLElement* root = document.FirstChildElement( "Document" );\r
+       if ( root )\r
+       {\r
+               XMLElement* element = root->FirstChildElement( "Element" );\r
+               if ( element )\r
+               {\r
+                       XMLElement* child = element->FirstChildElement( "Child" );\r
+                       if ( child )\r
+                       {\r
+                               XMLElement* child2 = child->NextSiblingElement( "Child" );\r
+                               if ( child2 )\r
+                               {\r
+                                       // Finally do something useful.\r
+       @endverbatim\r
+\r
+       And that doesn't even cover "else" cases. XMLHandle addresses the verbosity\r
+       of such code. A XMLHandle checks for null pointers so it is perfectly safe\r
+       and correct to use:\r
+\r
+       @verbatim\r
+       XMLHandle docHandle( &document );\r
+       XMLElement* child2 = docHandle.FirstChildElement( "Document" ).FirstChildElement( "Element" ).FirstChildElement().NextSiblingElement();\r
+       if ( child2 )\r
+       {\r
+               // do something useful\r
+       @endverbatim\r
+\r
+       Which is MUCH more concise and useful.\r
+\r
+       It is also safe to copy handles - internally they are nothing more than node pointers.\r
+       @verbatim\r
+       XMLHandle handleCopy = handle;\r
+       @endverbatim\r
+\r
+       See also XMLConstHandle, which is the same as XMLHandle, but operates on const objects.\r
+*/\r
+class TINYXML2_LIB XMLHandle\r
+{\r
+public:\r
+    /// Create a handle from any node (at any depth of the tree.) This can be a null pointer.\r
+    XMLHandle( XMLNode* node )                                                                                         {\r
+        _node = node;\r
+    }\r
+    /// Create a handle from a node.\r
+    XMLHandle( XMLNode& node )                                                                                         {\r
+        _node = &node;\r
+    }\r
+    /// Copy constructor\r
+    XMLHandle( const XMLHandle& ref )                                                                          {\r
+        _node = ref._node;\r
+    }\r
+    /// Assignment\r
+    XMLHandle& operator=( const XMLHandle& ref )                                                       {\r
+        _node = ref._node;\r
+        return *this;\r
+    }\r
+\r
+    /// Get the first child of this handle.\r
+    XMLHandle FirstChild()                                                                                                     {\r
+        return XMLHandle( _node ? _node->FirstChild() : 0 );\r
+    }\r
+    /// Get the first child element of this handle.\r
+    XMLHandle FirstChildElement( const char* value=0 )                                         {\r
+        return XMLHandle( _node ? _node->FirstChildElement( value ) : 0 );\r
+    }\r
+    /// Get the last child of this handle.\r
+    XMLHandle LastChild()                                                                                                      {\r
+        return XMLHandle( _node ? _node->LastChild() : 0 );\r
+    }\r
+    /// Get the last child element of this handle.\r
+    XMLHandle LastChildElement( const char* _value=0 )                                         {\r
+        return XMLHandle( _node ? _node->LastChildElement( _value ) : 0 );\r
+    }\r
+    /// Get the previous sibling of this handle.\r
+    XMLHandle PreviousSibling()                                                                                                {\r
+        return XMLHandle( _node ? _node->PreviousSibling() : 0 );\r
+    }\r
+    /// Get the previous sibling element of this handle.\r
+    XMLHandle PreviousSiblingElement( const char* _value=0 )                           {\r
+        return XMLHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 );\r
+    }\r
+    /// Get the next sibling of this handle.\r
+    XMLHandle NextSibling()                                                                                                    {\r
+        return XMLHandle( _node ? _node->NextSibling() : 0 );\r
+    }\r
+    /// Get the next sibling element of this handle.\r
+    XMLHandle NextSiblingElement( const char* _value=0 )                                       {\r
+        return XMLHandle( _node ? _node->NextSiblingElement( _value ) : 0 );\r
+    }\r
+\r
+    /// Safe cast to XMLNode. This can return null.\r
+    XMLNode* ToNode()                                                  {\r
+        return _node;\r
+    }\r
+    /// Safe cast to XMLElement. This can return null.\r
+    XMLElement* ToElement()                                    {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToElement() );\r
+    }\r
+    /// Safe cast to XMLText. This can return null.\r
+    XMLText* ToText()                                                  {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToText() );\r
+    }\r
+    /// Safe cast to XMLUnknown. This can return null.\r
+    XMLUnknown* ToUnknown()                                    {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToUnknown() );\r
+    }\r
+    /// Safe cast to XMLDeclaration. This can return null.\r
+    XMLDeclaration* ToDeclaration()                    {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToDeclaration() );\r
+    }\r
+\r
+private:\r
+    XMLNode* _node;\r
+};\r
+\r
+\r
+/**\r
+       A variant of the XMLHandle class for working with const XMLNodes and Documents. It is the\r
+       same in all regards, except for the 'const' qualifiers. See XMLHandle for API.\r
+*/\r
+class TINYXML2_LIB XMLConstHandle\r
+{\r
+public:\r
+    XMLConstHandle( const XMLNode* node )                                                                                      {\r
+        _node = node;\r
+    }\r
+    XMLConstHandle( const XMLNode& node )                                                                                      {\r
+        _node = &node;\r
+    }\r
+    XMLConstHandle( const XMLConstHandle& ref )                                                                                {\r
+        _node = ref._node;\r
+    }\r
+\r
+    XMLConstHandle& operator=( const XMLConstHandle& ref )                                                     {\r
+        _node = ref._node;\r
+        return *this;\r
+    }\r
+\r
+    const XMLConstHandle FirstChild() const                                                                                    {\r
+        return XMLConstHandle( _node ? _node->FirstChild() : 0 );\r
+    }\r
+    const XMLConstHandle FirstChildElement( const char* value=0 ) const                                {\r
+        return XMLConstHandle( _node ? _node->FirstChildElement( value ) : 0 );\r
+    }\r
+    const XMLConstHandle LastChild()   const                                                                           {\r
+        return XMLConstHandle( _node ? _node->LastChild() : 0 );\r
+    }\r
+    const XMLConstHandle LastChildElement( const char* _value=0 ) const                                {\r
+        return XMLConstHandle( _node ? _node->LastChildElement( _value ) : 0 );\r
+    }\r
+    const XMLConstHandle PreviousSibling() const                                                                       {\r
+        return XMLConstHandle( _node ? _node->PreviousSibling() : 0 );\r
+    }\r
+    const XMLConstHandle PreviousSiblingElement( const char* _value=0 ) const          {\r
+        return XMLConstHandle( _node ? _node->PreviousSiblingElement( _value ) : 0 );\r
+    }\r
+    const XMLConstHandle NextSibling() const                                                                           {\r
+        return XMLConstHandle( _node ? _node->NextSibling() : 0 );\r
+    }\r
+    const XMLConstHandle NextSiblingElement( const char* _value=0 ) const                      {\r
+        return XMLConstHandle( _node ? _node->NextSiblingElement( _value ) : 0 );\r
+    }\r
+\r
+\r
+    const XMLNode* ToNode() const                              {\r
+        return _node;\r
+    }\r
+    const XMLElement* ToElement() const                        {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToElement() );\r
+    }\r
+    const XMLText* ToText() const                              {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToText() );\r
+    }\r
+    const XMLUnknown* ToUnknown() const                        {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToUnknown() );\r
+    }\r
+    const XMLDeclaration* ToDeclaration() const        {\r
+        return ( ( _node == 0 ) ? 0 : _node->ToDeclaration() );\r
+    }\r
+\r
+private:\r
+    const XMLNode* _node;\r
+};\r
+\r
+\r
+/**\r
+       Printing functionality. The XMLPrinter gives you more\r
+       options than the XMLDocument::Print() method.\r
+\r
+       It can:\r
+       -# Print to memory.\r
+       -# Print to a file you provide.\r
+       -# Print XML without a XMLDocument.\r
+\r
+       Print to Memory\r
+\r
+       @verbatim\r
+       XMLPrinter printer;\r
+       doc.Print( &printer );\r
+       SomeFunction( printer.CStr() );\r
+       @endverbatim\r
+\r
+       Print to a File\r
+\r
+       You provide the file pointer.\r
+       @verbatim\r
+       XMLPrinter printer( fp );\r
+       doc.Print( &printer );\r
+       @endverbatim\r
+\r
+       Print without a XMLDocument\r
+\r
+       When loading, an XML parser is very useful. However, sometimes\r
+       when saving, it just gets in the way. The code is often set up\r
+       for streaming, and constructing the DOM is just overhead.\r
+\r
+       The Printer supports the streaming case. The following code\r
+       prints out a trivially simple XML file without ever creating\r
+       an XML document.\r
+\r
+       @verbatim\r
+       XMLPrinter printer( fp );\r
+       printer.OpenElement( "foo" );\r
+       printer.PushAttribute( "foo", "bar" );\r
+       printer.CloseElement();\r
+       @endverbatim\r
+*/\r
+class TINYXML2_LIB XMLPrinter : public XMLVisitor\r
+{\r
+public:\r
+    /** Construct the printer. If the FILE* is specified,\r
+       this will print to the FILE. Else it will print\r
+       to memory, and the result is available in CStr().\r
+       If 'compact' is set to true, then output is created\r
+       with only required whitespace and newlines.\r
+    */\r
+    XMLPrinter( FILE* file=0, bool compact = false, int depth = 0 );\r
+    virtual ~XMLPrinter()      {}\r
+\r
+    /** If streaming, write the BOM and declaration. */\r
+    void PushHeader( bool writeBOM, bool writeDeclaration );\r
+    /** If streaming, start writing an element.\r
+        The element must be closed with CloseElement()\r
+    */\r
+    void OpenElement( const char* name, bool compactMode=false );\r
+    /// If streaming, add an attribute to an open element.\r
+    void PushAttribute( const char* name, const char* value );\r
+    void PushAttribute( const char* name, int value );\r
+    void PushAttribute( const char* name, unsigned value );\r
+    void PushAttribute( const char* name, bool value );\r
+    void PushAttribute( const char* name, double value );\r
+    /// If streaming, close the Element.\r
+    virtual void CloseElement( bool compactMode=false );\r
+\r
+    /// Add a text node.\r
+    void PushText( const char* text, bool cdata=false );\r
+    /// Add a text node from an integer.\r
+    void PushText( int value );\r
+    /// Add a text node from an unsigned.\r
+    void PushText( unsigned value );\r
+    /// Add a text node from a bool.\r
+    void PushText( bool value );\r
+    /// Add a text node from a float.\r
+    void PushText( float value );\r
+    /// Add a text node from a double.\r
+    void PushText( double value );\r
+\r
+    /// Add a comment\r
+    void PushComment( const char* comment );\r
+\r
+    void PushDeclaration( const char* value );\r
+    void PushUnknown( const char* value );\r
+\r
+    virtual bool VisitEnter( const XMLDocument& /*doc*/ );\r
+    virtual bool VisitExit( const XMLDocument& /*doc*/ )                       {\r
+        return true;\r
+    }\r
+\r
+    virtual bool VisitEnter( const XMLElement& element, const XMLAttribute* attribute );\r
+    virtual bool VisitExit( const XMLElement& element );\r
+\r
+    virtual bool Visit( const XMLText& text );\r
+    virtual bool Visit( const XMLComment& comment );\r
+    virtual bool Visit( const XMLDeclaration& declaration );\r
+    virtual bool Visit( const XMLUnknown& unknown );\r
+\r
+    /**\r
+       If in print to memory mode, return a pointer to\r
+       the XML file in memory.\r
+    */\r
+    const char* CStr() const {\r
+        return _buffer.Mem();\r
+    }\r
+    /**\r
+       If in print to memory mode, return the size\r
+       of the XML file in memory. (Note the size returned\r
+       includes the terminating null.)\r
+    */\r
+    int CStrSize() const {\r
+        return _buffer.Size();\r
+    }\r
+    /**\r
+       If in print to memory mode, reset the buffer to the\r
+       beginning.\r
+    */\r
+    void ClearBuffer() {\r
+        _buffer.Clear();\r
+        _buffer.Push(0);\r
+    }\r
+\r
+protected:\r
+       virtual bool CompactMode( const XMLElement& )   { return _compactMode; }\r
+\r
+       /** Prints out the space before an element. You may override to change\r
+           the space and tabs used. A PrintSpace() override should call Print().\r
+       */\r
+    virtual void PrintSpace( int depth );\r
+    void Print( const char* format, ... );\r
+\r
+    void SealElementIfJustOpened();\r
+    bool _elementJustOpened;\r
+    DynArray< const char*, 10 > _stack;\r
+\r
+private:\r
+    void PrintString( const char*, bool restrictedEntitySet ); // prints out, after detecting entities.\r
+\r
+    bool _firstElement;\r
+    FILE* _fp;\r
+    int _depth;\r
+    int _textDepth;\r
+    bool _processEntities;\r
+       bool _compactMode;\r
+\r
+    enum {\r
+        ENTITY_RANGE = 64,\r
+        BUF_SIZE = 200\r
+    };\r
+    bool _entityFlag[ENTITY_RANGE];\r
+    bool _restrictedEntityFlag[ENTITY_RANGE];\r
+\r
+    DynArray< char, 20 > _buffer;\r
+};\r
+\r
+\r
+}      // tinyxml2\r
+\r
+#if defined(_MSC_VER)\r
+#   pragma warning(pop)\r
+#endif\r
+\r
+#endif // TINYXML2_INCLUDED\r
diff --git a/tinyxml2.pc.in b/tinyxml2.pc.in
new file mode 100644 (file)
index 0000000..5a44e89
--- /dev/null
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_INCLUDEDIR@
+
+Name: TinyXML2
+Description: simple, small, C++ XML parser
+Version: @GENERIC_LIB_VERSION@
+Libs: -L${libdir} -ltinyxml2
+Cflags: -I${includedir}
diff --git a/tinyxml2/test.vcxproj b/tinyxml2/test.vcxproj
new file mode 100644 (file)
index 0000000..e61bb1b
--- /dev/null
@@ -0,0 +1,347 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug-Dll|Win32">\r
+      <Configuration>Debug-Dll</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug-Dll|x64">\r
+      <Configuration>Debug-Dll</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug-Lib|Win32">\r
+      <Configuration>Debug-Lib</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug-Lib|x64">\r
+      <Configuration>Debug-Lib</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release-Dll|Win32">\r
+      <Configuration>Release-Dll</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release-Dll|x64">\r
+      <Configuration>Release-Dll</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release-Lib|Win32">\r
+      <Configuration>Release-Lib</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release-Lib|x64">\r
+      <Configuration>Release-Lib</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{E8FB2712-8666-4662-A5B8-2B5B0FB1A260}</ProjectGuid>\r
+    <RootNamespace>test</RootNamespace>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+  </PropertyGroup>\r
+  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'">\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'">\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'">\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'">\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'">\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'">\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'">\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'">\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>TINYXML2_IMPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>TINYXML2_IMPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+      <PreprocessorDefinitions>TINYXML2_IMPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <SubSystem>Console</SubSystem>\r
+      <SetChecksum>true</SetChecksum>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+      <PreprocessorDefinitions>TINYXML2_IMPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <SubSystem>Console</SubSystem>\r
+      <SetChecksum>true</SetChecksum>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <SetChecksum>true</SetChecksum>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+    </ClCompile>\r
+    <Link>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <SetChecksum>true</SetChecksum>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\xmltest.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="tinyxml2.vcxproj">\r
+      <Project>{d1c528b6-aa02-4d29-9d61-dc08e317a70d}</Project>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/tinyxml2/test.vcxproj.filters b/tinyxml2/test.vcxproj.filters
new file mode 100644 (file)
index 0000000..0a70dc6
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <ClCompile Include="..\xmltest.cpp" />\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/tinyxml2/tinyxml2-cbp/README b/tinyxml2/tinyxml2-cbp/README
new file mode 100644 (file)
index 0000000..828448e
--- /dev/null
@@ -0,0 +1,3 @@
+The (default) Release configuration of this project builds a ready to use static library.
+The Debug configuration of this project builds an executable console application that 
+executes all tests provided for tinyxml2 in the xmltest.cpp file.
\ No newline at end of file
diff --git a/tinyxml2/tinyxml2-cbp/tinyxml2-cbp.cbp b/tinyxml2/tinyxml2-cbp/tinyxml2-cbp.cbp
new file mode 100644 (file)
index 0000000..915746f
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+       <FileVersion major="1" minor="6" />
+       <Project>
+               <Option title="tinyxml2-cbp" />
+               <Option execution_dir="../" />
+               <Option pch_mode="2" />
+               <Option compiler="gcc" />
+               <Build>
+                       <Target title="Release">
+                               <Option output="bin/Release/tinyxml2" prefix_auto="1" extension_auto="1" />
+                               <Option working_dir="" />
+                               <Option object_output="obj/Release/" />
+                               <Option type="2" />
+                               <Option compiler="gcc" />
+                               <Compiler>
+                                       <Add option="-O2" />
+                               </Compiler>
+                               <Linker>
+                                       <Add option="-s" />
+                               </Linker>
+                       </Target>
+                       <Target title="Debug">
+                               <Option output="bin/Debug/tinyxml2-cbp" prefix_auto="1" extension_auto="1" />
+                               <Option working_dir="../../" />
+                               <Option object_output="obj/Debug/" />
+                               <Option type="1" />
+                               <Option compiler="gcc" />
+                               <Compiler>
+                                       <Add option="-g" />
+                               </Compiler>
+                       </Target>
+               </Build>
+               <Compiler>
+                       <Add option="-Wall" />
+               </Compiler>
+               <Unit filename="../../tinyxml2.cpp" />
+               <Unit filename="../../tinyxml2.h" />
+               <Unit filename="../../xmltest.cpp">
+                       <Option target="Debug" />
+               </Unit>
+               <Extensions>
+                       <code_completion />
+                       <envvars />
+                       <debugger />
+                       <lib_finder disable_auto="1" />
+               </Extensions>
+       </Project>
+</CodeBlocks_project_file>
diff --git a/tinyxml2/tinyxml2.sln b/tinyxml2/tinyxml2.sln
new file mode 100755 (executable)
index 0000000..1c0c92f
--- /dev/null
@@ -0,0 +1,56 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 11.00\r
+# Visual Studio 2010\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyxml2", "tinyxml2.vcxproj", "{D1C528B6-AA02-4D29-9D61-DC08E317A70D}"\r
+EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test.vcxproj", "{E8FB2712-8666-4662-A5B8-2B5B0FB1A260}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug-Dll|Win32 = Debug-Dll|Win32\r
+               Debug-Dll|x64 = Debug-Dll|x64\r
+               Debug-Lib|Win32 = Debug-Lib|Win32\r
+               Debug-Lib|x64 = Debug-Lib|x64\r
+               Release-Dll|Win32 = Release-Dll|Win32\r
+               Release-Dll|x64 = Release-Dll|x64\r
+               Release-Lib|Win32 = Release-Lib|Win32\r
+               Release-Lib|x64 = Release-Lib|x64\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug-Dll|Win32.ActiveCfg = Debug-Dll|Win32\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug-Dll|Win32.Build.0 = Debug-Dll|Win32\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug-Dll|x64.ActiveCfg = Debug-Dll|x64\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug-Dll|x64.Build.0 = Debug-Dll|x64\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug-Lib|Win32.ActiveCfg = Debug-Lib|Win32\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug-Lib|Win32.Build.0 = Debug-Lib|Win32\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug-Lib|x64.ActiveCfg = Debug-Lib|x64\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Debug-Lib|x64.Build.0 = Debug-Lib|x64\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release-Dll|Win32.ActiveCfg = Release-Dll|Win32\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release-Dll|Win32.Build.0 = Release-Dll|Win32\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release-Dll|x64.ActiveCfg = Release-Dll|x64\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release-Dll|x64.Build.0 = Release-Dll|x64\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release-Lib|Win32.ActiveCfg = Release-Lib|Win32\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release-Lib|Win32.Build.0 = Release-Lib|Win32\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release-Lib|x64.ActiveCfg = Release-Lib|x64\r
+               {D1C528B6-AA02-4D29-9D61-DC08E317A70D}.Release-Lib|x64.Build.0 = Release-Lib|x64\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Debug-Dll|Win32.ActiveCfg = Debug-Dll|Win32\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Debug-Dll|Win32.Build.0 = Debug-Dll|Win32\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Debug-Dll|x64.ActiveCfg = Debug-Dll|x64\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Debug-Dll|x64.Build.0 = Debug-Dll|x64\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Debug-Lib|Win32.ActiveCfg = Debug-Lib|Win32\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Debug-Lib|Win32.Build.0 = Debug-Lib|Win32\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Debug-Lib|x64.ActiveCfg = Debug-Lib|x64\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Debug-Lib|x64.Build.0 = Debug-Lib|x64\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Release-Dll|Win32.ActiveCfg = Release-Dll|Win32\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Release-Dll|Win32.Build.0 = Release-Dll|Win32\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Release-Dll|x64.ActiveCfg = Release-Dll|x64\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Release-Dll|x64.Build.0 = Release-Dll|x64\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Release-Lib|Win32.ActiveCfg = Release-Lib|Win32\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Release-Lib|Win32.Build.0 = Release-Lib|Win32\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Release-Lib|x64.ActiveCfg = Release-Lib|x64\r
+               {E8FB2712-8666-4662-A5B8-2B5B0FB1A260}.Release-Lib|x64.Build.0 = Release-Lib|x64\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/tinyxml2/tinyxml2.vcxproj b/tinyxml2/tinyxml2.vcxproj
new file mode 100755 (executable)
index 0000000..7155976
--- /dev/null
@@ -0,0 +1,384 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug-Dll|Win32">\r
+      <Configuration>Debug-Dll</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug-Dll|x64">\r
+      <Configuration>Debug-Dll</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug-Lib|Win32">\r
+      <Configuration>Debug-Lib</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug-Lib|x64">\r
+      <Configuration>Debug-Lib</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release-Dll|Win32">\r
+      <Configuration>Release-Dll</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release-Dll|x64">\r
+      <Configuration>Release-Dll</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release-Lib|Win32">\r
+      <Configuration>Release-Lib</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release-Lib|x64">\r
+      <Configuration>Release-Lib</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{D1C528B6-AA02-4D29-9D61-DC08E317A70D}</ProjectGuid>\r
+    <Keyword>Win32Proj</Keyword>\r
+    <RootNamespace>tinyxml2</RootNamespace>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+    <OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>\r
+    <IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>WIN32;TINYXML2_EXPORT;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>NotSet</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>WIN32;TINYXML2_EXPORT;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>NotSet</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <SetChecksum>true</SetChecksum>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <PreprocessorDefinitions>WIN32;TINYXML2_EXPORT;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>NotSet</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <SetChecksum>true</SetChecksum>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <SetChecksum>true</SetChecksum>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|x64'">\r
+    <ClCompile>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <PreprocessorDefinitions>WIN32;TINYXML2_EXPORT;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>NotSet</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <SetChecksum>true</SetChecksum>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Lib>\r
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Lib>\r
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r
+    </Lib>\r
+    <ClCompile>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+    </ClCompile>\r
+    <ClCompile>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+    </ClCompile>\r
+    <ClCompile>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+    </ClCompile>\r
+    <ClCompile>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+    </ClCompile>\r
+    <ClCompile>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+    </ClCompile>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Lib>\r
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Lib>\r
+      <IgnoreAllDefaultLibraries>true</IgnoreAllDefaultLibraries>\r
+    </Lib>\r
+    <ClCompile>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+    </ClCompile>\r
+    <ClCompile>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+    </ClCompile>\r
+    <ClCompile>\r
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
+    </ClCompile>\r
+    <ClCompile>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+    </ClCompile>\r
+    <ClCompile>\r
+      <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>\r
+      <StringPooling>true</StringPooling>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+    </ClCompile>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\tinyxml2.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\tinyxml2.h" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/tinyxml2/tinyxml2.vcxproj.filters b/tinyxml2/tinyxml2.vcxproj.filters
new file mode 100755 (executable)
index 0000000..e19968a
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <ClCompile Include="..\tinyxml2.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\tinyxml2.h" />\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/tinyxml2/tinyxml2.xcodeproj/project.pbxproj b/tinyxml2/tinyxml2.xcodeproj/project.pbxproj
new file mode 100644 (file)
index 0000000..58c4fcc
--- /dev/null
@@ -0,0 +1,211 @@
+// !$*UTF8*$!
+{
+       archiveVersion = 1;
+       classes = {
+       };
+       objectVersion = 46;
+       objects = {
+
+/* Begin PBXBuildFile section */
+               037AE8A5151E692700E0F29F /* xmltest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 037AE8A3151E692700E0F29F /* xmltest.cpp */; };
+               03F28B53152E9B1B00D4CD90 /* tinyxml2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 03F28B4A152E9B1B00D4CD90 /* tinyxml2.cpp */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+               037AE86D151E685F00E0F29F /* xmltest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = xmltest; sourceTree = BUILT_PRODUCTS_DIR; };
+               037AE8A3151E692700E0F29F /* xmltest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmltest.cpp; path = ../xmltest.cpp; sourceTree = SOURCE_ROOT; };
+               03F28B4A152E9B1B00D4CD90 /* tinyxml2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tinyxml2.cpp; sourceTree = "<group>"; };
+               03F28B4B152E9B1B00D4CD90 /* tinyxml2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tinyxml2.h; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+               037AE86B151E685F00E0F29F /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+               037AE056151CCC5200E0F29F = {
+                       isa = PBXGroup;
+                       children = (
+                               037AE069151CCC7000E0F29F /* Classes */,
+                               03F28B60152E9B4C00D4CD90 /* Libraries */,
+                               037AE06F151CCCB900E0F29F /* Products */,
+                       );
+                       sourceTree = "<group>";
+               };
+               037AE069151CCC7000E0F29F /* Classes */ = {
+                       isa = PBXGroup;
+                       children = (
+                               037AE8A3151E692700E0F29F /* xmltest.cpp */,
+                       );
+                       name = Classes;
+                       sourceTree = "<group>";
+               };
+               037AE06F151CCCB900E0F29F /* Products */ = {
+                       isa = PBXGroup;
+                       children = (
+                               037AE86D151E685F00E0F29F /* xmltest */,
+                       );
+                       name = Products;
+                       sourceTree = "<group>";
+               };
+               03F28AD7152E9B1B00D4CD90 /* tinyxml2 */ = {
+                       isa = PBXGroup;
+                       children = (
+                               03F28B4A152E9B1B00D4CD90 /* tinyxml2.cpp */,
+                               03F28B4B152E9B1B00D4CD90 /* tinyxml2.h */,
+                       );
+                       name = tinyxml2;
+                       path = ..;
+                       sourceTree = SOURCE_ROOT;
+               };
+               03F28B60152E9B4C00D4CD90 /* Libraries */ = {
+                       isa = PBXGroup;
+                       children = (
+                               03F28AD7152E9B1B00D4CD90 /* tinyxml2 */,
+                       );
+                       name = Libraries;
+                       sourceTree = "<group>";
+               };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+               037AE86C151E685F00E0F29F /* xmltest */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 037AE873151E687E00E0F29F /* Build configuration list for PBXNativeTarget "xmltest" */;
+                       buildPhases = (
+                               037AE86A151E685F00E0F29F /* Sources */,
+                               037AE86B151E685F00E0F29F /* Frameworks */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = xmltest;
+                       productName = tinyxml2;
+                       productReference = 037AE86D151E685F00E0F29F /* xmltest */;
+                       productType = "com.apple.product-type.tool";
+               };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+               037AE058151CCC5200E0F29F /* Project object */ = {
+                       isa = PBXProject;
+                       attributes = {
+                               LastUpgradeCheck = 0610;
+                       };
+                       buildConfigurationList = 037AE05B151CCC5200E0F29F /* Build configuration list for PBXProject "tinyxml2" */;
+                       compatibilityVersion = "Xcode 3.2";
+                       developmentRegion = English;
+                       hasScannedForEncodings = 0;
+                       knownRegions = (
+                               English,
+                               Japanese,
+                               French,
+                               German,
+                       );
+                       mainGroup = 037AE056151CCC5200E0F29F;
+                       productRefGroup = 037AE06F151CCCB900E0F29F /* Products */;
+                       projectDirPath = "";
+                       projectRoot = "";
+                       targets = (
+                               037AE86C151E685F00E0F29F /* xmltest */,
+                       );
+               };
+/* End PBXProject section */
+
+/* Begin PBXSourcesBuildPhase section */
+               037AE86A151E685F00E0F29F /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               037AE8A5151E692700E0F29F /* xmltest.cpp in Sources */,
+                               03F28B53152E9B1B00D4CD90 /* tinyxml2.cpp in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+               037AE059151CCC5200E0F29F /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               CONFIGURATION_BUILD_DIR = "$(SYMROOT)/Debug";
+                               COPY_PHASE_STRIP = NO;
+                               "GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = DEBUG;
+                               ONLY_ACTIVE_ARCH = YES;
+                               SYMROOT = build;
+                       };
+                       name = Debug;
+               };
+               037AE05A151CCC5200E0F29F /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               COPY_PHASE_STRIP = YES;
+                       };
+                       name = Release;
+               };
+               037AE86F151E686000E0F29F /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CONFIGURATION_BUILD_DIR = ..;
+                               COPY_PHASE_STRIP = NO;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_ENABLE_FIX_AND_CONTINUE = YES;
+                               GCC_MODEL_TUNING = G5;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               INSTALL_PATH = /usr/local/bin;
+                               MACOSX_DEPLOYMENT_TARGET = "";
+                               PREBINDING = NO;
+                               PRODUCT_NAME = xmltest;
+                       };
+                       name = Debug;
+               };
+               037AE870151E686000E0F29F /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CONFIGURATION_BUILD_DIR = ..;
+                               COPY_PHASE_STRIP = YES;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
+                               GCC_MODEL_TUNING = G5;
+                               INSTALL_PATH = /usr/local/bin;
+                               MACOSX_DEPLOYMENT_TARGET = "";
+                               PREBINDING = NO;
+                               PRODUCT_NAME = tinyxml2;
+                               ZERO_LINK = NO;
+                       };
+                       name = Release;
+               };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+               037AE05B151CCC5200E0F29F /* Build configuration list for PBXProject "tinyxml2" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               037AE059151CCC5200E0F29F /* Debug */,
+                               037AE05A151CCC5200E0F29F /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               037AE873151E687E00E0F29F /* Build configuration list for PBXNativeTarget "xmltest" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               037AE86F151E686000E0F29F /* Debug */,
+                               037AE870151E686000E0F29F /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+/* End XCConfigurationList section */
+       };
+       rootObject = 037AE058151CCC5200E0F29F /* Project object */;
+}
diff --git a/xmltest.cpp b/xmltest.cpp
new file mode 100644 (file)
index 0000000..243628c
--- /dev/null
@@ -0,0 +1,1489 @@
+#if defined( _MSC_VER )\r
+       #if !defined( _CRT_SECURE_NO_WARNINGS )\r
+               #define _CRT_SECURE_NO_WARNINGS         // This test file is not intended to be secure.\r
+       #endif\r
+#endif\r
+\r
+#include "tinyxml2.h"\r
+#include <cstdlib>\r
+#include <cstring>\r
+#include <ctime>\r
+\r
+#if defined( _MSC_VER )\r
+       #include <direct.h>             // _mkdir\r
+       #include <crtdbg.h>\r
+       #define WIN32_LEAN_AND_MEAN\r
+       #include <windows.h>\r
+       _CrtMemState startMemState;\r
+       _CrtMemState endMemState;\r
+#elif defined(MINGW32) || defined(__MINGW32__)\r
+    #include <io.h>  // mkdir\r
+#else\r
+       #include <sys/stat.h>   // mkdir\r
+#endif\r
+\r
+using namespace tinyxml2;\r
+using namespace std;\r
+int gPass = 0;\r
+int gFail = 0;\r
+\r
+\r
+bool XMLTest (const char* testString, const char* expected, const char* found, bool echo=true, bool extraNL=false )\r
+{\r
+       bool pass = !strcmp( expected, found );\r
+       if ( pass )\r
+               printf ("[pass]");\r
+       else\r
+               printf ("[fail]");\r
+\r
+       if ( !echo ) {\r
+               printf (" %s\n", testString);\r
+       }\r
+       else {\r
+               if ( extraNL ) {\r
+                       printf( " %s\n", testString );\r
+                       printf( "%s\n", expected );\r
+                       printf( "%s\n", found );\r
+               }\r
+               else {\r
+                       printf (" %s [%s][%s]\n", testString, expected, found);\r
+               }\r
+       }\r
+\r
+       if ( pass )\r
+               ++gPass;\r
+       else\r
+               ++gFail;\r
+       return pass;\r
+}\r
+\r
+\r
+template< class T > bool XMLTest( const char* testString, T expected, T found, bool echo=true )\r
+{\r
+       bool pass = ( expected == found );\r
+       if ( pass )\r
+               printf ("[pass]");\r
+       else\r
+               printf ("[fail]");\r
+\r
+       if ( !echo )\r
+               printf (" %s\n", testString);\r
+       else\r
+               printf (" %s [%d][%d]\n", testString, static_cast<int>(expected), static_cast<int>(found) );\r
+\r
+       if ( pass )\r
+               ++gPass;\r
+       else\r
+               ++gFail;\r
+       return pass;\r
+}\r
+\r
+\r
+void NullLineEndings( char* p )\r
+{\r
+       while( p && *p ) {\r
+               if ( *p == '\n' || *p == '\r' ) {\r
+                       *p = 0;\r
+                       return;\r
+               }\r
+               ++p;\r
+       }\r
+}\r
+\r
+\r
+int example_1()\r
+{\r
+       XMLDocument doc;\r
+       doc.LoadFile( "resources/dream.xml" );\r
+\r
+       return doc.ErrorID();\r
+}\r
+/** @page Example-1 Load an XML File\r
+ *  @dontinclude ./xmltest.cpp\r
+ *  Basic XML file loading.\r
+ *  The basic syntax to load an XML file from\r
+ *  disk and check for an error. (ErrorID()\r
+ *  will return 0 for no error.)\r
+ *  @skip example_1()\r
+ *  @until }\r
+ */\r
\r
+\r
+int example_2()\r
+{\r
+       static const char* xml = "<element/>";\r
+       XMLDocument doc;\r
+       doc.Parse( xml );\r
+\r
+       return doc.ErrorID();\r
+}\r
+/** @page Example-2 Parse an XML from char buffer\r
+ *  @dontinclude ./xmltest.cpp\r
+ *  Basic XML string parsing.\r
+ *  The basic syntax to parse an XML for\r
+ *  a char* and check for an error. (ErrorID()\r
+ *  will return 0 for no error.)\r
+ *  @skip example_2()\r
+ *  @until }\r
+ */\r
+\r
+\r
+int example_3()\r
+{\r
+       static const char* xml =\r
+               "<?xml version=\"1.0\"?>"\r
+               "<!DOCTYPE PLAY SYSTEM \"play.dtd\">"\r
+               "<PLAY>"\r
+               "<TITLE>A Midsummer Night's Dream</TITLE>"\r
+               "</PLAY>";\r
+\r
+       XMLDocument doc;\r
+       doc.Parse( xml );\r
+\r
+       XMLElement* titleElement = doc.FirstChildElement( "PLAY" )->FirstChildElement( "TITLE" );\r
+       const char* title = titleElement->GetText();\r
+       printf( "Name of play (1): %s\n", title );\r
+\r
+       XMLText* textNode = titleElement->FirstChild()->ToText();\r
+       title = textNode->Value();\r
+       printf( "Name of play (2): %s\n", title );\r
+\r
+       return doc.ErrorID();\r
+}\r
+/** @page Example-3 Get information out of XML\r
+       @dontinclude ./xmltest.cpp\r
+       In this example, we navigate a simple XML\r
+       file, and read some interesting text. Note\r
+       that this example doesn't use error\r
+       checking; working code should check for null\r
+       pointers when walking an XML tree, or use\r
+       XMLHandle.\r
+       \r
+       (The XML is an excerpt from "dream.xml"). \r
+\r
+       @skip example_3()\r
+       @until </PLAY>";\r
+\r
+       The structure of the XML file is:\r
+\r
+       <ul>\r
+               <li>(declaration)</li>\r
+               <li>(dtd stuff)</li>\r
+               <li>Element "PLAY"</li>\r
+               <ul>\r
+                       <li>Element "TITLE"</li>\r
+                       <ul>\r
+                           <li>Text "A Midsummer Night's Dream"</li>\r
+                       </ul>\r
+               </ul>\r
+       </ul>\r
+\r
+       For this example, we want to print out the \r
+       title of the play. The text of the title (what\r
+       we want) is child of the "TITLE" element which\r
+       is a child of the "PLAY" element.\r
+\r
+       We want to skip the declaration and dtd, so the\r
+       method FirstChildElement() is a good choice. The\r
+       FirstChildElement() of the Document is the "PLAY"\r
+       Element, the FirstChildElement() of the "PLAY" Element\r
+       is the "TITLE" Element.\r
+\r
+       @until ( "TITLE" );\r
+\r
+       We can then use the convenience function GetText()\r
+       to get the title of the play.\r
+\r
+       @until title );\r
+\r
+       Text is just another Node in the XML DOM. And in\r
+       fact you should be a little cautious with it, as\r
+       text nodes can contain elements. \r
+       \r
+       @verbatim\r
+       Consider: A Midsummer Night's <b>Dream</b>\r
+       @endverbatim\r
+\r
+       It is more correct to actually query the Text Node\r
+       if in doubt:\r
+\r
+       @until title );\r
+\r
+       Noting that here we use FirstChild() since we are\r
+       looking for XMLText, not an element, and ToText()\r
+       is a cast from a Node to a XMLText. \r
+*/\r
+\r
+\r
+bool example_4()\r
+{\r
+       static const char* xml =\r
+               "<information>"\r
+               "       <attributeApproach v='2' />"\r
+               "       <textApproach>"\r
+               "               <v>2</v>"\r
+               "       </textApproach>"\r
+               "</information>";\r
+\r
+       XMLDocument doc;\r
+       doc.Parse( xml );\r
+\r
+       int v0 = 0;\r
+       int v1 = 0;\r
+\r
+       XMLElement* attributeApproachElement = doc.FirstChildElement()->FirstChildElement( "attributeApproach" );\r
+       attributeApproachElement->QueryIntAttribute( "v", &v0 );\r
+\r
+       XMLElement* textApproachElement = doc.FirstChildElement()->FirstChildElement( "textApproach" );\r
+       textApproachElement->FirstChildElement( "v" )->QueryIntText( &v1 );\r
+\r
+       printf( "Both values are the same: %d and %d\n", v0, v1 );\r
+\r
+       return !doc.Error() && ( v0 == v1 );\r
+}\r
+/** @page Example-4 Read attributes and text information.\r
+       @dontinclude ./xmltest.cpp\r
+\r
+       There are fundamentally 2 ways of writing a key-value\r
+       pair into an XML file. (Something that's always annoyed\r
+       me about XML.) Either by using attributes, or by writing\r
+       the key name into an element and the value into\r
+       the text node wrapped by the element. Both approaches\r
+       are illustrated in this example, which shows two ways\r
+       to encode the value "2" into the key "v":\r
+\r
+       @skip example_4()\r
+       @until "</information>";\r
+\r
+       TinyXML-2 has accessors for both approaches. \r
+\r
+       When using an attribute, you navigate to the XMLElement\r
+       with that attribute and use the QueryIntAttribute()\r
+       group of methods. (Also QueryFloatAttribute(), etc.)\r
+\r
+       @skip XMLElement* attributeApproachElement\r
+       @until &v0 );\r
+\r
+       When using the text approach, you need to navigate\r
+       down one more step to the XMLElement that contains\r
+       the text. Note the extra FirstChildElement( "v" )\r
+       in the code below. The value of the text can then\r
+       be safely queried with the QueryIntText() group\r
+       of methods. (Also QueryFloatText(), etc.)\r
+\r
+       @skip XMLElement* textApproachElement\r
+       @until &v1 );\r
+*/\r
+\r
+\r
+int main( int argc, const char ** argv )\r
+{\r
+       #if defined( _MSC_VER ) && defined( DEBUG )\r
+               _CrtMemCheckpoint( &startMemState );\r
+               // Enable MS Visual C++ debug heap memory leaks dump on exit\r
+               _CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);\r
+       #endif\r
+\r
+       #if defined(_MSC_VER) || defined(MINGW32) || defined(__MINGW32__)\r
+               #if defined __MINGW64_VERSION_MAJOR && defined __MINGW64_VERSION_MINOR\r
+                       //MINGW64: both 32 and 64-bit\r
+                       mkdir( "resources/out/" );\r
+                #else\r
+                       _mkdir( "resources/out/" );\r
+                #endif\r
+       #else\r
+               mkdir( "resources/out/", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);\r
+       #endif\r
+\r
+       {\r
+               TIXMLASSERT( true );\r
+       }\r
+\r
+       if ( argc > 1 ) {\r
+               XMLDocument* doc = new XMLDocument();\r
+               clock_t startTime = clock();\r
+               doc->LoadFile( argv[1] );\r
+               clock_t loadTime = clock();\r
+               int errorID = doc->ErrorID();\r
+               delete doc; doc = 0;\r
+               clock_t deleteTime = clock();\r
+\r
+               printf( "Test file '%s' loaded. ErrorID=%d\n", argv[1], errorID );\r
+               if ( !errorID ) {\r
+                       printf( "Load time=%u\n",   (unsigned)(loadTime - startTime) );\r
+                       printf( "Delete time=%u\n", (unsigned)(deleteTime - loadTime) );\r
+                       printf( "Total time=%u\n",  (unsigned)(deleteTime - startTime) );\r
+               }\r
+               exit(0);\r
+       }\r
+\r
+       FILE* fp = fopen( "resources/dream.xml", "r" );\r
+       if ( !fp ) {\r
+               printf( "Error opening test file 'dream.xml'.\n"\r
+                               "Is your working directory the same as where \n"\r
+                               "the xmltest.cpp and dream.xml file are?\n\n"\r
+       #if defined( _MSC_VER )\r
+                               "In windows Visual Studio you may need to set\n"\r
+                               "Properties->Debugging->Working Directory to '..'\n"\r
+       #endif\r
+                         );\r
+               exit( 1 );\r
+       }\r
+       fclose( fp );\r
+\r
+       XMLTest( "Example-1", 0, example_1() );\r
+       XMLTest( "Example-2", 0, example_2() );\r
+       XMLTest( "Example-3", 0, example_3() );\r
+       XMLTest( "Example-4", true, example_4() );\r
+\r
+       /* ------ Example 2: Lookup information. ---- */\r
+\r
+       {\r
+               static const char* test[] = {   "<element />",\r
+                                                                               "<element></element>",\r
+                                                                               "<element><subelement/></element>",\r
+                                                                               "<element><subelement></subelement></element>",\r
+                                                                               "<element><subelement><subsub/></subelement></element>",\r
+                                                                               "<!--comment beside elements--><element><subelement></subelement></element>",\r
+                                                                               "<!--comment beside elements, this time with spaces-->  \n <element>  <subelement> \n </subelement> </element>",\r
+                                                                               "<element attrib1='foo' attrib2=\"bar\" ></element>",\r
+                                                                               "<element attrib1='foo' attrib2=\"bar\" ><subelement attrib3='yeehaa' /></element>",\r
+                                                                               "<element>Text inside element.</element>",\r
+                                                                               "<element><b></b></element>",\r
+                                                                               "<element>Text inside and <b>bolded</b> in the element.</element>",\r
+                                                                               "<outer><element>Text inside and <b>bolded</b> in the element.</element></outer>",\r
+                                                                               "<element>This &amp; That.</element>",\r
+                                                                               "<element attrib='This&lt;That' />",\r
+                                                                               0\r
+               };\r
+               for( int i=0; test[i]; ++i ) {\r
+                       XMLDocument doc;\r
+                       doc.Parse( test[i] );\r
+                       doc.Print();\r
+                       printf( "----------------------------------------------\n" );\r
+               }\r
+       }\r
+#if 1\r
+       {\r
+               static const char* test = "<!--hello world\n"\r
+                                                                 "          line 2\r"\r
+                                                                 "          line 3\r\n"\r
+                                                                 "          line 4\n\r"\r
+                                                                 "          line 5\r-->";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( test );\r
+               doc.Print();\r
+       }\r
+\r
+       {\r
+               static const char* test = "<element>Text before.</element>";\r
+               XMLDocument doc;\r
+               doc.Parse( test );\r
+               XMLElement* root = doc.FirstChildElement();\r
+               XMLElement* newElement = doc.NewElement( "Subelement" );\r
+               root->InsertEndChild( newElement );\r
+               doc.Print();\r
+       }\r
+       {\r
+               XMLDocument* doc = new XMLDocument();\r
+               static const char* test = "<element><sub/></element>";\r
+               doc->Parse( test );\r
+               delete doc;\r
+       }\r
+       {\r
+               // Test: Programmatic DOM\r
+               // Build:\r
+               //              <element>\r
+               //                      <!--comment-->\r
+               //                      <sub attrib="1" />\r
+               //                      <sub attrib="2" />\r
+               //                      <sub attrib="3" >& Text!</sub>\r
+               //              <element>\r
+\r
+               XMLDocument* doc = new XMLDocument();\r
+               XMLNode* element = doc->InsertEndChild( doc->NewElement( "element" ) );\r
+\r
+               XMLElement* sub[3] = { doc->NewElement( "sub" ), doc->NewElement( "sub" ), doc->NewElement( "sub" ) };\r
+               for( int i=0; i<3; ++i ) {\r
+                       sub[i]->SetAttribute( "attrib", i );\r
+               }\r
+               element->InsertEndChild( sub[2] );\r
+               XMLNode* comment = element->InsertFirstChild( doc->NewComment( "comment" ) );\r
+               element->InsertAfterChild( comment, sub[0] );\r
+               element->InsertAfterChild( sub[0], sub[1] );\r
+               sub[2]->InsertFirstChild( doc->NewText( "& Text!" ));\r
+               doc->Print();\r
+               XMLTest( "Programmatic DOM", "comment", doc->FirstChildElement( "element" )->FirstChild()->Value() );\r
+               XMLTest( "Programmatic DOM", "0", doc->FirstChildElement( "element" )->FirstChildElement()->Attribute( "attrib" ) );\r
+               XMLTest( "Programmatic DOM", 2, doc->FirstChildElement()->LastChildElement( "sub" )->IntAttribute( "attrib" ) );\r
+               XMLTest( "Programmatic DOM", "& Text!",\r
+                                doc->FirstChildElement()->LastChildElement( "sub" )->FirstChild()->ToText()->Value() );\r
+\r
+               // And now deletion:\r
+               element->DeleteChild( sub[2] );\r
+               doc->DeleteNode( comment );\r
+\r
+               element->FirstChildElement()->SetAttribute( "attrib", true );\r
+               element->LastChildElement()->DeleteAttribute( "attrib" );\r
+\r
+               XMLTest( "Programmatic DOM", true, doc->FirstChildElement()->FirstChildElement()->BoolAttribute( "attrib" ) );\r
+               int value = 10;\r
+               int result = doc->FirstChildElement()->LastChildElement()->QueryIntAttribute( "attrib", &value );\r
+               XMLTest( "Programmatic DOM", result, (int)XML_NO_ATTRIBUTE );\r
+               XMLTest( "Programmatic DOM", value, 10 );\r
+\r
+               doc->Print();\r
+\r
+               {\r
+                       XMLPrinter streamer;\r
+                       doc->Print( &streamer );\r
+                       printf( "%s", streamer.CStr() );\r
+               }\r
+               {\r
+                       XMLPrinter streamer( 0, true );\r
+                       doc->Print( &streamer );\r
+                       XMLTest( "Compact mode", "<element><sub attrib=\"1\"/><sub/></element>", streamer.CStr(), false );\r
+               }\r
+               doc->SaveFile( "./resources/out/pretty.xml" );\r
+               doc->SaveFile( "./resources/out/compact.xml", true );\r
+               delete doc;\r
+       }\r
+       {\r
+               // Test: Dream\r
+               // XML1 : 1,187,569 bytes       in 31,209 allocations\r
+               // XML2 :   469,073     bytes   in    323 allocations\r
+               //int newStart = gNew;\r
+               XMLDocument doc;\r
+               doc.LoadFile( "resources/dream.xml" );\r
+\r
+               doc.SaveFile( "resources/out/dreamout.xml" );\r
+               doc.PrintError();\r
+\r
+               XMLTest( "Dream", "xml version=\"1.0\"",\r
+                                                 doc.FirstChild()->ToDeclaration()->Value() );\r
+               XMLTest( "Dream", true, doc.FirstChild()->NextSibling()->ToUnknown() ? true : false );\r
+               XMLTest( "Dream", "DOCTYPE PLAY SYSTEM \"play.dtd\"",\r
+                                                 doc.FirstChild()->NextSibling()->ToUnknown()->Value() );\r
+               XMLTest( "Dream", "And Robin shall restore amends.",\r
+                                                 doc.LastChild()->LastChild()->LastChild()->LastChild()->LastChildElement()->GetText() );\r
+               XMLTest( "Dream", "And Robin shall restore amends.",\r
+                                                 doc.LastChild()->LastChild()->LastChild()->LastChild()->LastChildElement()->GetText() );\r
+\r
+               XMLDocument doc2;\r
+               doc2.LoadFile( "resources/out/dreamout.xml" );\r
+               XMLTest( "Dream-out", "xml version=\"1.0\"",\r
+                                                 doc2.FirstChild()->ToDeclaration()->Value() );\r
+               XMLTest( "Dream-out", true, doc2.FirstChild()->NextSibling()->ToUnknown() ? true : false );\r
+               XMLTest( "Dream-out", "DOCTYPE PLAY SYSTEM \"play.dtd\"",\r
+                                                 doc2.FirstChild()->NextSibling()->ToUnknown()->Value() );\r
+               XMLTest( "Dream-out", "And Robin shall restore amends.",\r
+                                                 doc2.LastChild()->LastChild()->LastChild()->LastChild()->LastChildElement()->GetText() );\r
+\r
+               //gNewTotal = gNew - newStart;\r
+       }\r
+\r
+\r
+       {\r
+               const char* error =     "<?xml version=\"1.0\" standalone=\"no\" ?>\n"\r
+                                                       "<passages count=\"006\" formatversion=\"20020620\">\n"\r
+                                                       "    <wrong error>\n"\r
+                                                       "</passages>";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( error );\r
+               XMLTest( "Bad XML", doc.ErrorID(), XML_ERROR_PARSING_ATTRIBUTE );\r
+       }\r
+\r
+       {\r
+               const char* str = "<doc attr0='1' attr1='2.0' attr2='foo' />";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( str );\r
+\r
+               XMLElement* ele = doc.FirstChildElement();\r
+\r
+               int iVal, result;\r
+               double dVal;\r
+\r
+               result = ele->QueryDoubleAttribute( "attr0", &dVal );\r
+               XMLTest( "Query attribute: int as double", result, (int)XML_NO_ERROR );\r
+               XMLTest( "Query attribute: int as double", (int)dVal, 1 );\r
+               result = ele->QueryDoubleAttribute( "attr1", &dVal );\r
+               XMLTest( "Query attribute: double as double", result, (int)XML_NO_ERROR );\r
+               XMLTest( "Query attribute: double as double", (int)dVal, 2 );\r
+               result = ele->QueryIntAttribute( "attr1", &iVal );\r
+               XMLTest( "Query attribute: double as int", result, (int)XML_NO_ERROR );\r
+               XMLTest( "Query attribute: double as int", iVal, 2 );\r
+               result = ele->QueryIntAttribute( "attr2", &iVal );\r
+               XMLTest( "Query attribute: not a number", result, (int)XML_WRONG_ATTRIBUTE_TYPE );\r
+               result = ele->QueryIntAttribute( "bar", &iVal );\r
+               XMLTest( "Query attribute: does not exist", result, (int)XML_NO_ATTRIBUTE );\r
+       }\r
+\r
+       {\r
+               const char* str = "<doc/>";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( str );\r
+\r
+               XMLElement* ele = doc.FirstChildElement();\r
+\r
+               int iVal, iVal2;\r
+               double dVal, dVal2;\r
+\r
+               ele->SetAttribute( "str", "strValue" );\r
+               ele->SetAttribute( "int", 1 );\r
+               ele->SetAttribute( "double", -1.0 );\r
+\r
+               const char* cStr = ele->Attribute( "str" );\r
+               ele->QueryIntAttribute( "int", &iVal );\r
+               ele->QueryDoubleAttribute( "double", &dVal );\r
+\r
+               ele->QueryAttribute( "int", &iVal2 );\r
+               ele->QueryAttribute( "double", &dVal2 );\r
+\r
+               XMLTest( "Attribute match test", ele->Attribute( "str", "strValue" ), "strValue" );\r
+               XMLTest( "Attribute round trip. c-string.", "strValue", cStr );\r
+               XMLTest( "Attribute round trip. int.", 1, iVal );\r
+               XMLTest( "Attribute round trip. double.", -1, (int)dVal );\r
+               XMLTest( "Alternate query", true, iVal == iVal2 );\r
+               XMLTest( "Alternate query", true, dVal == dVal2 );\r
+       }\r
+\r
+       {\r
+               XMLDocument doc;\r
+               doc.LoadFile( "resources/utf8test.xml" );\r
+\r
+               // Get the attribute "value" from the "Russian" element and check it.\r
+               XMLElement* element = doc.FirstChildElement( "document" )->FirstChildElement( "Russian" );\r
+               const unsigned char correctValue[] = {  0xd1U, 0x86U, 0xd0U, 0xb5U, 0xd0U, 0xbdU, 0xd0U, 0xbdU,\r
+                                                                                               0xd0U, 0xbeU, 0xd1U, 0x81U, 0xd1U, 0x82U, 0xd1U, 0x8cU, 0 };\r
+\r
+               XMLTest( "UTF-8: Russian value.", (const char*)correctValue, element->Attribute( "value" ) );\r
+\r
+               const unsigned char russianElementName[] = {    0xd0U, 0xa0U, 0xd1U, 0x83U,\r
+                                                                                                               0xd1U, 0x81U, 0xd1U, 0x81U,\r
+                                                                                                               0xd0U, 0xbaU, 0xd0U, 0xb8U,\r
+                                                                                                               0xd0U, 0xb9U, 0 };\r
+               const char russianText[] = "<\xD0\xB8\xD0\xBC\xD0\xB5\xD0\xB5\xD1\x82>";\r
+\r
+               XMLText* text = doc.FirstChildElement( "document" )->FirstChildElement( (const char*) russianElementName )->FirstChild()->ToText();\r
+               XMLTest( "UTF-8: Browsing russian element name.",\r
+                                russianText,\r
+                                text->Value() );\r
+\r
+               // Now try for a round trip.\r
+               doc.SaveFile( "resources/out/utf8testout.xml" );\r
+\r
+               // Check the round trip.\r
+               int okay = 0;\r
+\r
+               FILE* saved  = fopen( "resources/out/utf8testout.xml", "r" );\r
+               FILE* verify = fopen( "resources/utf8testverify.xml", "r" );\r
+\r
+               if ( saved && verify )\r
+               {\r
+                       okay = 1;\r
+                       char verifyBuf[256];\r
+                       while ( fgets( verifyBuf, 256, verify ) )\r
+                       {\r
+                               char savedBuf[256];\r
+                               fgets( savedBuf, 256, saved );\r
+                               NullLineEndings( verifyBuf );\r
+                               NullLineEndings( savedBuf );\r
+\r
+                               if ( strcmp( verifyBuf, savedBuf ) )\r
+                               {\r
+                                       printf( "verify:%s<\n", verifyBuf );\r
+                                       printf( "saved :%s<\n", savedBuf );\r
+                                       okay = 0;\r
+                                       break;\r
+                               }\r
+                       }\r
+               }\r
+               if ( saved )\r
+                       fclose( saved );\r
+               if ( verify )\r
+                       fclose( verify );\r
+               XMLTest( "UTF-8: Verified multi-language round trip.", 1, okay );\r
+       }\r
+\r
+       // --------GetText()-----------\r
+       {\r
+               const char* str = "<foo>This is  text</foo>";\r
+               XMLDocument doc;\r
+               doc.Parse( str );\r
+               const XMLElement* element = doc.RootElement();\r
+\r
+               XMLTest( "GetText() normal use.", "This is  text", element->GetText() );\r
+\r
+               str = "<foo><b>This is text</b></foo>";\r
+               doc.Parse( str );\r
+               element = doc.RootElement();\r
+\r
+               XMLTest( "GetText() contained element.", element->GetText() == 0, true );\r
+       }\r
+\r
+\r
+       // --------SetText()-----------\r
+       {\r
+               const char* str = "<foo></foo>";\r
+               XMLDocument doc;\r
+               doc.Parse( str );\r
+               XMLElement* element = doc.RootElement();\r
+\r
+               element->SetText("darkness.");\r
+               XMLTest( "SetText() normal use (open/close).", "darkness.", element->GetText() );\r
+\r
+               element->SetText("blue flame.");\r
+               XMLTest( "SetText() replace.", "blue flame.", element->GetText() );\r
+\r
+               str = "<foo/>";\r
+               doc.Parse( str );\r
+               element = doc.RootElement();\r
+\r
+               element->SetText("The driver");\r
+               XMLTest( "SetText() normal use. (self-closing)", "The driver", element->GetText() );\r
+\r
+               element->SetText("<b>horses</b>");\r
+               XMLTest( "SetText() replace with tag-like text.", "<b>horses</b>", element->GetText() );\r
+               //doc.Print();\r
+\r
+               str = "<foo><bar>Text in nested element</bar></foo>";\r
+               doc.Parse( str );\r
+               element = doc.RootElement();\r
+               \r
+               element->SetText("wolves");\r
+               XMLTest( "SetText() prefix to nested non-text children.", "wolves", element->GetText() );\r
+\r
+               str = "<foo/>";\r
+               doc.Parse( str );\r
+               element = doc.RootElement();\r
+               \r
+               element->SetText( "str" );\r
+               XMLTest( "SetText types", "str", element->GetText() );\r
+\r
+               element->SetText( 1 );\r
+               XMLTest( "SetText types", "1", element->GetText() );\r
+\r
+               element->SetText( 1U );\r
+               XMLTest( "SetText types", "1", element->GetText() );\r
+\r
+               element->SetText( true );\r
+               XMLTest( "SetText types", "1", element->GetText() ); // TODO: should be 'true'?\r
+\r
+               element->SetText( 1.5f );\r
+               XMLTest( "SetText types", "1.5", element->GetText() );\r
+\r
+               element->SetText( 1.5 );\r
+               XMLTest( "SetText types", "1.5", element->GetText() );\r
+       }\r
+\r
+\r
+       // ---------- CDATA ---------------\r
+       {\r
+               const char* str =       "<xmlElement>"\r
+                                                               "<![CDATA["\r
+                                                                       "I am > the rules!\n"\r
+                                                                       "...since I make symbolic puns"\r
+                                                               "]]>"\r
+                                                       "</xmlElement>";\r
+               XMLDocument doc;\r
+               doc.Parse( str );\r
+               doc.Print();\r
+\r
+               XMLTest( "CDATA parse.", doc.FirstChildElement()->FirstChild()->Value(),\r
+                                                                "I am > the rules!\n...since I make symbolic puns",\r
+                                                                false );\r
+       }\r
+\r
+       // ----------- CDATA -------------\r
+       {\r
+               const char* str =       "<xmlElement>"\r
+                                                               "<![CDATA["\r
+                                                                       "<b>I am > the rules!</b>\n"\r
+                                                                       "...since I make symbolic puns"\r
+                                                               "]]>"\r
+                                                       "</xmlElement>";\r
+               XMLDocument doc;\r
+               doc.Parse( str );\r
+               doc.Print();\r
+\r
+               XMLTest( "CDATA parse. [ tixml1:1480107 ]", doc.FirstChildElement()->FirstChild()->Value(),\r
+                                                                "<b>I am > the rules!</b>\n...since I make symbolic puns",\r
+                                                                false );\r
+       }\r
+\r
+       // InsertAfterChild causes crash.\r
+       {\r
+               // InsertBeforeChild and InsertAfterChild causes crash.\r
+               XMLDocument doc;\r
+               XMLElement* parent = doc.NewElement( "Parent" );\r
+               doc.InsertFirstChild( parent );\r
+\r
+               XMLElement* childText0 = doc.NewElement( "childText0" );\r
+               XMLElement* childText1 = doc.NewElement( "childText1" );\r
+\r
+               XMLNode* childNode0 = parent->InsertEndChild( childText0 );\r
+               XMLNode* childNode1 = parent->InsertAfterChild( childNode0, childText1 );\r
+\r
+               XMLTest( "Test InsertAfterChild on empty node. ", ( childNode1 == parent->LastChild() ), true );\r
+       }\r
+\r
+       {\r
+               // Entities not being written correctly.\r
+               // From Lynn Allen\r
+\r
+               const char* passages =\r
+                       "<?xml version=\"1.0\" standalone=\"no\" ?>"\r
+                       "<passages count=\"006\" formatversion=\"20020620\">"\r
+                               "<psg context=\"Line 5 has &quot;quotation marks&quot; and &apos;apostrophe marks&apos;."\r
+                               " It also has &lt;, &gt;, and &amp;, as well as a fake copyright &#xA9;.\"> </psg>"\r
+                       "</passages>";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( passages );\r
+               XMLElement* psg = doc.RootElement()->FirstChildElement();\r
+               const char* context = psg->Attribute( "context" );\r
+               const char* expected = "Line 5 has \"quotation marks\" and 'apostrophe marks'. It also has <, >, and &, as well as a fake copyright \xC2\xA9.";\r
+\r
+               XMLTest( "Entity transformation: read. ", expected, context, true );\r
+\r
+               FILE* textfile = fopen( "resources/out/textfile.txt", "w" );\r
+               if ( textfile )\r
+               {\r
+                       XMLPrinter streamer( textfile );\r
+                       psg->Accept( &streamer );\r
+                       fclose( textfile );\r
+               }\r
+\r
+        textfile = fopen( "resources/out/textfile.txt", "r" );\r
+               TIXMLASSERT( textfile );\r
+               if ( textfile )\r
+               {\r
+                       char buf[ 1024 ];\r
+                       fgets( buf, 1024, textfile );\r
+                       XMLTest( "Entity transformation: write. ",\r
+                                        "<psg context=\"Line 5 has &quot;quotation marks&quot; and &apos;apostrophe marks&apos;."\r
+                                        " It also has &lt;, &gt;, and &amp;, as well as a fake copyright \xC2\xA9.\"/>\n",\r
+                                        buf, false );\r
+                       fclose( textfile );\r
+               }\r
+       }\r
+\r
+       {\r
+               // Suppress entities.\r
+               const char* passages =\r
+                       "<?xml version=\"1.0\" standalone=\"no\" ?>"\r
+                       "<passages count=\"006\" formatversion=\"20020620\">"\r
+                               "<psg context=\"Line 5 has &quot;quotation marks&quot; and &apos;apostrophe marks&apos;.\">Crazy &ttk;</psg>"\r
+                       "</passages>";\r
+\r
+               XMLDocument doc( false );\r
+               doc.Parse( passages );\r
+\r
+               XMLTest( "No entity parsing.", doc.FirstChildElement()->FirstChildElement()->Attribute( "context" ),\r
+                                "Line 5 has &quot;quotation marks&quot; and &apos;apostrophe marks&apos;." );\r
+               XMLTest( "No entity parsing.", doc.FirstChildElement()->FirstChildElement()->FirstChild()->Value(),\r
+                                "Crazy &ttk;" );\r
+               doc.Print();\r
+       }\r
+\r
+       {\r
+               const char* test = "<?xml version='1.0'?><a.elem xmi.version='2.0'/>";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( test );\r
+               XMLTest( "dot in names", doc.Error(), false );\r
+               XMLTest( "dot in names", doc.FirstChildElement()->Name(), "a.elem" );\r
+               XMLTest( "dot in names", doc.FirstChildElement()->Attribute( "xmi.version" ), "2.0" );\r
+       }\r
+\r
+       {\r
+               const char* test = "<element><Name>1.1 Start easy ignore fin thickness&#xA;</Name></element>";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( test );\r
+\r
+               XMLText* text = doc.FirstChildElement()->FirstChildElement()->FirstChild()->ToText();\r
+               XMLTest( "Entity with one digit.",\r
+                                text->Value(), "1.1 Start easy ignore fin thickness\n",\r
+                                false );\r
+       }\r
+\r
+       {\r
+               // DOCTYPE not preserved (950171)\r
+               //\r
+               const char* doctype =\r
+                       "<?xml version=\"1.0\" ?>"\r
+                       "<!DOCTYPE PLAY SYSTEM 'play.dtd'>"\r
+                       "<!ELEMENT title (#PCDATA)>"\r
+                       "<!ELEMENT books (title,authors)>"\r
+                       "<element />";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( doctype );\r
+               doc.SaveFile( "resources/out/test7.xml" );\r
+               doc.DeleteChild( doc.RootElement() );\r
+               doc.LoadFile( "resources/out/test7.xml" );\r
+               doc.Print();\r
+\r
+               const XMLUnknown* decl = doc.FirstChild()->NextSibling()->ToUnknown();\r
+               XMLTest( "Correct value of unknown.", "DOCTYPE PLAY SYSTEM 'play.dtd'", decl->Value() );\r
+\r
+       }\r
+\r
+       {\r
+               // Comments do not stream out correctly.\r
+               const char* doctype =\r
+                       "<!-- Somewhat<evil> -->";\r
+               XMLDocument doc;\r
+               doc.Parse( doctype );\r
+\r
+               XMLComment* comment = doc.FirstChild()->ToComment();\r
+\r
+               XMLTest( "Comment formatting.", " Somewhat<evil> ", comment->Value() );\r
+       }\r
+       {\r
+               // Double attributes\r
+               const char* doctype = "<element attr='red' attr='blue' />";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( doctype );\r
+\r
+               XMLTest( "Parsing repeated attributes.", XML_ERROR_PARSING_ATTRIBUTE, doc.ErrorID() );  // is an  error to tinyxml (didn't use to be, but caused issues)\r
+               doc.PrintError();\r
+       }\r
+\r
+       {\r
+               // Embedded null in stream.\r
+               const char* doctype = "<element att\0r='red' attr='blue' />";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( doctype );\r
+               XMLTest( "Embedded null throws error.", true, doc.Error() );\r
+       }\r
+\r
+       {\r
+               // Empty documents should return TIXML_XML_ERROR_PARSING_EMPTY, bug 1070717\r
+               const char* str = "";\r
+               XMLDocument doc;\r
+               doc.Parse( str );\r
+               XMLTest( "Empty document error", XML_ERROR_EMPTY_DOCUMENT, doc.ErrorID() );\r
+       }\r
+\r
+       {\r
+               // Documents with all whitespaces should return TIXML_XML_ERROR_PARSING_EMPTY, bug 1070717\r
+               const char* str = "    ";\r
+               XMLDocument doc;\r
+               doc.Parse( str );\r
+               XMLTest( "All whitespaces document error", XML_ERROR_EMPTY_DOCUMENT, doc.ErrorID() );\r
+       }\r
+\r
+       {\r
+               // Low entities\r
+               XMLDocument doc;\r
+               doc.Parse( "<test>&#x0e;</test>" );\r
+               const char result[] = { 0x0e, 0 };\r
+               XMLTest( "Low entities.", doc.FirstChildElement()->GetText(), result );\r
+               doc.Print();\r
+       }\r
+\r
+       {\r
+               // Attribute values with trailing quotes not handled correctly\r
+               XMLDocument doc;\r
+               doc.Parse( "<foo attribute=bar\" />" );\r
+               XMLTest( "Throw error with bad end quotes.", doc.Error(), true );\r
+       }\r
+\r
+       {\r
+               // [ 1663758 ] Failure to report error on bad XML\r
+               XMLDocument xml;\r
+               xml.Parse("<x>");\r
+               XMLTest("Missing end tag at end of input", xml.Error(), true);\r
+               xml.Parse("<x> ");\r
+               XMLTest("Missing end tag with trailing whitespace", xml.Error(), true);\r
+               xml.Parse("<x></y>");\r
+               XMLTest("Mismatched tags", xml.ErrorID(), XML_ERROR_MISMATCHED_ELEMENT);\r
+       }\r
+\r
+\r
+       {\r
+               // [ 1475201 ] TinyXML parses entities in comments\r
+               XMLDocument xml;\r
+               xml.Parse("<!-- declarations for <head> & <body> -->"\r
+                                 "<!-- far &amp; away -->" );\r
+\r
+               XMLNode* e0 = xml.FirstChild();\r
+               XMLNode* e1 = e0->NextSibling();\r
+               XMLComment* c0 = e0->ToComment();\r
+               XMLComment* c1 = e1->ToComment();\r
+\r
+               XMLTest( "Comments ignore entities.", " declarations for <head> & <body> ", c0->Value(), true );\r
+               XMLTest( "Comments ignore entities.", " far &amp; away ", c1->Value(), true );\r
+       }\r
+\r
+       {\r
+               XMLDocument xml;\r
+               xml.Parse( "<Parent>"\r
+                                               "<child1 att=''/>"\r
+                                               "<!-- With this comment, child2 will not be parsed! -->"\r
+                                               "<child2 att=''/>"\r
+                                       "</Parent>" );\r
+               xml.Print();\r
+\r
+               int count = 0;\r
+\r
+               for( XMLNode* ele = xml.FirstChildElement( "Parent" )->FirstChild();\r
+                        ele;\r
+                        ele = ele->NextSibling() )\r
+               {\r
+                       ++count;\r
+               }\r
+\r
+               XMLTest( "Comments iterate correctly.", 3, count );\r
+       }\r
+\r
+       {\r
+               // trying to repro ]1874301]. If it doesn't go into an infinite loop, all is well.\r
+               unsigned char buf[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?><feed><![CDATA[Test XMLblablablalblbl";\r
+               buf[60] = 239;\r
+               buf[61] = 0;\r
+\r
+               XMLDocument doc;\r
+               doc.Parse( (const char*)buf);\r
+       }\r
+\r
+\r
+       {\r
+               // bug 1827248 Error while parsing a little bit malformed file\r
+               // Actually not malformed - should work.\r
+               XMLDocument xml;\r
+               xml.Parse( "<attributelist> </attributelist >" );\r
+               XMLTest( "Handle end tag whitespace", false, xml.Error() );\r
+       }\r
+\r
+       {\r
+               // This one must not result in an infinite loop\r
+               XMLDocument xml;\r
+               xml.Parse( "<infinite>loop" );\r
+               XMLTest( "Infinite loop test.", true, true );\r
+       }\r
+#endif\r
+       {\r
+               const char* pub = "<?xml version='1.0'?> <element><sub/></element> <!--comment--> <!DOCTYPE>";\r
+               XMLDocument doc;\r
+               doc.Parse( pub );\r
+\r
+               XMLDocument clone;\r
+               for( const XMLNode* node=doc.FirstChild(); node; node=node->NextSibling() ) {\r
+                       XMLNode* copy = node->ShallowClone( &clone );\r
+                       clone.InsertEndChild( copy );\r
+               }\r
+\r
+               clone.Print();\r
+\r
+               int count=0;\r
+               const XMLNode* a=clone.FirstChild();\r
+               const XMLNode* b=doc.FirstChild();\r
+               for( ; a && b; a=a->NextSibling(), b=b->NextSibling() ) {\r
+                       ++count;\r
+                       XMLTest( "Clone and Equal", true, a->ShallowEqual( b ));\r
+               }\r
+               XMLTest( "Clone and Equal", 4, count );\r
+       }\r
+\r
+       {\r
+               // This shouldn't crash.\r
+               XMLDocument doc;\r
+               if(XML_NO_ERROR != doc.LoadFile( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ))\r
+               {\r
+                       doc.PrintError();\r
+               }\r
+               XMLTest( "Error in snprinf handling.", true, doc.Error() );\r
+       }\r
+\r
+       {\r
+               // Attribute ordering.\r
+               static const char* xml = "<element attrib1=\"1\" attrib2=\"2\" attrib3=\"3\" />";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+               XMLElement* ele = doc.FirstChildElement();\r
+\r
+               const XMLAttribute* a = ele->FirstAttribute();\r
+               XMLTest( "Attribute order", "1", a->Value() );\r
+               a = a->Next();\r
+               XMLTest( "Attribute order", "2", a->Value() );\r
+               a = a->Next();\r
+               XMLTest( "Attribute order", "3", a->Value() );\r
+               XMLTest( "Attribute order", "attrib3", a->Name() );\r
+\r
+               ele->DeleteAttribute( "attrib2" );\r
+               a = ele->FirstAttribute();\r
+               XMLTest( "Attribute order", "1", a->Value() );\r
+               a = a->Next();\r
+               XMLTest( "Attribute order", "3", a->Value() );\r
+\r
+               ele->DeleteAttribute( "attrib1" );\r
+               ele->DeleteAttribute( "attrib3" );\r
+               XMLTest( "Attribute order (empty)", false, ele->FirstAttribute() ? true : false );\r
+       }\r
+\r
+       {\r
+               // Make sure an attribute with a space in it succeeds.\r
+               static const char* xml0 = "<element attribute1= \"Test Attribute\"/>";\r
+               static const char* xml1 = "<element attribute1 =\"Test Attribute\"/>";\r
+               static const char* xml2 = "<element attribute1 = \"Test Attribute\"/>";\r
+               XMLDocument doc0;\r
+               doc0.Parse( xml0 );\r
+               XMLDocument doc1;\r
+               doc1.Parse( xml1 );\r
+               XMLDocument doc2;\r
+               doc2.Parse( xml2 );\r
+\r
+               XMLElement* ele = 0;\r
+               ele = doc0.FirstChildElement();\r
+               XMLTest( "Attribute with space #1", "Test Attribute", ele->Attribute( "attribute1" ) );\r
+               ele = doc1.FirstChildElement();\r
+               XMLTest( "Attribute with space #2", "Test Attribute", ele->Attribute( "attribute1" ) );\r
+               ele = doc2.FirstChildElement();\r
+               XMLTest( "Attribute with space #3", "Test Attribute", ele->Attribute( "attribute1" ) );\r
+       }\r
+\r
+       {\r
+               // Make sure we don't go into an infinite loop.\r
+               static const char* xml = "<doc><element attribute='attribute'/><element attribute='attribute'/></doc>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+               XMLElement* ele0 = doc.FirstChildElement()->FirstChildElement();\r
+               XMLElement* ele1 = ele0->NextSiblingElement();\r
+               bool equal = ele0->ShallowEqual( ele1 );\r
+\r
+               XMLTest( "Infinite loop in shallow equal.", true, equal );\r
+       }\r
+\r
+       // -------- Handles ------------\r
+       {\r
+               static const char* xml = "<element attrib='bar'><sub>Text</sub></element>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+\r
+               XMLElement* ele = XMLHandle( doc ).FirstChildElement( "element" ).FirstChild().ToElement();\r
+               XMLTest( "Handle, success, mutable", ele->Value(), "sub" );\r
+\r
+               XMLHandle docH( doc );\r
+               ele = docH.FirstChildElement( "none" ).FirstChildElement( "element" ).ToElement();\r
+               XMLTest( "Handle, dne, mutable", false, ele != 0 );\r
+       }\r
+\r
+       {\r
+               static const char* xml = "<element attrib='bar'><sub>Text</sub></element>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+               XMLConstHandle docH( doc );\r
+\r
+               const XMLElement* ele = docH.FirstChildElement( "element" ).FirstChild().ToElement();\r
+               XMLTest( "Handle, success, const", ele->Value(), "sub" );\r
+\r
+               ele = docH.FirstChildElement( "none" ).FirstChildElement( "element" ).ToElement();\r
+               XMLTest( "Handle, dne, const", false, ele != 0 );\r
+       }\r
+       {\r
+               // Default Declaration & BOM\r
+               XMLDocument doc;\r
+               doc.InsertEndChild( doc.NewDeclaration() );\r
+               doc.SetBOM( true );\r
+\r
+               XMLPrinter printer;\r
+               doc.Print( &printer );\r
+\r
+               static const char* result  = "\xef\xbb\xbf<?xml version=\"1.0\" encoding=\"UTF-8\"?>";\r
+               XMLTest( "BOM and default declaration", printer.CStr(), result, false );\r
+               XMLTest( "CStrSize", printer.CStrSize(), 42, false );\r
+       }\r
+       {\r
+               const char* xml = "<ipxml ws='1'><info bla=' /></ipxml>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+               XMLTest( "Ill formed XML", true, doc.Error() );\r
+       }\r
+\r
+       // QueryXYZText\r
+       {\r
+               const char* xml = "<point> <x>1.2</x> <y>1</y> <z>38</z> <valid>true</valid> </point>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+\r
+               const XMLElement* pointElement = doc.RootElement();\r
+\r
+               int intValue = 0;\r
+               unsigned unsignedValue = 0;\r
+               float floatValue = 0;\r
+               double doubleValue = 0;\r
+               bool boolValue = false;\r
+\r
+               pointElement->FirstChildElement( "y" )->QueryIntText( &intValue );\r
+               pointElement->FirstChildElement( "y" )->QueryUnsignedText( &unsignedValue );\r
+               pointElement->FirstChildElement( "x" )->QueryFloatText( &floatValue );\r
+               pointElement->FirstChildElement( "x" )->QueryDoubleText( &doubleValue );\r
+               pointElement->FirstChildElement( "valid" )->QueryBoolText( &boolValue );\r
+\r
+\r
+               XMLTest( "QueryIntText", intValue, 1,                                           false );\r
+               XMLTest( "QueryUnsignedText", unsignedValue, (unsigned)1,       false );\r
+               XMLTest( "QueryFloatText", floatValue, 1.2f,                            false );\r
+               XMLTest( "QueryDoubleText", doubleValue, 1.2,                           false );\r
+               XMLTest( "QueryBoolText", boolValue, true,                                      false );\r
+       }\r
+\r
+       {\r
+               const char* xml = "<element><_sub/><:sub/><sub:sub/><sub-sub/></element>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+               XMLTest( "Non-alpha element lead letter parses.", doc.Error(), false );\r
+       }\r
+    \r
+    {\r
+        const char* xml = "<element _attr1=\"foo\" :attr2=\"bar\"></element>";\r
+        XMLDocument doc;\r
+        doc.Parse( xml );\r
+        XMLTest("Non-alpha attribute lead character parses.", doc.Error(), false);\r
+    }\r
+    \r
+    {\r
+        const char* xml = "<3lement></3lement>";\r
+        XMLDocument doc;\r
+        doc.Parse( xml );\r
+        XMLTest("Element names with lead digit fail to parse.", doc.Error(), true);\r
+    }\r
+\r
+       {\r
+               const char* xml = "<element/>WOA THIS ISN'T GOING TO PARSE";\r
+               XMLDocument doc;\r
+               doc.Parse( xml, 10 );\r
+               XMLTest( "Set length of incoming data", doc.Error(), false );\r
+       }\r
+\r
+    {\r
+        XMLDocument doc;\r
+        doc.LoadFile( "resources/dream.xml" );\r
+        XMLTest( "Document has something to Clear()", doc.NoChildren(), false );\r
+        doc.Clear();\r
+        XMLTest( "Document Clear()'s", doc.NoChildren(), true );\r
+    }\r
+    \r
+       // ----------- Whitespace ------------\r
+       {\r
+               const char* xml = "<element>"\r
+                                                       "<a> This \nis &apos;  text  &apos; </a>"\r
+                                                       "<b>  This is &apos; text &apos;  \n</b>"\r
+                                                       "<c>This  is  &apos;  \n\n text &apos;</c>"\r
+                                                 "</element>";\r
+               XMLDocument doc( true, COLLAPSE_WHITESPACE );\r
+               doc.Parse( xml );\r
+\r
+               const XMLElement* element = doc.FirstChildElement();\r
+               for( const XMLElement* parent = element->FirstChildElement();\r
+                        parent;\r
+                        parent = parent->NextSiblingElement() )\r
+               {\r
+                       XMLTest( "Whitespace collapse", "This is ' text '", parent->GetText() );\r
+               }\r
+       }\r
+\r
+#if 0\r
+       {\r
+               // Passes if assert doesn't fire.\r
+               XMLDocument xmlDoc;\r
+\r
+           xmlDoc.NewDeclaration();\r
+           xmlDoc.NewComment("Configuration file");\r
+\r
+           XMLElement *root = xmlDoc.NewElement("settings");\r
+           root->SetAttribute("version", 2);\r
+       }\r
+#endif\r
+\r
+       {\r
+               const char* xml = "<element>    </element>";\r
+               XMLDocument doc( true, COLLAPSE_WHITESPACE );\r
+               doc.Parse( xml );\r
+               XMLTest( "Whitespace  all space", true, 0 == doc.FirstChildElement()->FirstChild() );\r
+       }\r
+\r
+       {\r
+               // An assert should not fire.\r
+               const char* xml = "<element/>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+               XMLElement* ele = doc.NewElement( "unused" );           // This will get cleaned up with the 'doc' going out of scope.\r
+               XMLTest( "Tracking unused elements", true, ele != 0, false );\r
+       }\r
+\r
+\r
+       {\r
+               const char* xml = "<parent><child>abc</child></parent>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+               XMLElement* ele = doc.FirstChildElement( "parent")->FirstChildElement( "child");\r
+\r
+               XMLPrinter printer;\r
+               ele->Accept( &printer );\r
+               XMLTest( "Printing of sub-element", "<child>abc</child>\n", printer.CStr(), false );\r
+       }\r
+\r
+\r
+       {\r
+               XMLDocument doc;\r
+               XMLError error = doc.LoadFile( "resources/empty.xml" );\r
+               XMLTest( "Loading an empty file", XML_ERROR_EMPTY_DOCUMENT, error );\r
+               XMLTest( "Loading an empty file and ErrorName as string", "XML_ERROR_EMPTY_DOCUMENT", doc.ErrorName() );\r
+               doc.PrintError();\r
+       }\r
+\r
+       {\r
+        // BOM preservation\r
+        static const char* xml_bom_preservation  = "\xef\xbb\xbf<element/>\n";\r
+        {\r
+                       XMLDocument doc;\r
+                       XMLTest( "BOM preservation (parse)", XML_NO_ERROR, doc.Parse( xml_bom_preservation ), false );\r
+            XMLPrinter printer;\r
+            doc.Print( &printer );\r
+\r
+            XMLTest( "BOM preservation (compare)", xml_bom_preservation, printer.CStr(), false, true );\r
+                       doc.SaveFile( "resources/bomtest.xml" );\r
+        }\r
+               {\r
+                       XMLDocument doc;\r
+                       doc.LoadFile( "resources/bomtest.xml" );\r
+                       XMLTest( "BOM preservation (load)", true, doc.HasBOM(), false );\r
+\r
+            XMLPrinter printer;\r
+            doc.Print( &printer );\r
+            XMLTest( "BOM preservation (compare)", xml_bom_preservation, printer.CStr(), false, true );\r
+               }\r
+       }\r
+\r
+       {\r
+               // Insertion with Removal\r
+               const char* xml = "<?xml version=\"1.0\" ?>"\r
+                       "<root>"\r
+                       "<one>"\r
+                       "<subtree>"\r
+                       "<elem>element 1</elem>text<!-- comment -->"\r
+                       "</subtree>"\r
+                       "</one>"\r
+                       "<two/>"\r
+                       "</root>";\r
+               const char* xmlInsideTwo = "<?xml version=\"1.0\" ?>"\r
+                       "<root>"\r
+                       "<one/>"\r
+                       "<two>"\r
+                       "<subtree>"\r
+                       "<elem>element 1</elem>text<!-- comment -->"\r
+                       "</subtree>"\r
+                       "</two>"\r
+                       "</root>";\r
+               const char* xmlAfterOne = "<?xml version=\"1.0\" ?>"\r
+                       "<root>"\r
+                       "<one/>"\r
+                       "<subtree>"\r
+                       "<elem>element 1</elem>text<!-- comment -->"\r
+                       "</subtree>"\r
+                       "<two/>"\r
+                       "</root>";\r
+               const char* xmlAfterTwo = "<?xml version=\"1.0\" ?>"\r
+                       "<root>"\r
+                       "<one/>"\r
+                       "<two/>"\r
+                       "<subtree>"\r
+                       "<elem>element 1</elem>text<!-- comment -->"\r
+                       "</subtree>"\r
+                       "</root>";\r
+\r
+               XMLDocument doc;\r
+               doc.Parse(xml);\r
+               XMLElement* subtree = doc.RootElement()->FirstChildElement("one")->FirstChildElement("subtree");\r
+               XMLElement* two = doc.RootElement()->FirstChildElement("two");\r
+               two->InsertFirstChild(subtree);\r
+               XMLPrinter printer1(0, true);\r
+               doc.Accept(&printer1);\r
+               XMLTest("Move node from within <one> to <two>", xmlInsideTwo, printer1.CStr());\r
+\r
+               doc.Parse(xml);\r
+               subtree = doc.RootElement()->FirstChildElement("one")->FirstChildElement("subtree");\r
+               two = doc.RootElement()->FirstChildElement("two");\r
+               doc.RootElement()->InsertAfterChild(two, subtree);\r
+               XMLPrinter printer2(0, true);\r
+               doc.Accept(&printer2);\r
+               XMLTest("Move node from within <one> after <two>", xmlAfterTwo, printer2.CStr(), false);\r
+\r
+               doc.Parse(xml);\r
+               XMLNode* one = doc.RootElement()->FirstChildElement("one");\r
+               subtree = one->FirstChildElement("subtree");\r
+               doc.RootElement()->InsertAfterChild(one, subtree);\r
+               XMLPrinter printer3(0, true);\r
+               doc.Accept(&printer3);\r
+               XMLTest("Move node from within <one> after <one>", xmlAfterOne, printer3.CStr(), false);\r
+\r
+               doc.Parse(xml);\r
+               subtree = doc.RootElement()->FirstChildElement("one")->FirstChildElement("subtree");\r
+               two = doc.RootElement()->FirstChildElement("two");\r
+               doc.RootElement()->InsertEndChild(subtree);\r
+               XMLPrinter printer4(0, true);\r
+               doc.Accept(&printer4);\r
+               XMLTest("Move node from within <one> after <two>", xmlAfterTwo, printer4.CStr(), false);\r
+       }\r
+\r
+       {\r
+               const char* xml = "<svg width = \"128\" height = \"128\">"\r
+                       "       <text> </text>"\r
+                       "</svg>";\r
+               XMLDocument doc;\r
+               doc.Parse(xml);\r
+               doc.Print();\r
+       }\r
+\r
+       {\r
+               // Test that it doesn't crash.\r
+               const char* xml = "<?xml version=\"1.0\"?><root><sample><field0><1</field0><field1>2</field1></sample></root>";\r
+               XMLDocument doc;\r
+               doc.Parse(xml);\r
+               doc.PrintError();\r
+       }\r
+\r
+#if 1\r
+               // the question being explored is what kind of print to use: \r
+               // https://github.com/leethomason/tinyxml2/issues/63\r
+       {\r
+               //const char* xml = "<element attrA='123456789.123456789' attrB='1.001e9' attrC='1.0e-10' attrD='1001000000.000000' attrE='0.1234567890123456789'/>";\r
+               const char* xml = "<element/>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+               doc.FirstChildElement()->SetAttribute( "attrA-f64", 123456789.123456789 );\r
+               doc.FirstChildElement()->SetAttribute( "attrB-f64", 1.001e9 );\r
+               doc.FirstChildElement()->SetAttribute( "attrC-f64", 1.0e9 );\r
+               doc.FirstChildElement()->SetAttribute( "attrC-f64", 1.0e20 );\r
+               doc.FirstChildElement()->SetAttribute( "attrD-f64", 1.0e-10 );\r
+               doc.FirstChildElement()->SetAttribute( "attrD-f64", 0.123456789 );\r
+\r
+               doc.FirstChildElement()->SetAttribute( "attrA-f32", 123456789.123456789f );\r
+               doc.FirstChildElement()->SetAttribute( "attrB-f32", 1.001e9f );\r
+               doc.FirstChildElement()->SetAttribute( "attrC-f32", 1.0e9f );\r
+               doc.FirstChildElement()->SetAttribute( "attrC-f32", 1.0e20f );\r
+               doc.FirstChildElement()->SetAttribute( "attrD-f32", 1.0e-10f );\r
+               doc.FirstChildElement()->SetAttribute( "attrD-f32", 0.123456789f );\r
+\r
+               doc.Print();\r
+\r
+               /* The result of this test is platform, compiler, and library version dependent. :("\r
+               XMLPrinter printer;\r
+               doc.Print( &printer );\r
+               XMLTest( "Float and double formatting.", \r
+                       "<element attrA-f64=\"123456789.12345679\" attrB-f64=\"1001000000\" attrC-f64=\"1e+20\" attrD-f64=\"0.123456789\" attrA-f32=\"1.2345679e+08\" attrB-f32=\"1.001e+09\" attrC-f32=\"1e+20\" attrD-f32=\"0.12345679\"/>\n",\r
+                       printer.CStr(), \r
+                       true );\r
+               */\r
+       }\r
+#endif\r
+    \r
+    {\r
+        // Issue #184\r
+        // If it doesn't assert, it passes. Caused by objects\r
+        // getting created during parsing which are then\r
+        // inaccessible in the memory pools.\r
+        {\r
+            XMLDocument doc;\r
+            doc.Parse("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test>");\r
+        }\r
+        {\r
+            XMLDocument doc;\r
+            doc.Parse("<?xml version=\"1.0\" encoding=\"UTF-8\"?><test>");\r
+            doc.Clear();\r
+        }\r
+    }\r
+    \r
+    {\r
+        // If this doesn't assert in DEBUG, all is well.\r
+        tinyxml2::XMLDocument doc;\r
+        tinyxml2::XMLElement *pRoot = doc.NewElement("Root");\r
+        doc.DeleteNode(pRoot);\r
+    }\r
+\r
+       {\r
+               // Should not assert in DEBUG\r
+               XMLPrinter printer;\r
+       }\r
+\r
+       {\r
+               // Issue 291. Should not crash\r
+               const char* xml = "&#0</a>";\r
+               XMLDocument doc;\r
+               doc.Parse( xml );\r
+\r
+               XMLPrinter printer;\r
+               doc.Print( &printer );\r
+       }\r
+\r
+       // ----------- Performance tracking --------------\r
+       {\r
+#if defined( _MSC_VER )\r
+               __int64 start, end, freq;\r
+               QueryPerformanceFrequency( (LARGE_INTEGER*) &freq );\r
+#endif\r
+\r
+               FILE* fp  = fopen( "resources/dream.xml", "r" );\r
+               fseek( fp, 0, SEEK_END );\r
+               long size = ftell( fp );\r
+               fseek( fp, 0, SEEK_SET );\r
+\r
+               char* mem = new char[size+1];\r
+               fread( mem, size, 1, fp );\r
+               fclose( fp );\r
+               mem[size] = 0;\r
+\r
+#if defined( _MSC_VER )\r
+               QueryPerformanceCounter( (LARGE_INTEGER*) &start );\r
+#else\r
+               clock_t cstart = clock();\r
+#endif\r
+               static const int COUNT = 10;\r
+               for( int i=0; i<COUNT; ++i ) {\r
+                       XMLDocument doc;\r
+                       doc.Parse( mem );\r
+               }\r
+#if defined( _MSC_VER )\r
+               QueryPerformanceCounter( (LARGE_INTEGER*) &end );\r
+#else\r
+               clock_t cend = clock();\r
+#endif\r
+\r
+               delete [] mem;\r
+\r
+               static const char* note =\r
+#ifdef DEBUG\r
+                       "DEBUG";\r
+#else\r
+                       "Release";\r
+#endif\r
+\r
+#if defined( _MSC_VER )\r
+               printf( "\nParsing %s of dream.xml: %.3f milli-seconds\n", note, 1000.0 * (double)(end-start) / ( (double)freq * (double)COUNT) );\r
+#else\r
+               printf( "\nParsing %s of dream.xml: %.3f milli-seconds\n", note, (double)(cend - cstart)/(double)COUNT );\r
+#endif\r
+       }\r
+\r
+       #if defined( _MSC_VER ) &&  defined( DEBUG )\r
+               _CrtMemCheckpoint( &endMemState );\r
+\r
+               _CrtMemState diffMemState;\r
+               _CrtMemDifference( &diffMemState, &startMemState, &endMemState );\r
+               _CrtMemDumpStatistics( &diffMemState );\r
+       #endif\r
+\r
+       printf ("\nPass %d, Fail %d\n", gPass, gFail);\r
+\r
+       return gFail;\r
+}\r