diff options
Diffstat (limited to 'lib/xmerl')
-rw-r--r-- | lib/xmerl/doc/src/xmerl_sax_parser.xml | 7 | ||||
-rw-r--r-- | lib/xmerl/include/xmerl_xlink.hrl | 26 | ||||
-rw-r--r-- | lib/xmerl/src/Makefile | 1 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_sax_parser.erl | 3 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_sax_parser_base.erlsrc | 13 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_xsd.erl | 2 |
6 files changed, 20 insertions, 32 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/include/xmerl_xlink.hrl b/lib/xmerl/include/xmerl_xlink.hrl deleted file mode 100644 index 375e244c23..0000000000 --- a/lib/xmerl/include/xmerl_xlink.hrl +++ /dev/null @@ -1,26 +0,0 @@ - - - -%% The following is a brief summary of the element types (columns) on -%% which the global attributes are allowed: -%% -%% simple extended locator arc resource title -%% type X X X X X X -%% href X X -%% role X X X X -%% title X X X X -%% show X X X -%% actuate X X X -%% from X -%% to X -%% --record(xlink, { - type, % simple | extended | locator | arc | resource | title - href, - role - title, - show, - actuate, - from, - to - }). diff --git a/lib/xmerl/src/Makefile b/lib/xmerl/src/Makefile index 7009b50f6c..5b77c9478b 100644 --- a/lib/xmerl/src/Makefile +++ b/lib/xmerl/src/Makefile @@ -94,7 +94,6 @@ MODULES = $(EDOC_MODULES) \ HRL_FILES = \ ../include/xmerl.hrl \ - ../include/xmerl_xlink.hrl \ ../include/xmerl_xpath.hrl \ ../include/xmerl_xsd.hrl diff --git a/lib/xmerl/src/xmerl_sax_parser.erl b/lib/xmerl/src/xmerl_sax_parser.erl index 45e2a928ac..1d795799ce 100644 --- a/lib/xmerl/src/xmerl_sax_parser.erl +++ b/lib/xmerl/src/xmerl_sax_parser.erl @@ -217,7 +217,7 @@ check_encoding_option(E) when E==utf8; E=={utf16,little}; E=={utf16,big}; check_encoding_option(utf16) -> {utf16,big}; check_encoding_option(E) -> - {error, io_lib:format("Charcter set ~p not supported", [E])}. + {error, io_lib:format("Character set ~p not supported", [E])}. %%---------------------------------------------------------------------- %% Function: detect_charset(Xml, State) @@ -279,6 +279,7 @@ convert_encoding(Enc) -> %% Just for 7,8 bit + utf8 case string:to_lower(Enc) of "utf-8" -> utf8; "us-ascii" -> utf8; + "latin1" -> latin1; "iso-8859-1" -> latin1; % Handle all iso-8859 as latin1 "iso-8859-2" -> latin1; "iso-8859-3" -> latin1; diff --git a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc index c25cde0472..df0970ef14 100644 --- a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc +++ b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc @@ -39,6 +39,9 @@ %% Internal exports %%---------------------------------------------------------------------- -export([ + cf/3, + cf/4, + cf/5 ]). %%---------------------------------------------------------------------- @@ -759,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], @@ -2054,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() diff --git a/lib/xmerl/src/xmerl_xsd.erl b/lib/xmerl/src/xmerl_xsd.erl index ed0890f0d0..f0d9acb976 100644 --- a/lib/xmerl/src/xmerl_xsd.erl +++ b/lib/xmerl/src/xmerl_xsd.erl @@ -2338,6 +2338,8 @@ complexity([]) -> undefined; complexity([#xmlText{}|T]) -> complexity(T); +complexity([#xmlComment{}|T]) -> + complexity(T); complexity([H|T]) -> case kind(H) of simpleContent -> |