
Greetings. I am trying to move some very old code from using HaXml to HXT. This is experimental; I have reasons which I think are not relevant to this post. The website that purports to document HXT has broken links. This is Uwe Schmidt's website. I have emailed Dr. Schmidt. Meanwhile, can anyone elucidate the use of readDocument with its withCurl and withHTTP options? What may be passed in the list to e.g. withHTTP? - Phil -

On 15/02/14 21:25, Philippe Sismondi wrote:
Greetings. I am trying to move some very old code from using HaXml to HXT. This is experimental; I have reasons which I think are not relevant to this post.
The website that purports to document HXT has broken links. This is Uwe Schmidt's website. I have emailed Dr. Schmidt. Meanwhile, can anyone elucidate the use of readDocument with its withCurl and withHTTP options? What may be passed in the list to e.g. withHTTP?
- Phil - _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
Why don't you use the documentation on Hackage? Here[1] is your readDocument. It mentions the withCurl option and how to use it. As it points out, the withCurl comes from hxt-curl and the relevant page is at [2]. As you can see, it takes Attributes which is just a list of key-value pairs. I'm sure you can keep clicking on the links and find out what it is you need to pass to it. It's the same case when looking at withHTTP. Word of warning about HXT, it will blow up in your face if you give it bigger XML files: I found ~30MB to be the limit for a 4GB machine. It's great for smaller files however. See [3] for that issue and [4] for other issues that you might want to view. [1]: http://hackage.haskell.org/package/hxt-9.3.1.3/docs/Text-XML-HXT-Arrow-ReadD... [2]: http://hackage.haskell.org/package/hxt-curl-9.1.1/docs/Text-XML-HXT-Curl.htm... [3]: https://github.com/UweSchmidt/hxt/issues/9 [4]: https://github.com/UweSchmidt/hxt/issues -- Mateusz K.

On 2014-02-15, at 5:17 PM, Mateusz Kowalczyk
On 15/02/14 21:25, Philippe Sismondi wrote:
Greetings. I am trying to move some very old code from using HaXml to HXT. This is experimental; I have reasons which I think are not relevant to this post.
The website that purports to document HXT has broken links. This is Uwe Schmidt's website. I have emailed Dr. Schmidt. Meanwhile, can anyone elucidate the use of readDocument with its withCurl and withHTTP options? What may be passed in the list to e.g. withHTTP?
- Phil - _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
Why don't you use the documentation on Hackage? Here[1] is your
I tried to do that.
readDocument. It mentions the withCurl option and how to use it. As it points out, the withCurl comes from hxt-curl and the relevant page is at [2]. As you can see, it takes Attributes which is just a list of
Yes. The "relevant page is at [2]". Clicking on that link takes me to a page that tells me this: withCurl :: Attributes -> SysConfig So now I want to know what about "Attributes" (above). If I click on the link to "Attributes" in the hackage documentation I discover this: Attribute list used for storing option lists and features of DTD parts So, I am clearly missing something - which, as usual, is probably my fault. What I am missing is: what goes in the attribute list for e.g. withCurl?

On 02/16/2014 09:34 AM, Philippe Sismondi wrote:
Attribute list used for storing option lists and features of DTD parts
So, I am clearly missing something - which, as usual, is probably my fault. What I am missing is: what goes in the attribute list for e.g. withCurl?
I can't be sure, but the 'Attributes' type is a list of 2-tuples that contain... something. I would try the empty list and see what happens. For example, readDocument [ withCurl [] ] "http://example.com/some.xml"

On 2014-02-20, at 1:49 PM, Michael Orlitzky
On 02/16/2014 09:34 AM, Philippe Sismondi wrote:
I can't be sure, but the 'Attributes' type is a list of 2-tuples that contain... something. I would try the empty list and see what happens. For example,
Thanks, Michael. I can get withCurl to work when I supple an empty list, but I am guessing that the curl options allow more control. There is a link that purports to document curl and http options, but the links are broken. I contacted Uwe Schmidt (a prof who spearheaded development of HXT, I think). He replied to say that he would check into it when he has time. I may have to plunge into the source code to see how curl and/or http actually get called if nobody restores the broken links. Meanwhile thanks for the reply. - P -
readDocument [ withCurl [] ] "http://example.com/some.xml"
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Hi Philippe,
Have you taken a look at [1]
That's what actually gets called from [2]
[1]: http://hackage.haskell.org/package/curl-1.3.8/docs/Network-Curl.html
[2]:
http://hackage.haskell.org/package/hxt-curl-9.1.1/docs/src/Text-XML-HXT-Arro...
Best regards,
vlatko
-------- Original Message --------
Subject: Re: [Haskell-beginners] Need help with HXT
From: Philippe Sismondi
On 2014-02-20, at 1:49 PM, Michael Orlitzky
wrote: On 02/16/2014 09:34 AM, Philippe Sismondi wrote:
I can't be sure, but the 'Attributes' type is a list of 2-tuples that contain... something. I would try the empty list and see what happens. For example,
Thanks, Michael. I can get withCurl to work when I supple an empty list, but I am guessing that the curl options allow more control. There is a link that purports to document curl and http options, but the links are broken. I contacted Uwe Schmidt (a prof who spearheaded development of HXT, I think). He replied to say that he would check into it when he has time.
I may have to plunge into the source code to see how curl and/or http actually get called if nobody restores the broken links.
Meanwhile thanks for the reply.
- P -
readDocument [ withCurl [] ] "http://example.com/some.xml"
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Ah, beauty, thanks. I should have thought of that.
Muchas Gracias.
- P -
On 2014-02-21, at 12:43 AM, Vlatko Basic
Hi Philippe,
Have you taken a look at [1]
That's what actually gets called from [2]
[1]: http://hackage.haskell.org/package/curl-1.3.8/docs/Network-Curl.html [2]: http://hackage.haskell.org/package/hxt-curl-9.1.1/docs/src/Text-XML-HXT-Arro...
Best regards,
vlatko
-------- Original Message -------- Subject: Re: [Haskell-beginners] Need help with HXT From: Philippe Sismondi
To: The Haskell-Beginners Mailing List - Discussion of primarily beginner-level topics related to Haskell Date: 20.02.2014 22:48 On 2014-02-20, at 1:49 PM, Michael Orlitzky
wrote: On 02/16/2014 09:34 AM, Philippe Sismondi wrote:
I can't be sure, but the 'Attributes' type is a list of 2-tuples that contain... something. I would try the empty list and see what happens. For example,
Thanks, Michael. I can get withCurl to work when I supple an empty list, but I am guessing that the curl options allow more control. There is a link that purports to document curl and http options, but the links are broken. I contacted Uwe Schmidt (a prof who spearheaded development of HXT, I think). He replied to say that he would check into it when he has time.
I may have to plunge into the source code to see how curl and/or http actually get called if nobody restores the broken links.
Meanwhile thanks for the reply.
- P -
readDocument [ withCurl [] ] "http://example.com/some.xml"
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (4)
-
Mateusz Kowalczyk
-
Michael Orlitzky
-
Philippe Sismondi
-
Vlatko Basic