http://www.perlmonks.org?node_id=182657


in reply to Re: Re: •Re: XML::Parser and Invalid XML
in thread XML::Parser and Invalid XML

As it says in the fine manual:
Caveats Some care is required in creating data structures which will be passed to "XMLout()". Hash keys from the data structure will be encoded as either XML element names or attribute names. Therefore, you should use hash key names which conform to the relatively strict XML naming rules: Names in XML must begin with a letter. The remaining characters may be letters, digits, hyphens (-), under- scores (_) or full stops (.). It is also allowable to include one colon (:) in an element name but this should only be used when working with namespaces - a facility well beyond the scope of XML::Simple. You can use other punctuation characters in hash values (just not in hash keys) however XML::Simple does not sup- port dumping binary data. If you break these rules, the current implementation of "XMLout()" will simply emit non-compliant XML which will be rejected if you try to read it back in. (A later ver- sion of XML::Simple might take a more proactive approach).

-- Randal L. Schwartz, Perl hacker