diff options
author | Lars Thorsen <[email protected]> | 2011-12-22 11:06:02 +0100 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2012-03-28 11:04:34 +0200 |
commit | 1462a9e217ae246bc4fe4dfca8c65e858f2572f6 (patch) | |
tree | 1c760d76a528bce5bcd5158d813e5e26c55b353e /lib/xmerl | |
parent | effdfdc5a7a2d70ea4ce34ce446c9490f424f2d7 (diff) | |
download | otp-1462a9e217ae246bc4fe4dfca8c65e858f2572f6.tar.gz otp-1462a9e217ae246bc4fe4dfca8c65e858f2572f6.tar.bz2 otp-1462a9e217ae246bc4fe4dfca8c65e858f2572f6.zip |
[xmerl] Fix error message and documentation bug
Diffstat (limited to 'lib/xmerl')
-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() |