diff options
-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() |