Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -module(xml2_impr).
- -export([parse/1]).
- -include_lib("xmerl/include/xmerl.hrl").
- parse(File) ->
- {ok,Binary} = file:read_file(File),
- {Xml,_} = xmerl_scan:string(binary_to_list(Binary)),
- [[{Element,Value} || #xmlElement{name=Element,content=Value1} <- XmlElem, #xmlText{value=Value} <- Value1] || #xmlElement{content=XmlElem} <- xmerl_xpath:string("//item", Xml)].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement