mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
* src/xml.erl: More verbose error reporting for
element_to_string (thanks to Magnus Henoch)(EJAB-301) SVN Revision: 2045
This commit is contained in:
parent
7c4e7dea4b
commit
e45e486fd2
@ -1,5 +1,8 @@
|
||||
2009-04-27 Badlop <badlop@process-one.net>
|
||||
|
||||
* src/xml.erl: More verbose error reporting for
|
||||
element_to_string (thanks to Magnus Henoch)(EJAB-301)
|
||||
|
||||
* src/translate.erl: Support additional files (EJAB-925)
|
||||
* contrib/extract_translations/extract_translations.erl: Likewise
|
||||
* contrib/extract_translations/prepare-translation.sh: Likewise
|
||||
|
10
src/xml.erl
10
src/xml.erl
@ -47,12 +47,20 @@
|
||||
-endif.
|
||||
|
||||
element_to_string(El) ->
|
||||
case catch element_to_string_nocatch(El) of
|
||||
{'EXIT', Reason} ->
|
||||
erlang:error({badxml, El, Reason});
|
||||
Result ->
|
||||
Result
|
||||
end.
|
||||
|
||||
element_to_string_nocatch(El) ->
|
||||
case El of
|
||||
{xmlelement, Name, Attrs, Els} ->
|
||||
if
|
||||
Els /= [] ->
|
||||
[$<, Name, attrs_to_list(Attrs), $>,
|
||||
[element_to_string(E) || E <- Els],
|
||||
[element_to_string_nocatch(E) || E <- Els],
|
||||
$<, $/, Name, $>];
|
||||
true ->
|
||||
[$<, Name, attrs_to_list(Attrs), $/, $>]
|
||||
|
Loading…
Reference in New Issue
Block a user