You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the initializers are failable, as a user we'd expect it to fail for invalid documents. Now, I can understand that not all users might want this, but could it be made available as an option? For example, modify the initialisers to accept an extra options parameter, by default set to
Description:
Reading a broken XML throws an error.
Fuzi recovers and parses the XML partially (up to the error).
Environment
How to reproduce:
While unit testing our library, we want to catch that our parser fails on invalid documents. Instead, the broken file gets partially parsed, because Fuzi sets the option to ignore errors (XML_PARSE_NOERROR): https://github.com/cezheng/Fuzi/blob/master/Sources/Document.swift#L112
As the initializers are failable, as a user we'd expect it to fail for invalid documents. Now, I can understand that not all users might want this, but could it be made available as an option? For example, modify the initialisers to accept an extra
options
parameter, by default set toEven better would be to provide a swift OptionSet that maps to the libxml values.
Example faulty XML:
The text was updated successfully, but these errors were encountered: