diff options
author | Lars G Thorsen <[email protected]> | 2010-06-07 13:10:42 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2010-06-07 15:38:46 +0200 |
commit | 1fcf22da626d75ae03ee2c382e92ead75a4eb8b5 (patch) | |
tree | 8c8a45e0d5b5a179573fa7f1c82b791e5ca598e0 /lib | |
parent | e61ffa5c8a3aa840d2169d4ea0daa99b2644173f (diff) | |
download | otp-1fcf22da626d75ae03ee2c382e92ead75a4eb8b5.tar.gz otp-1fcf22da626d75ae03ee2c382e92ead75a4eb8b5.tar.bz2 otp-1fcf22da626d75ae03ee2c382e92ead75a4eb8b5.zip |
An empty element declared as simpleContent was not properly validated.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/xmerl/doc/src/notes.xml | 12 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_xsd.erl | 19 |
2 files changed, 23 insertions, 8 deletions
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml index 207f6fdf16..d5c8b11cfc 100644 --- a/lib/xmerl/doc/src/notes.xml +++ b/lib/xmerl/doc/src/notes.xml @@ -50,6 +50,18 @@ Own Id: OTP-8537 </p> </item> + <item> + <p> + An empty element declared as a simpleContent was not properly validated. + </p> + <p> + Own Id: OTP-8599 + </p> + </item> + </list> + </section> + + </list> </section> diff --git a/lib/xmerl/src/xmerl_xsd.erl b/lib/xmerl/src/xmerl_xsd.erl index c7bca86205..1aedc9e270 100644 --- a/lib/xmerl/src/xmerl_xsd.erl +++ b/lib/xmerl/src/xmerl_xsd.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2006-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 2006-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 %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% @@ -2687,13 +2687,16 @@ check_element_type(XML=[E=#xmlElement{name=Name}|Rest], _ -> {error,{error_path(E,Name),?MODULE,{element_bad_match,E,Any,Env}}} end; -check_element_type([],CM,_Env,_Block,_S,Checked) -> +check_element_type([],CM,_Env,_Block,S,Checked) -> %% #schema_complex_type, any, #schema_group, anyType and lists are %% catched above. case CM of + #schema_simple_type{} -> + {NewVal,S2} = check_type(CM,[],unapplied,S), + {NewVal,[],S2}; {simpleType,_} -> - {error,{error_path(Checked,undefined),?MODULE, - {empty_content_not_allowed,CM}}}; + {NewVal,S2} = check_type(CM,[],unapplied,S), + {NewVal,[],S2}; _ -> {error,{error_path(Checked,undefined),?MODULE, {empty_content_not_allowed,CM}}} |