CMarkup HasChildAttrib Method

bool CMarkup::HasChildAttrib( MCD_CSTR szAttrib, MCD_STR* pstrValue = NULL ) const;

CMarkup Developer License

HasChildAttrib is only in CMarkup Developer and the free XML editor  FOAL C++ scripting.

Call HasChildAttrib to find out if the specified attribute exists in the current child position element. Since the GetChildAttrib method returns an empty string whether the element has the attribute with an empty value or does not have the attribute. This method is useful to distinguish whether the element has the attribute at all.

This will return true even if the specified attribute value is empty!

Update February 5, 2011: With release 11.4, use the optional pstrValue argument to retrieve the attribute value. Now you can use HasChildAttrib instead of GetChildAttrib to get an attribute value at the same time as discovering whether the attribute exists.

See HasAttrib.