According to the official W3C spec on XHTML 1.0, the NAME attribute is just a CDATA, which can be any valid text.
XHTML 1.0 Transitional DTD The ID attribute, however, is an ID field which MUST be unique across the entire document. The ID attribute is used by JavaScript to search out specific objects on the page:
Duplicate NAMEs get passed to server forms as:
form.asp?SomeName=1&SomeName=2&SomeName=3
So your server script should be prepared to handle them as an array or something.