Bug 935017 - Sanitize attributes before appending the element. r=gandalf