Questions tagged [xml-conduit]

A Haskell conduit-based XML parsing library

xml-conduit is a Haskell XML parsing frame work built ontop of conduit

26 questions
6
votes
1 answer

Get all Names from xml-conduit

I'm parsing a modified XML from http://hackage.haskell.org/package/xml-conduit-1.1.0.9/docs/Text-XML-Stream-Parse.html Here's what it looks like:
Lionel
  • 3,188
  • 5
  • 27
  • 40
5
votes
3 answers

Streaming xml-conduit parse results

I want to use xml-conduit, specifically Text.XML.Stream.Parse in order to lazily extract a list of objects from a large XML file. As a test case, I use the recently re-released StackOverflow data dumps. To keep it simple, I intend to extract all…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
4
votes
1 answer

xml-conduit: How can I get only the first tbody and only direct child trs of that tbody?

I am using xml-conduit and Text.XML.Cursor to navigate some terrible html with nested tables. There is a table with two tbody tags and I want the immediate child tr tags of the first tbody. Here is my code so far: getIdentityTableBody :: Cursor ->…
4
votes
1 answer

Ignoring subtrees in streaming xml-conduit

The xml-conduit documentation only lists examples where the entire XML tree is consumed by a ConduitM, for example: Michael Eliezer I'm trying to parse a tree where…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
3
votes
1 answer

stream parsing xml without knowing the ordering of child tags

I have to parse some xml, i decided to use xml-conduit for that task and use the streaming part of it. The structure of the xml is given by an xsd-file that contains elements and how often they may occur. But not in which order they are…
epsilonhalbe
  • 15,637
  • 5
  • 46
  • 74
3
votes
1 answer

How to use the xml-conduit Cursor Interface for information extraction from a large XML file (around 30G)

The following question is based upon the accepted answer of this question. The author of the accepted answer said that the streaming helper API in xml-conduit was not updated for years (source: accepted answer of SO question), and he recommends the…
kolam
  • 731
  • 4
  • 17
2
votes
1 answer

How to skip elements in xml-conduit

I have to handle rather big XML files and I want to use the streaming API of xml-conduit to go through them and extract the info I need. In my case using streaming xml-conduit is especially appealing because I don't need much data from these files,…
Alexey Raga
  • 7,457
  • 1
  • 31
  • 40
2
votes
2 answers

haskell: xml filtering a subtree

I am struggling to remove a Element with all its children with haskell. The task is to strip all table-tags from a given xml document (maybe I have not understood the concept of a cursor or it is something else I am missing). I have tried three…
epsilonhalbe
  • 15,637
  • 5
  • 46
  • 74
2
votes
1 answer

Haskell xml-conduit without OverloadedStrings?

Every example I have seen online of Haskell's xml-conduit module uses the OverloadedStrings GHC extension (e.g. here). I assume this is because the Text.XML.Cursor.element function has type Name -> Axis. For example, this snippet would not work…
Bill M
  • 711
  • 1
  • 6
  • 8
2
votes
1 answer

Combining requireAttr and ignoreAttrs in xml-conduit

I'm using Text.XML.Stream.Parse from xml-conduit to parse a large XML file. My inner parser looks like this: parseUserRow = tagName "row" (requireAttr "name") $ \name -> do -- [....] When running it, I get a long error message like…
Uli Köhler
  • 13,012
  • 16
  • 70
  • 120
1
vote
1 answer
1
vote
0 answers

Comparing cursor vs conduit xml parsing

here's some xml i'm parsing -- it's my first time working with xml, soap, or conduit.
user1441998
  • 459
  • 4
  • 14
1
vote
2 answers

xml-conduit: How to Modify a Document?

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…
pbarill
  • 640
  • 8
  • 16
1
vote
1 answer

heap memory buildup with xml-conduit parseBytes

I'm parsing some rather large XML files with xml-conduit's streaming interface https://hackage.haskell.org/package/xml-conduit-1.8.0/docs/Text-XML-Stream-Parse.html#v:parseBytes but I'm seeing this memory buildup (here on a small test file): where…
unhammer
  • 4,306
  • 2
  • 39
  • 52
1
vote
1 answer

In Haskell's xml-conduit, how can I create a node?

I'm a Haskell beginner. I'm using xml-conduit to transform some XML into HTML, as seen in the Yesod tutorial. I have some attributes and some content that I want to make into a node to add it to existing XML. What's the best way to create a Node?…
Jonathan
  • 10,571
  • 13
  • 67
  • 103
1
2