diff options
Diffstat (limited to 'lib/xmerl')
-rw-r--r-- | lib/xmerl/doc/src/notes.xml | 34 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_lib.erl | 7 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_sax_parser_base.erlsrc | 41 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_scan.erl | 2 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_xpath.erl | 4 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_xsd.erl | 3 | ||||
-rw-r--r-- | lib/xmerl/vsn.mk | 2 |
7 files changed, 82 insertions, 11 deletions
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml index d67a622481..aa66cbec77 100644 --- a/lib/xmerl/doc/src/notes.xml +++ b/lib/xmerl/doc/src/notes.xml @@ -31,6 +31,40 @@ <p>This document describes the changes made to the Xmerl application.</p> +<section><title>Xmerl 1.2.7</title> + + <section><title>Fixed Bugs and Malfunctions</title> + <list> + <item> + <p> An empty element declared as simpleContent was not + properly validated. </p> + <p> + Own Id: OTP-8599</p> + </item> + <item> + <p> Fix format_man_pages so it handles all man sections + and remove warnings/errors in various man pages. </p> + <p> + Own Id: OTP-8600</p> + </item> + </list> + </section> + + + <section><title>Improvements and New Features</title> + <list> + <item> + <p> Fix entity checking so there are no fatal errors for + undefined entities when option skip_external_dtd is used. + </p> + <p> + Own Id: OTP-8947</p> + </item> + </list> + </section> + +</section> + <section><title>Xmerl 1.2.6</title> <section><title>Fixed Bugs and Malfunctions</title> diff --git a/lib/xmerl/src/xmerl_lib.erl b/lib/xmerl/src/xmerl_lib.erl index 7b76a76a33..1b3a7e57f0 100644 --- a/lib/xmerl/src/xmerl_lib.erl +++ b/lib/xmerl/src/xmerl_lib.erl @@ -148,9 +148,10 @@ expand_element(Element) -> expand_element(Element, Pos, Parents) -> expand_element(Element, Pos, Parents, false). -expand_element(E = #xmlElement{}, Pos, Parents, Norm) -> - Content = expand_content(E#xmlElement.content, 1, Parents, Norm), - Attrs = expand_attributes(E#xmlElement.attributes, 1, []), +expand_element(E = #xmlElement{name = N}, Pos, Parents, Norm) -> + NewParents = [{N,Pos}|Parents], + Content = expand_content(E#xmlElement.content, 1, NewParents, Norm), + Attrs = expand_attributes(E#xmlElement.attributes, 1, NewParents), E#xmlElement{pos = Pos, parents = Parents, attributes = Attrs, diff --git a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc index 9d184152d1..3b9eaa309c 100644 --- a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc +++ b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc @@ -1,7 +1,7 @@ %%-*-erlang-*- %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. +%% Copyright Ericsson AB 2008-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -934,6 +934,13 @@ parse_att_value(?STRING_REST("&", Rest), State, Stop, Acc) -> parse_att_value(Rest1, State2, Stop, ParsedValue ++ Acc); {external_general, Name, _} -> ?fatal_error(State1, "External parsed entity reference in attribute value: " ++ Name); + {not_found, Name} -> + case State#xmerl_sax_parser_state.skip_external_dtd of + false -> + ?fatal_error(State1, "Entity not declared: " ++ Name); %%VC: Entity Declared + true -> + parse_att_value(Rest1, State1, Stop, ";" ++ lists:reverse(Name) ++ "&" ++ Acc) + end; {unparsed, Name, _} -> ?fatal_error(State1, "Unparsed entity reference in attribute value: " ++ Name) end; @@ -1098,6 +1105,13 @@ parse_content(?STRING_REST("&", Rest), State, Acc, _IgnorableWS) -> {external_general, _, {PubId, SysId}} -> State2 = parse_external_entity(State1, PubId, SysId), parse_content(Rest1, State2, Acc, false); + {not_found, Name} -> + case State#xmerl_sax_parser_state.skip_external_dtd of + false -> + ?fatal_error(State1, "Entity not declared: " ++ Name); %%VC: Entity Declared + true -> + parse_content(Rest1, State1, ";" ++ lists:reverse(Name) ++ "&" ++ Acc, false) + end; {unparsed, Name, _} -> ?fatal_error(State1, "Unparsed entity reference in content: " ++ Name) end; @@ -1357,7 +1371,7 @@ look_up_reference(Name, HaveToExist, State) -> yes -> ?fatal_error(State, "Entity not declared: " ++ Name); %%WFC: Entity Declared no -> - ?fatal_error(State, "Entity not declared: " ++ Name) %%VC: Entity Declared + {not_found, Name} %%VC: Entity Declared end; false -> {not_found, Name} @@ -1869,7 +1883,14 @@ parse_doctype_decl(?STRING_REST("%", Rest), State) -> parse_doctype_decl(?APPEND_STRING(IValue, Rest1), State1); {external_parameter, _, {PubId, SysId}} -> State2 = parse_external_entity(State1#xmerl_sax_parser_state{file_type = entity}, PubId, SysId), - parse_doctype_decl(Rest1, State2) + parse_doctype_decl(Rest1, State2); + {not_found, Name} -> + case State#xmerl_sax_parser_state.skip_external_dtd of + false -> + ?fatal_error(State1, "Entity not declared: " ++ Name); %%WFC: Entity Declared + true -> + parse_doctype_decl(Rest1, State1) + end end; parse_doctype_decl(?STRING_REST("<!", Rest1), State) -> parse_doctype_decl_1(Rest1, State); @@ -2443,7 +2464,7 @@ parse_ndata(Bytes, State) -> %% Acc = string() %% Result : {Value, Rest, State} %% Value = string() -%% Description: Parse an attribute value +%% Description: Parse an entity value %%---------------------------------------------------------------------- parse_entity_value(?STRING_EMPTY, State, undefined, Acc) -> {Acc, [], State}; %% stop clause when parsing references @@ -2473,7 +2494,7 @@ parse_entity_value(?STRING_REST("&", Rest), State, Stop, Acc) -> {external_general, Name, _} -> parse_entity_value(Rest1, State1, Stop, ";" ++ lists:reverse(Name) ++ "&" ++ Acc); {not_found, Name} -> - parse_entity_value(Rest1, State1, Stop, ";" ++ lists:reverse(Name) ++ "&" ++ Acc); + parse_entity_value(Rest1, State1, Stop, ";" ++ lists:reverse(Name) ++ "&" ++ Acc); {unparsed, Name, _} -> ?fatal_error(State1, "Unparsed entity reference in entity value: " ++ Name) end; @@ -2490,7 +2511,15 @@ parse_entity_value(?STRING_REST("%", Rest), #xmerl_sax_parser_state{file_type=Ty IValue = ?TO_INPUT_FORMAT(" " ++ RefValue ++ " "), parse_entity_value(?APPEND_STRING(IValue, Rest1), State1, Stop, Acc); {external_parameter, _, {_PubId, _SysId}} -> - ?fatal_error(State1, "Parameter references in entity value not supported yet.") + ?fatal_error(State1, "Parameter references in entity value not supported yet."); + {not_found, Name} -> + case State#xmerl_sax_parser_state.skip_external_dtd of + false -> + ?fatal_error(State1, "Entity not declared: " ++ Name); %%VC: Entity Declared + true -> + parse_entity_value(Rest1, State1, Stop, ";" ++ lists:reverse(Name) ++ "&" ++ Acc) + end + end end; parse_entity_value(?STRING_UNBOUND_REST(Stop, Rest), State, Stop, Acc) -> diff --git a/lib/xmerl/src/xmerl_scan.erl b/lib/xmerl/src/xmerl_scan.erl index e2e6f95c4a..e07d495fc7 100644 --- a/lib/xmerl/src/xmerl_scan.erl +++ b/lib/xmerl/src/xmerl_scan.erl @@ -34,7 +34,9 @@ %% See also <a href="xmerl_examples.html">tutorial</a> on customization %% functions. %% </p> +%% <p> %% Possible options are: +%% </p> %% <dl> %% <dt><code>{acc_fun, Fun}</code></dt> %% <dd>Call back function to accumulate contents of entity.</dd> diff --git a/lib/xmerl/src/xmerl_xpath.erl b/lib/xmerl/src/xmerl_xpath.erl index 182a186d2c..e654a8ef1d 100644 --- a/lib/xmerl/src/xmerl_xpath.erl +++ b/lib/xmerl/src/xmerl_xpath.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2009. All Rights Reserved. +%% Copyright Ericsson AB 2003-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -57,7 +57,9 @@ %% @type option_list(). <p>Options allows to customize the behaviour of the %% XPath scanner. %% </p> +%% <p> %% Possible options are: +%% </p> %% <dl> %% <dt><code>{namespace, #xmlNamespace}</code></dt> %% <dd>Set namespace nodes, from XmlNamspace, in xmlContext</dd> diff --git a/lib/xmerl/src/xmerl_xsd.erl b/lib/xmerl/src/xmerl_xsd.erl index 1aedc9e270..c0923520c2 100644 --- a/lib/xmerl/src/xmerl_xsd.erl +++ b/lib/xmerl/src/xmerl_xsd.erl @@ -29,7 +29,9 @@ %% @type option_list(). <p>Options allow to customize the behaviour of the %% validation. %% </p> +%% <p> %% Possible options are : +%% </p> %% <dl> %% <dt><code>{tab2file,boolean()}</code></dt> %% <dd>Enables saving of abstract structure on file for debugging @@ -46,6 +48,7 @@ %% <dd>It is possible by this option to provide a state with process %% information from an earlier validation.</dd> %% </dl> +%% @end %%%------------------------------------------------------------------- -module(xmerl_xsd). diff --git a/lib/xmerl/vsn.mk b/lib/xmerl/vsn.mk index d85a57f447..a4d7efaee3 100644 --- a/lib/xmerl/vsn.mk +++ b/lib/xmerl/vsn.mk @@ -1 +1 @@ -XMERL_VSN = 1.2.6 +XMERL_VSN = 1.2.7 |