I use this:<br><br>parsexml(I,O) when is_binary(I) -><br> parsexml(tolist(I),O);<br>parsexml(InputXml,Opt) -><br> try {Xml,_} = xmerl_scan:string(InputXml, [{space,normalize},{encoding,"utf-8"},{validation,off}|Opt]),<br>
strip_whitespace(xmerl_lib:simplify_element(Xml)) of<br> Res -><br> Res<br> catch<br> error:_X -><br> io:format("~p", [_X]),<br> false<br> end.<br>
<br>strip_whitespace({El,Attr,Children}) -><br> NChild = lists:filter(fun(X) -><br> case X of<br> " " -> false;<br> _ -> true<br> end<br> end,Children),<br> Ch = lists:map(fun(X) -> strip_whitespace(X) end,NChild),<br>
{El,Attr,Ch};<br>strip_whitespace(String) -> <br> String.<br><br><br><br>Sergej<br><br><div class="gmail_quote">On Mon, Dec 26, 2011 at 2:54 PM, Martin Dimitrov <span dir="ltr"><<a href="mailto:mrtndimitrov@gmail.com">mrtndimitrov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
There is an example in the user's guide<br>
(<a href="http://www1.erlang.org/doc/apps/xmerl/xmerl_ug.html#id58936" target="_blank">http://www1.erlang.org/doc/apps/xmerl/xmerl_ug.html#id58936</a>) of how to<br>
export to XML format a structure in the so called 'simple form'.<br>
Is there a method to parse XML document to this 'simple form'?<br>
<br>
Regards,<br>
<br>
Martin<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br>