There are no attributes in the SVG namespace (http://www.w3.org/2000/svg) in SVG. Only elements are in the SVG namespace.

So for attribute setting in general you want setAttribute except for xlink:href (SVG 1.1) and the rarely used xml:space attribute (also SVG 1.1). SVG 2 will do away with both of these exceptions so that all attributes will be able to be set with setAttribute.