yea its easier just to index axes by their number. direct input allows up to 8 axes on a controller. so named axes probibly some kind of legacy bs that dates back to the era of the game port. i wrote a joystick interface for a r/c transmitter i built. just a simple little sdl application, reads joysticks, reads a bind file and then transmits the data over a transmitter on a fake serial line to what ever device is at the other end. problem is how do you associate an axis with a bind without resorting to some arbitrary data by which to identify your sticks. the trick to keeping your axis indexing correct is to create a joystick hash. i just take the device name string and then append "-" number of axes "-" number of buttons "-" number of hats, and whatever information you can pull from the api. then you generate a crc-32 from the string which is usually descriptive enough to find the device on your system later on to re apply bindings, even if joysticks are unplugged or moved around. i dont think that system ever screwed up (though it might if you have two of the exact same joystick on your system).
what axis name you display to the user can just be an array of strings with the standard axis designations for that index. i think thats what happens anyway. i remember back when the only four axes you had were x,y,z and r. i thing those still are the original designations. then you started seeing xrotation, yrotation, u, v, w, slider0, all kinds of oddball designations that are seldom describing the axis very well.