ndmitchell / hexml

A bad XML parser
Other
19 stars 4 forks source link

Dots in attribute names #13

Closed zudov closed 6 years ago

zudov commented 6 years ago

To my knowledge having dots in attribute names is valid, but it doesn't seem to match hexml's expectations.

> import qualified Text.XML.Hexml as Hexml                                                                                    
> :set -XOverloadedStrings                                                                                              
> Hexml.parse "<foo bar.baz=\"qux\"></foo>"                                                                             
Left "Expected = in attribute, but missing"
> Hexml.parse "<foo bar_baz=\"qux\"></foo>"
Right Node "<foo bar_baz=\"qux\"></foo>"
ndmitchell commented 6 years ago

https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Name applies, so yes, I guess . is a valid attribute name - thanks for spotting it.

ndmitchell commented 6 years ago

Fixed and released in hexml-0.3.3. Thanks for the bug report - a complete oversight, given I did check the list of allowed characters when writing it and just missed one of them.

zudov commented 6 years ago

Thanks for the prompt fix