ndmitchell / tagsoup

Haskell library for parsing and extracting information from (possibly malformed) HTML/XML documents
Other
231 stars 37 forks source link

Support for well-formed XML validation #7

Open kc1212 opened 9 years ago

kc1212 commented 9 years ago

TagWarning is to used to check whether the individual XML tags are correct if not mistaken. I am not aware of a function that checks the soundness of the whole structure, i.e. all TagOpen have a corresponding TagClose.

Are there plans to add this feature or is this something expected from the user? Thanks.

ndmitchell commented 9 years ago

It was expected from the user. That said, it seems perfectly reasonable to add warnings about both duplicate field names and incorrectly nested tags, likely as additional fields to ParseOptions - or alternatively to have separate functions to do that check that are bundled in the package. I'd welcome pull requests for both features.

ChristopherKing42 commented 8 years ago

You can use the tree library, and check if there are any dangling TagOpen's.