*.o
*.vc.db
*.vc.opendb
+libtinyxml2.a
+xmltest
################################\r
# set lib version here\r
\r
-set(GENERIC_LIB_VERSION "7.1.0")\r
-set(GENERIC_LIB_SOVERSION "7")\r
+set(GENERIC_LIB_VERSION "8.0.0")\r
+set(GENERIC_LIB_SOVERSION "8")\r
\r
################################\r
# Add definitions\r
\r
install(TARGETS tinyxml2\r
EXPORT ${CMAKE_PROJECT_NAME}Targets\r
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}\r
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}\r
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})\r
+ RUNTIME \r
+ DESTINATION ${CMAKE_INSTALL_BINDIR}\r
+ COMPONENT tinyxml2_runtime\r
+ LIBRARY \r
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}\r
+ COMPONENT tinyxml2_libraries\r
+ ARCHIVE \r
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}\r
+ COMPONENT tinyxml2_libraries)\r
\r
if(BUILD_TESTING AND BUILD_TESTS)\r
add_executable(xmltest xmltest.cpp)\r
add_test(NAME xmltest COMMAND xmltest WORKING_DIRECTORY $<TARGET_FILE_DIR:xmltest>)\r
endif()\r
\r
-install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})\r
+install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT tinyxml2_headers)\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
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT tinyxml2_config)\r
\r
# uninstall target\r
if(NOT TARGET uninstall)\r
install(FILES\r
${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake\r
${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake\r
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME})\r
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}\r
+ COMPONENT tinyxml2_config)\r
\r
install(EXPORT ${CMAKE_PROJECT_NAME}Targets NAMESPACE tinyxml2::\r
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME})\r
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}\r
+ COMPONENT tinyxml2_config)\r
# could be handy for archiving the generated documentation or if some version\r
# control system is used.\r
\r
-PROJECT_NUMBER = 7.1.0\r
+PROJECT_NUMBER = 8.0.0\r
\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
And additionally a test file:
* xmltest.cpp
-Simply compile and run. There is a visual studio 2017 project included, a simple Makefile,
+Simply compile and run. There is a visual studio 2019 project included, a simple Makefile,
an Xcode project, a Code::Blocks project, and a cmake CMakeLists.txt included to help you.
The top of tinyxml.h even has a simple g++ command line if you are using Unix/Linux/BSD and
don't want to use a build system.
+Building TinyXML-2 - Using vcpkg
+--------------------------------
+
+You can download and install TinyXML-2 using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:
+
+ git clone https://github.com/Microsoft/vcpkg.git
+ cd vcpkg
+ ./bootstrap-vcpkg.sh
+ ./vcpkg integrate install
+ ./vcpkg install tinyxml2
+
+The TinyXML-2 port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
+
Versioning
----------
*value = (ival==0) ? false : true;\r
return true;\r
}\r
- static const char* TRUE[] = { "true", "True", "TRUE", 0 };\r
- static const char* FALSE[] = { "false", "False", "FALSE", 0 };\r
+ static const char* TRUE_VALS[] = { "true", "True", "TRUE", 0 };\r
+ static const char* FALSE_VALS[] = { "false", "False", "FALSE", 0 };\r
\r
- for (int i = 0; TRUE[i]; ++i) {\r
- if (StringEqual(str, TRUE[i])) {\r
+ for (int i = 0; TRUE_VALS[i]; ++i) {\r
+ if (StringEqual(str, TRUE_VALS[i])) {\r
*value = true;\r
return true;\r
}\r
}\r
- for (int i = 0; FALSE[i]; ++i) {\r
- if (StringEqual(str, FALSE[i])) {\r
+ for (int i = 0; FALSE_VALS[i]; ++i) {\r
+ if (StringEqual(str, FALSE_VALS[i])) {\r
*value = false;\r
return true;\r
}\r
return attrib;\r
}\r
\r
+\r
+XMLElement* XMLElement::InsertNewChildElement(const char* name)\r
+{\r
+ XMLElement* node = _document->NewElement(name);\r
+ return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+XMLComment* XMLElement::InsertNewComment(const char* comment)\r
+{\r
+ XMLComment* node = _document->NewComment(comment);\r
+ return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+XMLText* XMLElement::InsertNewText(const char* text)\r
+{\r
+ XMLText* node = _document->NewText(text);\r
+ return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+XMLDeclaration* XMLElement::InsertNewDeclaration(const char* text)\r
+{\r
+ XMLDeclaration* node = _document->NewDeclaration(text);\r
+ return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+XMLUnknown* XMLElement::InsertNewUnknown(const char* text)\r
+{\r
+ XMLUnknown* node = _document->NewUnknown(text);\r
+ return InsertEndChild(node) ? node : 0;\r
+}\r
+\r
+\r
+\r
//\r
// <ele></ele>\r
// <ele>foo<b>bar</b></ele>\r
}\r
\r
\r
-void XMLDocument::MarkInUse(XMLNode* node)\r
+void XMLDocument::MarkInUse(const XMLNode* const node)\r
{\r
TIXMLASSERT(node);\r
TIXMLASSERT(node->_parent == 0);\r
\r
if ( _textDepth < 0 && !_firstElement && !compactMode ) {\r
Putc( '\n' );\r
- }\r
- if ( !compactMode ) {\r
PrintSpace( _depth );\r
}\r
\r
/* Versioning, past 1.0.14:\r
http://semver.org/\r
*/\r
-static const int TIXML2_MAJOR_VERSION = 7;\r
-static const int TIXML2_MINOR_VERSION = 1;\r
+static const int TIXML2_MAJOR_VERSION = 8;\r
+static const int TIXML2_MINOR_VERSION = 0;\r
static const int TIXML2_PATCH_VERSION = 0;\r
\r
-#define TINYXML2_MAJOR_VERSION 7\r
-#define TINYXML2_MINOR_VERSION 1\r
+#define TINYXML2_MAJOR_VERSION 8\r
+#define TINYXML2_MINOR_VERSION 0\r
#define TINYXML2_PATCH_VERSION 0\r
\r
// A fixed element depth limit is problematic. There needs to be a\r
TIXMLASSERT( p );\r
return p;\r
}\r
- static char* SkipWhiteSpace( char* p, int* curLineNumPtr ) {\r
+ static char* SkipWhiteSpace( char* const p, int* curLineNumPtr ) {\r
return const_cast<char*>( SkipWhiteSpace( const_cast<const char*>(p), curLineNumPtr ) );\r
}\r
\r
return strncmp( p, q, nChar ) == 0;\r
}\r
\r
- inline static bool IsUTF8Continuation( char p ) {\r
+ inline static bool IsUTF8Continuation( const char p ) {\r
return ( p & 0x80 ) != 0;\r
}\r
\r
/// See QueryIntText()\r
double DoubleText(double defaultValue = 0) const;\r
/// See QueryIntText()\r
- float FloatText(float defaultValue = 0) const;\r
+ float FloatText(float defaultValue = 0) const;\r
+\r
+ /**\r
+ Convenience method to create a new XMLElement and add it as last (right)\r
+ child of this node. Returns the created and inserted element.\r
+ */\r
+ XMLElement* InsertNewChildElement(const char* name);\r
+ /// See InsertNewChildElement()\r
+ XMLComment* InsertNewComment(const char* comment);\r
+ /// See InsertNewChildElement()\r
+ XMLText* InsertNewText(const char* text);\r
+ /// See InsertNewChildElement()\r
+ XMLDeclaration* InsertNewDeclaration(const char* text);\r
+ /// See InsertNewChildElement()\r
+ XMLUnknown* InsertNewUnknown(const char* text);\r
+\r
\r
// internal:\r
enum ElementClosingType {\r
char* Identify( char* p, XMLNode** node );\r
\r
// internal\r
- void MarkInUse(XMLNode*);\r
+ void MarkInUse(const XMLNode* const);\r
\r
virtual XMLNode* ShallowClone( XMLDocument* /*document*/ ) const {\r
return 0;\r
<PropertyGroup Label="Globals">\r
<ProjectGuid>{E8FB2712-8666-4662-A5B8-2B5B0FB1A260}</ProjectGuid>\r
<RootNamespace>test</RootNamespace>\r
- <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>\r
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\r
</PropertyGroup>\r
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<CharacterSet>Unicode</CharacterSet>\r
<ProjectGuid>{D1C528B6-AA02-4D29-9D61-DC08E317A70D}</ProjectGuid>\r
<Keyword>Win32Proj</Keyword>\r
<RootNamespace>tinyxml2</RootNamespace>\r
- <WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>\r
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\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
- <PlatformToolset>v141</PlatformToolset>\r
+ <PlatformToolset>v142</PlatformToolset>\r
</PropertyGroup>\r
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
<ConfigurationType>StaticLibrary</ConfigurationType>\r
printer.PushAttribute("attrib-int", int(1));\r
printer.PushAttribute("attrib-unsigned", unsigned(2));\r
printer.PushAttribute("attrib-int64", int64_t(3));\r
- printer.PushAttribute("attrib-uint64", uint64_t(37));\r
- printer.PushAttribute("attrib-bool", true);\r
+ printer.PushAttribute("attrib-uint64", uint64_t(37));\r
+ printer.PushAttribute("attrib-bool", true);\r
printer.PushAttribute("attrib-double", 4.0);\r
printer.CloseElement();\r
fclose(printerfp);\r
XMLTest("attrib-unsigned", unsigned(2), attrib->UnsignedValue(), true);\r
attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-int64");\r
XMLTest("attrib-int64", int64_t(3), attrib->Int64Value(), true);\r
- attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-uint64");\r
- XMLTest("attrib-uint64", uint64_t(37), attrib->Unsigned64Value(), true);\r
- attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-bool");\r
+ attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-uint64");\r
+ XMLTest("attrib-uint64", uint64_t(37), attrib->Unsigned64Value(), true);\r
+ attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-bool");\r
XMLTest("attrib-bool", true, attrib->BoolValue(), true);\r
attrib = cdoc.FirstChildElement("foo")->FindAttribute("attrib-double");\r
XMLTest("attrib-double", 4.0, attrib->DoubleValue(), true);\r
}\r
+ // Add API_testcatse :PushDeclaration();PushText();PushComment()\r
+ {\r
+ FILE* fp1 = fopen("resources/out/printer_1.xml", "w");\r
+ XMLPrinter printer(fp1);\r
+\r
+ printer.PushDeclaration("version = '1.0' enconding = 'utf-8'");\r
+\r
+ printer.OpenElement("foo");\r
+ printer.PushAttribute("attrib-text", "text");\r
+\r
+ printer.OpenElement("text");\r
+ printer.PushText("Tinyxml2");\r
+ printer.CloseElement();\r
+\r
+ printer.OpenElement("int");\r
+ printer.PushText(int(11));\r
+ printer.CloseElement();\r
+\r
+ printer.OpenElement("unsigned");\r
+ printer.PushText(unsigned(12));\r
+ printer.CloseElement();\r
+\r
+ printer.OpenElement("int64_t");\r
+ printer.PushText(int64_t(13));\r
+ printer.CloseElement();\r
+\r
+ printer.OpenElement("uint64_t");\r
+ printer.PushText(uint64_t(14));\r
+ printer.CloseElement();\r
+\r
+ printer.OpenElement("bool");\r
+ printer.PushText(true);\r
+ printer.CloseElement();\r
+\r
+ printer.OpenElement("float");\r
+ printer.PushText("1.56");\r
+ printer.CloseElement();\r
+\r
+ printer.OpenElement("double");\r
+ printer.PushText("12.12");\r
+ printer.CloseElement();\r
\r
+ printer.OpenElement("comment");\r
+ printer.PushComment("this is Tinyxml2");\r
+ printer.CloseElement();\r
+\r
+ printer.CloseElement();\r
+ fclose(fp1);\r
+ }\r
+ {\r
+ XMLDocument doc;\r
+ doc.LoadFile("resources/out/printer_1.xml");\r
+ XMLTest("XMLPrinter Stream mode: load", XML_SUCCESS, doc.ErrorID(), true);\r
+\r
+ const XMLDocument& cdoc = doc;\r
+\r
+ const XMLElement* root = cdoc.FirstChildElement("foo");\r
+\r
+ const char* text_value;\r
+ text_value = root->FirstChildElement("text")->GetText();\r
+ XMLTest("PushText( const char* text, bool cdata=false ) test", "Tinyxml2", text_value);\r
+\r
+ int int_value;\r
+ int_value = root->FirstChildElement("int")->IntText();\r
+ XMLTest("PushText( int value ) test", 11, int_value);\r
+\r
+ unsigned unsigned_value;\r
+ unsigned_value = root->FirstChildElement("unsigned")->UnsignedText();\r
+ XMLTest("PushText( unsigned value ) test", (unsigned)12, unsigned_value);\r
+\r
+ int64_t int64_t_value;\r
+ int64_t_value = root->FirstChildElement("int64_t")->Int64Text();\r
+ XMLTest("PushText( int64_t value ) test", (int64_t) 13, int64_t_value);\r
+\r
+ uint64_t uint64_t_value;\r
+ uint64_t_value = root->FirstChildElement("uint64_t")->Unsigned64Text();\r
+ XMLTest("PushText( uint64_t value ) test", (uint64_t) 14, uint64_t_value);\r
+\r
+ float float_value;\r
+ float_value = root->FirstChildElement("float")->FloatText();\r
+ XMLTest("PushText( float value ) test", 1.56f, float_value);\r
+\r
+ double double_value;\r
+ double_value = root->FirstChildElement("double")->DoubleText();\r
+ XMLTest("PushText( double value ) test", 12.12, double_value);\r
+\r
+ bool bool_value;\r
+ bool_value = root->FirstChildElement("bool")->BoolText();\r
+ XMLTest("PushText( bool value ) test", true, bool_value);\r
+\r
+ const XMLComment* comment = root->FirstChildElement("comment")->FirstChild()->ToComment();\r
+ const char* comment_value = comment->Value();\r
+ XMLTest("PushComment() test", "this is Tinyxml2", comment_value);\r
+\r
+ const XMLDeclaration* declaration = cdoc.FirstChild()->ToDeclaration();\r
+ const char* declaration_value = declaration->Value();\r
+ XMLTest("PushDeclaration() test", "version = '1.0' enconding = 'utf-8'", declaration_value);\r
+ }\r
}\r
\r
\r
}\r
\r
{\r
- // trying to repro ]1874301]. If it doesn't go into an infinite loop, all is well.\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