+2006-04-06 Alexey Shchepin <alexey@sevcom.net>
+
+ * src/expat_erl.c: Use binaries for CDATA
+ * src/xml.erl: Likewise
+
2006-04-02 Alexey Shchepin <alexey@sevcom.net>
* src/msgs/ru.msg: Updated (thanks to Sergei Golovan)
ei_x_encode_list_header(&event_buf, 1);
ei_x_encode_tuple_header(&event_buf, 2);
ei_x_encode_long(&event_buf, XML_CDATA);
- ei_x_encode_string_len_fixed(&event_buf, s, len);
+ ei_x_encode_binary(&event_buf, s, len);
return NULL;
}
%crypt([], R) ->
% R.
-crypt(S) ->
+crypt(S) when is_list(S) ->
[case C of
$& -> "&";
$< -> "<";
$" -> """;
$' -> "'";
_ -> 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
% 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) ->