diff options
author | Lars Thorsen <[email protected]> | 2011-09-26 11:11:47 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2011-09-26 11:11:47 +0200 |
commit | a5baff1ab34518a5282da7ec9a32ac8ec991d4b4 (patch) | |
tree | 0c3950afaa526f7f1cb0f33de91640b0c112506f /lib/xmerl/src | |
parent | f8f0c5a1bc435fbb9d816323f1f0abfe992a6e3e (diff) | |
parent | 97f3a064f27843a9f825210c1c7a27075b7b3ad7 (diff) | |
download | otp-a5baff1ab34518a5282da7ec9a32ac8ec991d4b4.tar.gz otp-a5baff1ab34518a5282da7ec9a32ac8ec991d4b4.tar.bz2 otp-a5baff1ab34518a5282da7ec9a32ac8ec991d4b4.zip |
Merge branch 'dev' into major
* dev:
[xmerl] Fix streaming bug in xmerl_scan (Thanks to Simon Cornish)
Diffstat (limited to 'lib/xmerl/src')
-rw-r--r-- | lib/xmerl/src/xmerl_scan.erl | 21 | ||||
-rw-r--r-- | lib/xmerl/src/xmerl_xsd.erl | 6 |
2 files changed, 16 insertions, 11 deletions
diff --git a/lib/xmerl/src/xmerl_scan.erl b/lib/xmerl/src/xmerl_scan.erl index e598c5f56d..25c6547497 100644 --- a/lib/xmerl/src/xmerl_scan.erl +++ b/lib/xmerl/src/xmerl_scan.erl @@ -2074,10 +2074,10 @@ scan_element(T, S, Pos, Name, StartL, StartC, Attrs, Lang, Parents, {AttName, NamespaceInfo, T1, S1} = scan_name(T, S), {T2, S2} = scan_eq(T1, S1), {AttType,_DefaultDecl} = get_att_type(S2,AttName,Name), - {AttValue, T3, S3,IsNorm} = scan_att_value(T2, S2, AttType), + {AttValue, T3a, S3a,IsNorm} = scan_att_value(T2, S2, AttType), %% check_default_value(S3,DefaultDecl,AttValue), NewNS = check_namespace(AttName, NamespaceInfo, AttValue, NS), - wfc_whitespace_betw_attrs(hd(T3),S3), + {T3,S3} = wfc_whitespace_betw_attrs(T3a,S3a), ?strip4, AttrPos = case Attrs of [] -> @@ -3284,12 +3284,17 @@ wfc_legal_char(Ch,S) -> end. -wfc_whitespace_betw_attrs(WS,_S) when ?whitespace(WS) -> - ok; -wfc_whitespace_betw_attrs($/,_S) -> - ok; -wfc_whitespace_betw_attrs($>,_S) -> - ok; +wfc_whitespace_betw_attrs([WS |_]=L,S) when ?whitespace(WS) -> + {L,S}; +wfc_whitespace_betw_attrs([$/ |_]=L,S) -> + {L,S}; +wfc_whitespace_betw_attrs([$> |_]=L,S) -> + {L,S}; +wfc_whitespace_betw_attrs([],S=#xmerl_scanner{continuation_fun = F}) -> + ?dbg("cont()...~n", []), + F(fun(MoreBytes, S1) -> wfc_whitespace_betw_attrs(MoreBytes, S1) end, + fun(S1) -> ?fatal(unexpected_end, S1) end, + S); wfc_whitespace_betw_attrs(_,S) -> ?fatal({whitespace_required_between_attributes},S). diff --git a/lib/xmerl/src/xmerl_xsd.erl b/lib/xmerl/src/xmerl_xsd.erl index 50c0a79016..dfdc6138ef 100644 --- a/lib/xmerl/src/xmerl_xsd.erl +++ b/lib/xmerl/src/xmerl_xsd.erl @@ -355,9 +355,9 @@ initiate_state(Opts,Schema) -> XSDBase = filename:dirname(Schema), {{state,S},RestOpts}=new_state(Opts), S2 = create_tables(S), - S3 = initiate_state2(S2#xsd_state{schema_name = Schema, xsd_base=XSDBase, - fetch_fun = fun fetch/2}, - RestOpts). + initiate_state2(S2#xsd_state{schema_name = Schema, xsd_base=XSDBase, + fetch_fun = fun fetch/2}, + RestOpts). initiate_state2(S,[]) -> S; |