<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head> <title>name to id</title> </head> <body> <p> <a id="a1" name="a2">a </a> </p> </body> </html>