aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-03-28 12:03:02 +0200
committerIngela Anderton Andin <[email protected]>2012-03-28 12:03:02 +0200
commitf78bcd34cb6263ebcb36cb739f3714d7bc6fdf89 (patch)
tree83f0c1f45997a227cfa1566b1a485143e46f8890 /lib/xmerl/src/xmerl_sax_parser_base.erlsrc
parentb2ec189f6dd4b32fda23a8e41f209f03f0b8e297 (diff)
parente93c9db144d3c9ffe032d0d316c31f9750b21739 (diff)
downloadotp-f78bcd34cb6263ebcb36cb739f3714d7bc6fdf89.tar.gz
otp-f78bcd34cb6263ebcb36cb739f3714d7bc6fdf89.tar.bz2
otp-f78bcd34cb6263ebcb36cb739f3714d7bc6fdf89.zip
Merge remote branch 'upstream/maint'
* upstream/maint: [xmerl] Fix bug for comments in XSD files [xmerl] Fix error message and documentation bug Corrected dialyzer specs and exported some dialyzer specs
Diffstat (limited to 'lib/xmerl/src/xmerl_sax_parser_base.erlsrc')
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_base.erlsrc10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
index e988c49292..df0970ef14 100644
--- a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
@@ -762,7 +762,7 @@ parse_attributes(?STRING_UNBOUND_REST(C, Rest), State, {Tag, AttList, NsList}) -
end
end;
false ->
- ?fatal_error(State, "Invalid start character in attribute name: " ++ C)
+ ?fatal_error(State, "Invalid start character in attribute name: " ++ [C])
end;
parse_attributes(Bytes, State, CurrentTag) ->
unicode_incomplete_check([Bytes, State, CurrentTag, fun parse_attributes/3],
@@ -2057,14 +2057,18 @@ parse_element_content(Bytes, State) ->
parse_element_content_1(?STRING_EMPTY, State, Acc) ->
cf(?STRING_EMPTY, State, Acc, fun parse_element_content_1/3);
parse_element_content_1(?STRING_REST(">", Rest), State, Acc) ->
- {lists:reverse(Acc), Rest, State};
+ {lists:reverse(delete_leading_whitespace(Acc)), Rest, State};
parse_element_content_1(?STRING_UNBOUND_REST(C, Rest), State, Acc) ->
parse_element_content_1(Rest, State, [C|Acc]);
parse_element_content_1(Bytes, State, Acc) ->
unicode_incomplete_check([Bytes, State, Acc, fun parse_element_content_1/3],
undefined).
-
+delete_leading_whitespace([C |Acc]) when ?is_whitespace(C)->
+ delete_leading_whitespace(Acc);
+delete_leading_whitespace(Acc) ->
+ Acc.
+
%%----------------------------------------------------------------------
%% Function : parse_att_list_decl(Rest, State) -> Result
%% Parameters: Rest = string() | binary()