diff --git a/CMakeLists.txt b/CMakeLists.txt index cdfc66c..53f09c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ include(GNUInstallDirs) ################################ # set lib version here -set(GENERIC_LIB_VERSION "1.0.4") +set(GENERIC_LIB_VERSION "1.0.5") set(GENERIC_LIB_SOVERSION "1") diff --git a/dox b/dox index 0818de4..5a9e9d3 100755 --- a/dox +++ b/dox @@ -32,7 +32,7 @@ PROJECT_NAME = "TinyXML-2" # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.0.4 +PROJECT_NUMBER = 1.0.5 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer diff --git a/tinyxml2.cpp b/tinyxml2.cpp index e4ac977..08917e1 100644 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -914,13 +914,22 @@ bool XMLUnknown::Accept( XMLVisitor* visitor ) const // --------- XMLAttribute ---------- // char* XMLAttribute::ParseDeep( char* p, bool processEntities ) { - p = name.ParseText( p, "=", StrPair::ATTRIBUTE_NAME ); + // Parse using the name rules: bug fix, was using ParseText before + p = name.ParseName( p ); if ( !p || !*p ) return 0; + // Skip white space before = + p = XMLUtil::SkipWhiteSpace( p ); + if ( !p || *p != '=' ) return 0; + + ++p; // move up to opening quote + p = XMLUtil::SkipWhiteSpace( p ); + if ( *p != '\"' && *p != '\'' ) return 0; + char endTag[2] = { *p, 0 }; - ++p; + ++p; // move past opening quote + p = value.ParseText( p, endTag, processEntities ? StrPair::ATTRIBUTE_VALUE : StrPair::ATTRIBUTE_VALUE_LEAVE_ENTITIES ); - //if ( value.Empty() ) return 0; return p; } diff --git a/tinyxml2.h b/tinyxml2.h index e231f09..a47cc62 100644 --- a/tinyxml2.h +++ b/tinyxml2.h @@ -85,7 +85,7 @@ distribution. static const int TIXML2_MAJOR_VERSION = 1; static const int TIXML2_MINOR_VERSION = 0; -static const int TIXML2_PATCH_VERSION = 4; +static const int TIXML2_PATCH_VERSION = 5; namespace tinyxml2 { @@ -134,7 +134,7 @@ public: void SetInternedStr( const char* str ) { Reset(); this->start = const_cast(str); } void SetStr( const char* str, int flags=0 ); - char* ParseText( char* in, const char* endTag, int strFlags ); + char* ParseText( char* in, const char* endTag, int strFlags ); char* ParseName( char* in ); diff --git a/xmltest.cpp b/xmltest.cpp index 9585d04..760d0e2 100644 --- a/xmltest.cpp +++ b/xmltest.cpp @@ -795,12 +795,23 @@ int main( int /*argc*/, const char ** /*argv*/ ) { // Make sure an attribute with a space in it succeeds. - static const char* xml = ""; - XMLDocument doc; - doc.Parse( xml ); + static const char* xml0 = ""; + static const char* xml1 = ""; + static const char* xml2 = ""; + XMLDocument doc0; + doc0.Parse( xml0 ); + XMLDocument doc1; + doc1.Parse( xml1 ); + XMLDocument doc2; + doc2.Parse( xml2 ); - XMLElement* ele = doc.FirstChildElement(); - XMLTest( "Attribute with space", "Test Attribute", ele->Attribute( "attribute1" ) ); + XMLElement* ele = 0; + ele = doc0.FirstChildElement(); + XMLTest( "Attribute with space #1", "Test Attribute", ele->Attribute( "attribute1" ) ); + ele = doc1.FirstChildElement(); + XMLTest( "Attribute with space #2", "Test Attribute", ele->Attribute( "attribute1" ) ); + ele = doc2.FirstChildElement(); + XMLTest( "Attribute with space #3", "Test Attribute", ele->Attribute( "attribute1" ) ); } {