Issue #25019: Fixed a crash caused by setting non-string key of expat parser.
Added additional tests for expat parser attributes.
Based on patch by John Leitch.