2

Possible Duplicate:
What is the best way to learn Erlang?

I'm interested in learning Erlang; I'd appreciate suggestions on resources - books, websites, etc. - that can help me along. So far I've learned quite a bit from Learn you some Erlang. At this point I'm comfortable with the syntax and most of the (basic) concepts. As a practice project I was thinking of writting a server socket app that serves xml data when conected, unfortunately, I'm not sure where to start - i.e. what libraries to use and how to use them. Thanks.

Community
  • 1
  • 1
sjac
  • 2,811
  • 5
  • 23
  • 20
  • Did you look through any of the similar questions [here](http://stackoverflow.com/search?q=erlang+learning) – DOK Aug 10 '11 at 18:27
  • @DOK: Yes, I looked through most of those answers already. While some -["Find some good Erlang Books"-](http://stackoverflow.com/questions/2789668/finding-some-good-erlang-books) were helpful, none fully addressed my question. – sjac Aug 10 '11 at 18:38

2 Answers2

1

gen_tcp is Erlang's interface to TCP/IP sockets. You can find many examples of how to use it in Erlang/OTP libraries or in open-source applications. For example, take a look at these http server and client libraries: https://github.com/mochi/MochiWeb, https://github.com/cmullaparthi/ibrowse

Handling XML in Erlang is more painful than it should be. JSON might be a little bit easier, if you have an option to use it instead of XML.

For XML, there's a standard Xmerl library which is a part of Erlang/OTP. I found that the least painful way to extract necessary pieces from XML is to use XPath (xmerl_xpath:string). For XML generation, xmerl:export_simple is the way to go.

I've also used Erlsom library. I has a (rather) simple XML parsing interface.

alavrik
  • 2,151
  • 12
  • 16
0

trapexit has an excellent article for building a tcp server with OTP.