
I'm quite stuck on getting HXT working to do my xml parsing, can you help me to get started? Even in http://www.haskell.org/haskellwiki/HXT#Getting_started:_Hello_world_examples the basic filter example that's given there in section 6: import Text.XML.HXT.Core import Text.XML.HXT.DOM.XmlTreeFilter selectAllText :: ArrowXml a => a XmlTree XmlTree selectAllText = deep isXText fails with the following error message. What could I be doing wrong? Couldn't match expected type `Data.Tree.NTree.TypeDefs.NTree XNode' with actual type `hxt-8.5.4:Data.Tree.NTree.TypeDefs.NTree hxt-8.5.4:Text.XML.HXT.DOM.TypeDefs.XNode' Expected type: a (Data.Tree.NTree.TypeDefs.NTree XNode) XmlTree Actual type: Text.XML.HXT.DOM.XmlTreeTypes.XmlFilter In the first argument of `deep', namely `isXText' In the expression: deep isXText On the other hand, perhaps you can suggest something other than HXT - my needs would be taking "heavy" XML's (a lot of little-neccessary structure, but correctly validated), extracting text tokens from it and outputting them with some light tagsoup annotation. Regards, Peteris

On Mon, Jan 30, 2012 at 3:06 PM, Pēteris Paikens
I'm quite stuck on getting HXT working to do my xml parsing, can you help me to get started? Even in http://www.haskell.org/haskellwiki/HXT#Getting_started:_Hello_world_examples the basic filter example that's given there in section 6:
import Text.XML.HXT.Core import Text.XML.HXT.DOM.XmlTreeFilter selectAllText :: ArrowXml a => a XmlTree XmlTree selectAllText = deep isXText
fails with the following error message. What could I be doing wrong?
Couldn't match expected type `Data.Tree.NTree.TypeDefs.NTree XNode' with actual type `hxt-8.5.4:Data.Tree.NTree.TypeDefs.NTree hxt-8.5.4:Text.XML.HXT.DOM.TypeDefs.XNode' Expected type: a (Data.Tree.NTree.TypeDefs.NTree XNode) XmlTree Actual type: Text.XML.HXT.DOM.XmlTreeTypes.XmlFilter In the first argument of `deep', namely `isXText' In the expression: deep isXText
On the other hand, perhaps you can suggest something other than HXT - my needs would be taking "heavy" XML's (a lot of little-neccessary structure, but correctly validated), extracting text tokens from it and outputting them with some light tagsoup annotation.
Regards, Peteris
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
You could try xml-conduit[1] instead. I use it extensively at work. There's an appendix in the Yesod book[2] covering basic usage. Michael [1] http://hackage.haskell.org/package/xml-conduit [2] http://www.yesodweb.com/book/xml-enumerator

Couldn't match expected type `Data.Tree.NTree.TypeDefs.NTree XNode' with actual type `hxt-8.5.4:Data.Tree.NTree.TypeDefs.NTree hxt-8.5.4:Text.XML.HXT.DOM.TypeDefs.XNode'
perhaps you have installed several (conflicting) versions of packages. I use hxt >= 9, and here is some example code: http://dfa.imn.htwk-leipzig.de/cgi-bin/gitweb.cgi?p=tpdb.git;a=tree;f=TPDB/X... Best - J.W.

Yep, that does seem to be the case - cabal shows "Versions installed:
8.5.4, 9.1.6".
The module referenced in the website example -
Text.XML.HXT.DOM.XmlTreeFilter and function isXText - has only old
packages, so when installing hxt I got version 9.1.6, but from
hxt-filter I got hxt 8.5.4, so that's why the example fails.
Peteris
On Mon, Jan 30, 2012 at 3:42 PM, Johannes Waldmann
Couldn't match expected type `Data.Tree.NTree.TypeDefs.NTree XNode' with actual type `hxt-8.5.4:Data.Tree.NTree.TypeDefs.NTree hxt-8.5.4:Text.XML.HXT.DOM.TypeDefs.XNode'
perhaps you have installed several (conflicting) versions of packages.
I use hxt >= 9, and here is some example code: http://dfa.imn.htwk-leipzig.de/cgi-bin/gitweb.cgi?p=tpdb.git;a=tree;f=TPDB/X...
Best - J.W.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 12-01-30 08:06 AM, Pēteris Paikens wrote:
import Text.XML.HXT.Core import Text.XML.HXT.DOM.XmlTreeFilter selectAllText :: ArrowXml a => a XmlTree XmlTree selectAllText = deep isXText
Delete "import Text.XML.HXT.DOM.XmlTreeFilter". Change "isXText" to "isText". That is, import Text.XML.HXT.Core selectAllText :: ArrowXml a => a XmlTree XmlTree selectAllText = deep isText I am going to change that on Haskell Wiki.
participants (4)
-
Albert Y. C. Lai
-
Johannes Waldmann
-
Michael Snoyman
-
Pēteris Paikens