Source/MediaInfo/XmlUtils.cpp
static const char *AncestorAttrVal(const XMLElement* Elem, const char* AttrName)
{
    if (!Elem)
        return NULL;
    if (const XMLAttribute* Attr=Elem->FindAttribute(AttrName))
        return Attr->Value();
    const XMLElement* ParentElem=NULL;
    if (const XMLNode* ParentNode=Elem->Parent())
        ParentElem=ParentNode->ToElement();
    return AncestorAttrVal(ParentElem, AttrName);
}
// Finds the value of the named attribute within the given element or its
// closest ancestor

Finds the value of the named attribute within the given element or its
closest ancestor
Finds the value of the named attribute within the given element or its closest ancestor
static const char *AncestorAttrVal(const XMLElement* Elem, const char* AttrName)
{
    if (!Elem)
        return NULL;
    if (const XMLAttribute* Attr=Elem->FindAttribute(AttrName))
        return Attr->Value();
    const XMLElement* ParentElem=NULL;
    if (const XMLNode* ParentNode=Elem->Parent())
        ParentElem=ParentNode->ToElement();
    return AncestorAttrVal(ParentElem, AttrName);
}
static const char * AncestorAttrVal ( const XMLElement * Elem , const char * AttrName ) { if ( ! Elem ) return NULL ; if ( const XMLAttribute * Attr = Elem -> FindAttribute ( AttrName ) ) return Attr -> Value ( ) ; const XMLElement * ParentElem = NULL ; if ( const XMLNode * ParentNode = Elem -> Parent ( ) ) ParentElem = ParentNode -> ToElement ( ) ; return AncestorAttrVal ( ParentElem , AttrName ) ; }
Finds the value of the named attribute within the given element or its
closest ancestor
Finds the value of the named attribute within the given element or its closest ancestor