Fix the bug of ahf:getAttribute and ahf:getAttributeValue

Return correct attribute (or value) when there are multiple
attribute-sets with same names.