Considering such an enumeration :
type
TTypeOfData = (
[XmlName(\'ABC\')] todABC,
[XmlName(\'DEF\')] todDEF,
[XmlName(\'GHI\')] todGHI
);
Ok I think I have found a better solution. I declare a new attribute type, e.g.:
TEnumAttribute = class (TCustomAttribute)
private
FCaption : string;
public
constructor Create (const Caption : string);
property Caption : string read FCaption write FCaption;
end;
Now I add attributes to my enumeration:
[TEnumAttribute ('Normal')]
[TEnumAttribute ('High')]
TExampleEnum = (eeNormal,eeHigh);
Now it is easy to access the attributes by its ordinal:
RttiType := RttiContext.FindType ('ExampleUnit.TExampleEnum');
RttiAttributes := Rttitype.GetAttributes;
Test := TEnumAttributes(RttiAttributes[index]).Caption;