XML – Haskell – Aelve Guidehttps://guide.aelve.com/haskell/feed/category/klgi6e262017-09-27T21:48:28Zdjvwhva7xml-conduit2017-09-27T21:48:28Z<h1> <span class="item-name">xml-conduit</span>
(<a href="https://hackage.haskell.org/package/xml-conduit">Hackage</a>)
</h1><p>Streaming parsing, but has a useful non-streaming interface as well. Uses <code>Text</code> and <code>ByteString</code>.</p>
<h2>Pros</h2><ul><p><li>Can parse entity references, including entities defined in the internal subset, as well as leaving entity references unresolved in the document for your code to handle itself.</li></p><p><li>Uses <code>Text</code>.</li></p><p><li>The streaming interface provides position information.</li></p></ul><h2>Cons</h2><ul><p><li>Heavyweight in terms of dependencies</li></p></ul><h2>Ecosystem</h2><p>Uses <code>xml-types</code> for its unresolved-entity types. In theory this allows inter-operation, but nothing else seems to buy into <code>xml-types</code>, and the easier-out-of-the-box resolved-entity interface is defined by <code>xml-conduit</code>.</p>
hwck5g7uxmlhtml2017-09-27T19:44:11Z<h1> <span class="item-name">xmlhtml</span>
(<a href="https://hackage.haskell.org/package/xmlhtml">Hackage</a>)
</h1><p>XML and HTML 5 parsing and rendering.</p>
<h2>Pros</h2><ul><p><li>Memory efficient</li></p></ul><h2>Cons</h2><ul><p><li>Both parsers are written to parse document fragments, not complete documents</li></p><p><li>The XML parser is incapable of handling processing instructions, or defined entities</li></p><p><li>The HTML parser is really an XML parser with HTML 5 quirks mode</li></p><p><li>No position information</li></p></ul>xxlhqgf8xml2017-09-27T19:44:07Z<h1> <span class="item-name">xml</span>
(<a href="https://hackage.haskell.org/package/xml">Hackage</a>)
</h1><p>Light-weight library for simple parsing and creation of XML documents.</p>
<h2>Pros</h2><ul><p><li>Small dependency set (<a href="https://hackage.haskell.org/package/base">base</a>, <a href="https://hackage.haskell.org/package/bytestring">bytestring</a> and <a href="https://hackage.haskell.org/package/text">text</a>)</li></p></ul><h2>Cons</h2><ul><p><li>Minimal docs and no example/tutorial</li></p><p><li>Memory inefficient (uses <code>String</code>)</li></p><p><li>No position information</li></p></ul>