ocramz / xeno

Fast Haskell XML parser
Other
120 stars 33 forks source link

Invalid parsing/validation #10

Closed qrilka closed 6 years ago

qrilka commented 7 years ago

As I understand the idea of this lib is to follow more or less hexml so I was using it as a base for comparison. Some found inconsistencies:

  1. Not closed tags accepted by validate
    λ> isRight $ Text.XML.Hexml.parse "<b>"
    False
    λ> Xeno.SAX.validate "<b>"
    True
  2. Leading whitespace characters don't get accepted by Xeno.DOM:
    λ> isRight $ Xeno.DOM.parse "\n<a></a>"
    False
    λ> isRight $ Text.XML.Hexml.parse "\n<a></a>"
    True
  3. XML prologue gets accepted by validate but not by Xeno.DOM.parse
    λ> isRight $ Text.XML.Hexml.parse "<?xml version=\"1.1\"?>\n<greeting>Hello, world!</greeting>"
    True
    λ> isRight $ Xeno.DOM.parse "<?xml version=\"1.1\"?>\n<greeting>Hello, world!</greeting>"
    False
dredozubov commented 6 years ago

Makes sense to split into 3 separate issues, I guess.

ocramz commented 6 years ago

@qrilka @dredozubov @chrisdone Split this into #14 , #15 and #16 .