You are already hardcoding in the form of the enum. I know you have another program to auto generate those, but you could just as easily do something similar with strings. Eg, one decent idea would be to load these from a text file* into something like:
Code:
map<string, <vector<string*> > htmltags;
So the map would be key/value pairs: the key (string) would be the name of the tag, the value (vector) would be a list of possible attributes (these could be pointers into a similar map of attributes with vectors of possible values). That would eliminate the need for some of these functions, I think.
WRT to memory, that is the point of references and pointers (also, html tag names are generally quite short -- a enum int is still 4 bytes).
As it is now, it sounds like you are having to do the enum to string conversion basically everywhere you use the enum anyway.