aboutsummaryrefslogtreecommitdiffstats
path: root/lib/xmerl/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xmerl/src')
-rw-r--r--lib/xmerl/src/xmerl_sax_parser.erl1
-rw-r--r--lib/xmerl/src/xmerl_xsd.erl14
2 files changed, 10 insertions, 5 deletions
diff --git a/lib/xmerl/src/xmerl_sax_parser.erl b/lib/xmerl/src/xmerl_sax_parser.erl
index eb9f8deec6..c1acf51b8a 100644
--- a/lib/xmerl/src/xmerl_sax_parser.erl
+++ b/lib/xmerl/src/xmerl_sax_parser.erl
@@ -278,6 +278,7 @@ detect_charset_1(Xml, State) ->
convert_encoding(Enc) -> %% Just for 7,8 bit + utf8
case string:to_lower(Enc) of
"utf-8" -> utf8;
+ "us-ascii" -> utf8;
"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_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