You do not check whether the name attribute is set; in which case an exception should be thrown