Added the improved attribute query
This commit is contained in:
11
tinyxml2.cpp
11
tinyxml2.cpp
@@ -1074,6 +1074,17 @@ const XMLAttribute* XMLElement::FindAttribute( const char* name ) const
|
||||
}
|
||||
|
||||
|
||||
const char* XMLElement::Attribute( const char* name, const char* value ) const
|
||||
{
|
||||
const XMLAttribute* a = FindAttribute( name );
|
||||
if ( !a )
|
||||
return 0;
|
||||
if ( !value || XMLUtil::StringEqual( a->Value(), value ))
|
||||
return a->Value();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const char* XMLElement::GetText() const
|
||||
{
|
||||
if ( FirstChild() && FirstChild()->ToText() ) {
|
||||
|
||||
Reference in New Issue
Block a user