Subject: | as_XML will not allow single-character attribute names |
While working to mangle an XML file (part of a .docx file) I ran into a bug in HTML::Element.
HTML::Element didn't like the attribute name "x" because it was a single letter. The RegEx you have for validating names (on line 2776 of version 5.03, shown below) requires at least a two-character name:
return (0) unless ( $attr =~ /^$START_CHAR$NAME_CHAR+$/ );
Whereas the discussion of names on w3.org (just above http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-Nmtoken) states (emphasis mine):
The first character of a Name must be a NameStartChar, and any other characters must be NameChars…
While I agree that it's a good idea to have multi-character names, I doubt I can convince Microsoft of that.