summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_base.erlsrc151
-rw-r--r--lib/xmerl/test/xmerl_sax_std_SUITE.erl166
2 files changed, 227 insertions, 90 deletions
diff --git a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
index ef753c7148..d7128dd4d0 100644
--- a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
@@ -273,7 +273,67 @@ parse_xml_decl_rest(?STRING_UNBOUND_REST(C, Rest) = Bytes, State) ->
parse_xml_decl_rest(Bytes, State) ->
unicode_incomplete_check([Bytes, State, fun parse_xml_decl_rest/2], undefined).
-
+%%----------------------------------------------------------------------
+%% Function: parse_text_decl(Rest, State) -> Result
+%% Input: Rest = string() | binary()
+%% State = #xmerl_sax_parser_state{}
+%% Output: Result = {Rest, State}
+%% Description: Parsing the text declaration in an external parsed entity.
+%% [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
+%%----------------------------------------------------------------------
+parse_text_decl(?STRING_EMPTY, State) ->
+ cf(?STRING_EMPTY, State, fun parse_text_decl/2);
+parse_text_decl(?STRING("<") = Bytes, State) ->
+ cf(Bytes, State, fun parse_text_decl/2);
+parse_text_decl(?STRING("<?") = Bytes, State) ->
+ cf(Bytes, State, fun parse_text_decl/2);
+parse_text_decl(?STRING("<?x") = Bytes, State) ->
+ cf(Bytes, State, fun parse_text_decl/2);
+parse_text_decl(?STRING("<?xm") = Bytes, State) ->
+ cf(Bytes, State, fun parse_text_decl/2);
+parse_text_decl(?STRING("<?xml") = Bytes, State) ->
+ cf(Bytes, State, fun parse_text_decl/2);
+parse_text_decl(?STRING_REST("<?xml", Rest1), State) ->
+ parse_text_decl_rest(Rest1, State);
+parse_text_decl(Bytes, State) when is_binary(Bytes) ->
+ {Bytes, State}.
+
+parse_text_decl_rest(?STRING_EMPTY, State) ->
+ cf(?STRING_EMPTY, State, fun parse_text_decl_rest/2);
+parse_text_decl_rest(?STRING("?") = Rest, State) ->
+ cf(Rest, State, fun parse_text_decl_rest/2);
+parse_text_decl_rest(?STRING("v") = Rest, State) ->
+ cf(Rest, State, fun parse_text_decl_rest/2);
+parse_text_decl_rest(?STRING("e") = Rest, State) ->
+ cf(Rest, State, fun parse_text_decl_rest/2);
+parse_text_decl_rest(?STRING_UNBOUND_REST("?>", Rest) = _Bytes, State) ->
+ {Rest, State};
+parse_text_decl_rest(?STRING_UNBOUND_REST(C, _) = Rest, State) when ?is_whitespace(C) ->
+ {_WS, Rest1, State1} = whitespace(Rest, State, []),
+ parse_text_decl_rest(Rest1, State1);
+parse_text_decl_rest(?STRING_UNBOUND_REST("v", Rest) = _Bytes, State) ->
+ case parse_name(Rest, State, [$v]) of
+ {"version", Rest1, State1} ->
+ {Rest2, State2} = parse_eq(Rest1, State1),
+ {_Version, Rest3, State3} = parse_att_value(Rest2, State2),
+ parse_text_decl_rest(Rest3, State3);
+ {_, _, State1} ->
+ ?fatal_error(State1, "expecting attribute version")
+ end;
+parse_text_decl_rest(?STRING_UNBOUND_REST("e", Rest) = _Bytes, State) ->
+ case parse_name(Rest, State, [$e]) of
+ {"encoding", Rest1, State1} ->
+ {Rest2, State2} = parse_eq(Rest1, State1),
+ {_Version, Rest3, State3} = parse_att_value(Rest2, State2),
+ parse_text_decl_rest(Rest3, State3);
+ {_, _, State1} ->
+ ?fatal_error(State1, "expecting attribute encoding")
+ end;
+parse_text_decl_rest(?STRING_UNBOUND_REST(_, _), State) ->
+ ?fatal_error(State, "expecting attribute encoding or version");
+parse_text_decl_rest(Bytes, State) ->
+ unicode_incomplete_check([Bytes, State, fun parse_text_decl_rest/2],
+ "expecting attribute encoding or version").
%%----------------------------------------------------------------------
%% Function: parse_prolog(Rest, State) -> Result
@@ -1254,6 +1314,81 @@ parse_content(Bytes, State, Acc, IgnorableWS) ->
unicode_incomplete_check([Bytes, State, Acc, IgnorableWS, fun parse_content/4],
undefined).
+%%----------------------------------------------------------------------
+%% Function: parse_entity_content(Rest, State, Acc, IgnorableWS) -> Result
+%% Parameters: Rest = string() | binary()
+%% State = #xmerl_sax_parser_state{}
+%% Acc = string()
+%% IgnorableWS = true | false
+%% Result : {Rest, State}
+%% Description: Parsing the content part of an external entity
+%% [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
+%%----------------------------------------------------------------------
+parse_entity_content(?STRING_EMPTY, State, Acc, IgnorableWS) ->
+ parse_content(?STRING_EMPTY, State, Acc, IgnorableWS);
+parse_entity_content(?STRING_REST("<", Rest1), State, Acc, IgnorableWS) ->
+ State1 = send_character_event(length(Acc), IgnorableWS, lists:reverse(Acc), State),
+ case parse_stag(Rest1, State1) of
+ {?STRING_EMPTY, State2} ->
+ {?STRING_EMPTY, State2};
+ {Rest2, State2} when is_record(State2, xmerl_sax_parser_state) ->
+ parse_entity_content(Rest2, State2, [], true);
+ Other ->
+ Other
+ end;
+parse_entity_content(?STRING_REST("\n", Rest), State, Acc, IgnorableWS) ->
+ N = State#xmerl_sax_parser_state.line_no,
+ parse_entity_content(Rest, State#xmerl_sax_parser_state{line_no=N+1},[?lf |Acc], IgnorableWS);
+parse_entity_content(?STRING_REST("\r\n", Rest), State, Acc, IgnorableWS) ->
+ N = State#xmerl_sax_parser_state.line_no,
+ parse_entity_content(Rest, State#xmerl_sax_parser_state{line_no=N+1},[?lf |Acc], IgnorableWS);
+parse_entity_content(?STRING_REST("\r", Rest), State, Acc, IgnorableWS) ->
+ N = State#xmerl_sax_parser_state.line_no,
+ parse_entity_content(Rest, State#xmerl_sax_parser_state{line_no=N+1},[?lf |Acc], IgnorableWS);
+parse_entity_content(?STRING_REST(" ", Rest), State, Acc, IgnorableWS) ->
+ parse_entity_content(Rest, State,[?space |Acc], IgnorableWS);
+parse_entity_content(?STRING_REST("\t", Rest), State, Acc, IgnorableWS) ->
+ parse_entity_content(Rest, State,[?tab |Acc], IgnorableWS);
+parse_entity_content(?STRING_REST("&", Rest), State, Acc, _IgnorableWS) ->
+ {Ref, Rest1, State1} = parse_reference(Rest, State, true),
+ case Ref of
+ {character, _, CharValue} ->
+ parse_entity_content(Rest1, State1, [CharValue | Acc], false);
+ {internal_general, true, _, Value} ->
+ parse_entity_content(Rest1, State1, Value ++ Acc, false);
+ {internal_general, false, _, Value} ->
+ IValue = ?TO_INPUT_FORMAT(Value),
+ parse_entity_content(?APPEND_STRING(IValue, Rest1), State1, Acc, false);
+ {external_general, _, {PubId, SysId}} ->
+ State2 = parse_external_entity(State1, PubId, SysId),
+ parse_entity_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_entity_content(Rest1, State1, ";" ++ lists:reverse(Name) ++ "&" ++ Acc, false)
+ end;
+ {unparsed, Name, _} ->
+ ?fatal_error(State1, "Unparsed entity reference in content: " ++ Name)
+ end;
+parse_entity_content(?STRING_UNBOUND_REST(C, Rest), State, Acc, _IgnorableWS) ->
+ if
+ ?is_char(C) ->
+ case parse_content(Rest, State, [C|Acc], false) of
+ {?STRING_EMPTY, State1} ->
+ {?STRING_EMPTY, State1};
+ {Rest1, State1} when is_record(State1, xmerl_sax_parser_state) ->
+ parse_entity_content(Rest1, State1, [], true);
+ Other ->
+ Other
+ end;
+ true ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character in content: ~p", [C])))
+ end;
+parse_entity_content(Bytes, State, Acc, IgnorableWS) ->
+ unicode_incomplete_check([Bytes, State, Acc, IgnorableWS, fun parse_entity_content/4],
+ undefined).
%%----------------------------------------------------------------------
%% Function: check_if_document_complete(State, ErrorMsg) -> Result
@@ -1808,11 +1943,11 @@ handle_external_entity({Tag, _Url}, State) ->
%% Result : {Rest, State}
%% Description: Parse the external entity.
%%----------------------------------------------------------------------
-parse_external_entity_1(?STRING_EMPTY, #xmerl_sax_parser_state{file_type=Type} = State) ->
+parse_external_entity_1(?STRING_EMPTY, State) ->
case catch cf(?STRING_EMPTY, State, fun parse_external_entity_1/2) of
{Rest, State1} when is_record(State1, xmerl_sax_parser_state) ->
{Rest, State1};
- {fatal_error, {State1, "No more bytes"}} when Type == dtd; Type == entity ->
+ {fatal_error, {State1, "No more bytes"}} ->
{?STRING_EMPTY, State1};
Other ->
throw(Other)
@@ -1833,10 +1968,12 @@ parse_external_entity_1(?STRING_REST("<?xml", Rest) = Bytes,
case is_next_char_whitespace(Rest, State) of
false ->
{Bytes, State};
- true ->
+ true when Type =:= dtd ->
{_XmlAttributes, R, S} = parse_version_info(Rest, State, []),
%S1 = event_callback({processingInstruction, "xml", XmlAttributes}, S),% The XML decl. should not be reported as a PI
- {R, S}
+ {R, S};
+ true ->
+ parse_text_decl(Bytes, State)
end,
case Type of
dtd ->
@@ -1850,13 +1987,13 @@ parse_external_entity_1(?STRING_REST("<?xml", Rest) = Bytes,
end;
_ -> % Type is normal or entity
- parse_content(Rest1, State1, [], true)
+ parse_entity_content(Rest1, State1, [], true)
end;
parse_external_entity_1(?STRING_UNBOUND_REST(_C, _) = Bytes,
#xmerl_sax_parser_state{file_type=Type} = State) ->
case Type of
normal ->
- parse_content(Bytes, State, [], true);
+ parse_entity_content(Bytes, State, [], true);
dtd ->
parse_doctype_decl(Bytes, State);
entity ->
diff --git a/lib/xmerl/test/xmerl_sax_std_SUITE.erl b/lib/xmerl/test/xmerl_sax_std_SUITE.erl
index b8412206cc..36424baf3b 100644
--- a/lib/xmerl/test/xmerl_sax_std_SUITE.erl
+++ b/lib/xmerl/test/xmerl_sax_std_SUITE.erl
@@ -2440,11 +2440,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: not-wf-ext-sa-002
%% Type: not-wf
%% Sections: 4.3.1 4.3.2 [77, 78]
-'not-wf-ext-sa-002'(Config) -> {skip, "Fix 1"}.
- %%file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
- %%Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","not-wf/ext-sa/002.xml"]),
- %%R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
- %%check_result(R, "not-wf").
+'not-wf-ext-sa-002'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","not-wf/ext-sa/002.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "not-wf").
%%----------------------------------------------------------------------
%% Test Case
@@ -2452,11 +2452,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: not-wf-ext-sa-003
%% Type: not-wf
%% Sections: 2.6 [17]
-'not-wf-ext-sa-003'(Config) -> {skip, "Fix 1"}.
- %%file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
- %%Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","not-wf/ext-sa/003.xml"]),
- %%R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
- %%check_result(R, "not-wf").
+'not-wf-ext-sa-003'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","not-wf/ext-sa/003.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "not-wf").
%%----------------------------------------------------------------------
%% Test Case
@@ -2644,11 +2644,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-sa-012
%% Type: valid
%% Sections: 2.3 [4]
-'valid-sa-012'(Config) -> {skip, "Fix 1"}.
- %%file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
- %%Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/sa/012.xml"]),
- %%R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
- %%check_result(R, "valid").
+'valid-sa-012'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/sa/012.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4300,11 +4300,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-001
%% Type: valid
%% Sections: 2.11
-'valid-ext-sa-001'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/001.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-001'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/001.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4312,11 +4312,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-002
%% Type: valid
%% Sections: 2.11
-'valid-ext-sa-002'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/002.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-002'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/002.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4324,11 +4324,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-003
%% Type: valid
%% Sections: 3.1 4.1 [43] [68]
-'valid-ext-sa-003'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/003.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-003'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/003.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4336,11 +4336,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-004
%% Type: valid
%% Sections: 2.11
-'valid-ext-sa-004'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/004.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-004'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/004.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4348,11 +4348,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-005
%% Type: valid
%% Sections: 3.2.1 4.2.2 [48] [75]
-'valid-ext-sa-005'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/005.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-005'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/005.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4360,11 +4360,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-006
%% Type: valid
%% Sections: 2.11 3.2.1 3.2.2 4.2.2 [48] [51] [75]
-'valid-ext-sa-006'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/006.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-006'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/006.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4372,7 +4372,7 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-007
%% Type: valid
%% Sections: 4.2.2 4.4.3 [75]
-'valid-ext-sa-007'(_Config) -> {skip, "NYI"}.
+'valid-ext-sa-007'(_Config) -> {skip, "Different encoding in entity"}.
%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/007.xml"]),
%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
@@ -4384,7 +4384,7 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-008
%% Type: valid
%% Sections: 4.2.2 4.3.3. 4.4.3 [75] [80]
-'valid-ext-sa-008'(_Config) -> {skip, "NYI"}.
+'valid-ext-sa-008'(_Config) -> {skip, "Different encoding in entity"}.
%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/008.xml"]),
%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
@@ -4396,11 +4396,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-009
%% Type: valid
%% Sections: 2.11
-'valid-ext-sa-009'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/009.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-009'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/009.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4408,11 +4408,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-011
%% Type: valid
%% Sections: 2.11 4.2.2 [75]
-'valid-ext-sa-011'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/011.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-011'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/011.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4420,11 +4420,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-012
%% Type: valid
%% Sections: 4.2.1 4.2.2
-'valid-ext-sa-012'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/012.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-012'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/012.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4432,11 +4432,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-013
%% Type: valid
%% Sections: 3.3.3
-'valid-ext-sa-013'(_Config) -> {skip, "NYI"}.
-%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
-%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/013.xml"]),
-%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
-%% check_result(R, "valid").
+'valid-ext-sa-013'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/013.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "valid").
%%----------------------------------------------------------------------
%% Test Case
@@ -4444,7 +4444,7 @@ end_per_testcase(_Func,_Config) ->
%% ID: valid-ext-sa-014
%% Type: valid
%% Sections: 4.1 4.4.3 [68]
-'valid-ext-sa-014'(_Config) -> {skip, "NYI"}.
+'valid-ext-sa-014'(_Config) -> {skip, "Different encoding in entity"}.
%% file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
%% Path = filename:join([xmerl_test_lib:get_data_dir(Config),"xmltest","valid/ext-sa/014.xml"]),
%% R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
@@ -16291,11 +16291,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: ibm-not-wf-P77-ibm77n02.xml
%% Type: not-wf
%% Sections: 4.3.1
-'ibm-not-wf-P77-ibm77n02'(Config) -> {skip, "Fix 3"}.
- %%file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
- %%Path = filename:join([xmerl_test_lib:get_data_dir(Config),"ibm","not-wf/P77/ibm77n02.xml"]),
- %%R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
- %%check_result(R, "not-wf").
+'ibm-not-wf-P77-ibm77n02'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"ibm","not-wf/P77/ibm77n02.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "not-wf").
%%----------------------------------------------------------------------
%% Test Case
@@ -16332,11 +16332,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: ibm-not-wf-P78-ibm78n01.xml
%% Type: not-wf
%% Sections: 4.3.2
-'ibm-not-wf-P78-ibm78n01'(Config) -> {skip, "Fix 3"}.
- %%file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
- %%Path = filename:join([xmerl_test_lib:get_data_dir(Config),"ibm","not-wf/P78/ibm78n01.xml"]),
- %%R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
- %%check_result(R, "not-wf").
+'ibm-not-wf-P78-ibm78n01'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"ibm","not-wf/P78/ibm78n01.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "not-wf").
%%----------------------------------------------------------------------
%% Test Case
@@ -16344,11 +16344,11 @@ end_per_testcase(_Func,_Config) ->
%% ID: ibm-not-wf-P78-ibm78n02.xml
%% Type: not-wf
%% Sections: 4.3.2
-'ibm-not-wf-P78-ibm78n02'(Config) -> {skip, "Fix 3"}.
- %%file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
- %%Path = filename:join([xmerl_test_lib:get_data_dir(Config),"ibm","not-wf/P78/ibm78n02.xml"]),
- %%R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
- %%check_result(R, "not-wf").
+'ibm-not-wf-P78-ibm78n02'(Config) ->
+ file:set_cwd(xmerl_test_lib:get_data_dir(Config)),
+ Path = filename:join([xmerl_test_lib:get_data_dir(Config),"ibm","not-wf/P78/ibm78n02.xml"]),
+ R = xmerl_sax_parser:file(Path, [{event_fun, fun(_,_,S) -> S end}]),
+ check_result(R, "not-wf").
%%----------------------------------------------------------------------
%% Test Cases