----------------------------------------------------------------------------- Get attribute value if it exists. -----------------------------------------------------------------------------
| 542 | // Get attribute value if it exists. |
| 543 | // ----------------------------------------------------------------------------- |
| 544 | const char* SimXMLDocument::attribute(const char* rAttribute) |
| 545 | { |
| 546 | if(m_paNode.empty()) |
| 547 | { |
| 548 | return StringTable->EmptyString(); |
| 549 | } |
| 550 | const S32 iLastElement = m_paNode.size() - 1; |
| 551 | TiXmlElement* pNode = m_paNode[iLastElement]; |
| 552 | if(!pNode) |
| 553 | { |
| 554 | return StringTable->EmptyString(); |
| 555 | } |
| 556 | |
| 557 | if(!pNode->Attribute(rAttribute)) |
| 558 | { |
| 559 | return StringTable->EmptyString(); |
| 560 | } |
| 561 | |
| 562 | return pNode->Attribute(rAttribute); |
| 563 | } |
| 564 | |
| 565 | DefineEngineMethod( SimXMLDocument, attribute, const char*, ( const char* attributeName ),, |
| 566 | "@brief Get a string attribute from the current Element on the stack.\n\n" |
no test coverage detected