The xml-conduit tutorial (the only one in existence, and perhaps the only Haskell XML library with a tutorial) shows how to create or read an XML document, but not how to modify one. The only way I am familiar with such operations is using lxml/elementtree (python), which only works through side-effect (that I'm aware of). I suspect a very different approach here.
Say that I have a simple document:
<html>
<head>
<title>My <b>Title</b></title>
</head>
<body>
<p>Paragraph 1.</p>
<p>Paragraph 2.</p>
</body>
</html>
How to:
- Modify the title?
- Delete the first paragraph in this document?
- Append the body of this document to the body of another document?
Feel free to propose and contribute a solution using other Haskell libraries. The community could use many more examples.
element, including the text node within, is a mere modification of the contents of
. – Bjartur Thorlacius Apr 03 '20 at 11:44