diff options
Diffstat (limited to 'src/xml.erl')
-rw-r--r-- | src/xml.erl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/xml.erl b/src/xml.erl index 222e49b3e..888618867 100644 --- a/src/xml.erl +++ b/src/xml.erl @@ -105,7 +105,7 @@ attr_to_list({Name, Value}) -> %crypt([], R) -> % R. -crypt(S) -> +crypt(S) when is_list(S) -> [case C of $& -> "&"; $< -> "<"; @@ -113,7 +113,9 @@ crypt(S) -> $" -> """; $' -> "'"; _ -> C - end || C <- S]. + end || C <- S]; +crypt(S) when is_binary(S) -> + crypt(binary_to_list(S)). %crypt1(S) -> % lists:flatten([case C of @@ -159,10 +161,10 @@ remove_cdata(L) -> [E || E <- L, remove_cdata_p(E)]. % R. get_cdata(L) -> - get_cdata(L, ""). + binary_to_list(list_to_binary(get_cdata(L, ""))). get_cdata([{xmlcdata, CData} | L], S) -> - get_cdata(L, S ++ CData); + get_cdata(L, [S, CData]); get_cdata([_ | L], S) -> get_cdata(L, S); get_cdata([], S) -> |