diff options
Diffstat (limited to 'lib/xmerl/src/xmerl_xsd.erl')
-rw-r--r-- | lib/xmerl/src/xmerl_xsd.erl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/xmerl/src/xmerl_xsd.erl b/lib/xmerl/src/xmerl_xsd.erl index c0923520c2..bd24db5389 100644 --- a/lib/xmerl/src/xmerl_xsd.erl +++ b/lib/xmerl/src/xmerl_xsd.erl @@ -2420,8 +2420,8 @@ validate_xml(XMLEl=#xmlElement{},SEl=#schema_element{},S) -> %% 2 often check_element_type(XML=[XMLTxt=#xmlText{}|Rest],CM=[CMEl|CMRest],Env, Block,S,Checked) -> - %% XMLTxt ��r det f��rsta av content i element, - %% CMEl ��r den till��tna typen enligt schemat + %% XMLTxt is the first part of the elements content, + %% CMEl is the allowed type according to the schema case is_whitespace(XMLTxt) of true -> %% Ignore XMLEl check_element_type(Rest,CM,Env,Block,S,[XMLTxt|Checked]); @@ -2453,7 +2453,7 @@ check_element_type(XML=[#xmlElement{}|_],[{choice,{CM,Occ}}|_CMRest], check_element_type(XML=[#xmlElement{}|_],[{all,{CM,Occ}}|_CMRest], Env,_Block,S,Checked) -> ?debug("calling choice/6~n",[]), - check_all(XML,CM,Occ,Env,S,Checked,XML); + check_all(XML,CM,Occ,Env,set_num_el(S,0),Checked,XML); %%LTH %% 3 often. CMEL may be ((simpleType | complexType)?, (unique | key | keyref)*)) check_element_type(XML=[XMLEl=#xmlElement{}|_],[CMEl|CMRest],Env, Block,S,Checked) -> @@ -3393,8 +3393,12 @@ qualified_node_set(Paths,[QN|QNs],El,S,Acc) -> end end, {KeySequence,S2} = mapfoldl(Fun,S,Paths), - qualified_node_set(Paths,QNs,El,S2,[flatten(KeySequence)|Acc]). - + case flatten(KeySequence) of + [] -> + qualified_node_set(Paths,QNs,El,S2,Acc); + KS -> + qualified_node_set(Paths,QNs,El,S2,[KS|Acc]) + end. apply_field(F,El,S) -> %% xmerl_xpath:string returns a list |