Added the improved attribute query

This commit is contained in:
Lee Thomason
2012-03-24 13:04:04 -07:00
parent c50b6b4e7e
commit 8ba7f7d69b
3 changed files with 28 additions and 1 deletions

View File

@@ -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() ) {