Xmerl XPath not working in elixir (even for input in the xmerl docs)

224 views
Skip to first unread message

Stephen Cuzzort

unread,
Feb 12, 2014, 3:12:10 PM2/12/14
to elixir-l...@googlegroups.com
I'm new to Elixir (but have some experience with Erlang).  As I haven't found a good, easy way to interface with XML through Elixir, and I wanted a non-trivial project to really learn the language, I started Elixml, which is an Elixir wrapper around Erlsom.  I've had a really great experience with Erlsom, but it doesn't support XPath, so I was going to see if I could use the xmerl XPath parser, and then implement the final search functionally.

Xmerl, does not play nice with Elixir (IMHO) and I cannot even get the xpath tokenizer to work

The link to the project is
https://github.com/steve-cuzzort/Elixml

Inside of the project, the broken tokenizer is in
https://github.com/steve-cuzzort/Elixml/blob/master/lib/elixml_xpath.ex

The test case calling the broken function is in
https://github.com/steve-cuzzort/Elixml/blob/master/test/elixml_xpath_test.exs

and I got the XPath string from the xmerl code linked below (look at line 34)
https://github.com/otphub/xmerl/blob/master/src/xmerl_xpath.erl



José Valim

unread,
Feb 12, 2014, 3:28:12 PM2/12/14
to elixir-l...@googlegroups.com
It is probably related to double/single quoted strings. A double quoted string in Elixir is a binary. A double quoted string in Erlang is a char list. You probably want to use single quoted strings in the Elixir code (which are char lists).



José Valim
Skype: jv.ptec
Founder and Lead Developer


--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Stephen Cuzzort

unread,
Feb 12, 2014, 3:32:12 PM2/12/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br
Thanks - that fixed it.
Reply all
Reply to author
Forward
0 new messages