diff options
author | Lars Thorsen <[email protected]> | 2012-03-28 11:05:19 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2012-03-28 11:05:19 +0200 |
commit | 6ca158338f81867fc5f9ff55439b4fb8d39445f0 (patch) | |
tree | 1c760d76a528bce5bcd5158d813e5e26c55b353e /lib | |
parent | effdfdc5a7a2d70ea4ce34ce446c9490f424f2d7 (diff) | |
parent | 1462a9e217ae246bc4fe4dfca8c65e858f2572f6 (diff) | |
download | otp-6ca158338f81867fc5f9ff55439b4fb8d39445f0.tar.gz otp-6ca158338f81867fc5f9ff55439b4fb8d39445f0.tar.bz2 otp-6ca158338f81867fc5f9ff55439b4fb8d39445f0.zip |
Merge branch 'lars/xmerl/sax-fixes/OTP-10026' into maint
* lars/xmerl/sax-fixes/OTP-10026:
[xmerl] Fix error message and documentation bug
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xmerl/doc/src/xmerl_sax_parser.xml | 7 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_sax_parser_base.erlsrc | 10 |
2 files changed, 13 insertions, 4 deletions
diff --git a/lib/xmerl/doc/src/xmerl_sax_parser.xml b/lib/xmerl/doc/src/xmerl_sax_parser.xml index 972023622e..eb22711a75 100644 --- a/lib/xmerl/doc/src/xmerl_sax_parser.xml +++ b/lib/xmerl/doc/src/xmerl_sax_parser.xml @@ -206,10 +206,15 @@ Report the end of a CDATA section. </item> - <tag><c>startDTD</c></tag> + <tag><c>{startDTD, Name, PublicId, SystemId}</c></tag> <item> Report the start of DTD declarations, it's reporting the start of the DOCTYPE declaration. If the document has no DOCTYPE declaration, this event will not be sent. + <list> + <item><c>Name = string()</c></item> + <item><c>PublicId = string()</c></item> + <item><c>SystemId = string()</c></item> + </list> </item> <tag><c>endDTD</c></tag> 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() |