diff options
author | Lars Thorsen <[email protected]> | 2011-11-11 12:10:35 +0100 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2011-11-11 12:10:35 +0100 |
commit | 9151895daf12ddce320a3abe8d9d67200a86af11 (patch) | |
tree | d8ef0bf3b9c3be19f5569920793f2e3443ce9ee4 /lib/xmerl/test | |
parent | edf830a338e78cfe88eee181b1e60a5f3f6b671b (diff) | |
parent | 5b2375ff231353c059a340d95b317d998df279fc (diff) | |
download | otp-9151895daf12ddce320a3abe8d9d67200a86af11.tar.gz otp-9151895daf12ddce320a3abe8d9d67200a86af11.tar.bz2 otp-9151895daf12ddce320a3abe8d9d67200a86af11.zip |
Merge branch 'nox/xmerl-namespace-axis/OTP-9664'
* nox/xmerl-namespace-axis/OTP-9664:
Fix bugs and add a flag to skip comments
Implement namespace axis
Add `#xmlPI` support to xmerl_xpath:write_node/1
Fix processing-instruction(name?)
Fix path filters
Support more top-level primary expressions
Accumulate comments in element nodes
Add `default_attrs` option
Allow whole documents to be returned
Track parents and namespace in `#xmlAttribute` nodes
Track parents in `#xmlPI` nodes
Set `vsn` field in `#xmlDecl` record
Fix namespace-conformance constraints
Diffstat (limited to 'lib/xmerl/test')
-rw-r--r-- | lib/xmerl/test/xmerl_SUITE.erl | 36 | ||||
-rw-r--r-- | lib/xmerl/test/xmerl_SUITE_data/misc.tar.gz | bin | 47340 -> 48157 bytes | |||
-rw-r--r-- | lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_abbrev.erl | 2 |
3 files changed, 35 insertions, 3 deletions
diff --git a/lib/xmerl/test/xmerl_SUITE.erl b/lib/xmerl/test/xmerl_SUITE.erl index 94c38d4d48..55b6d1844c 100644 --- a/lib/xmerl/test/xmerl_SUITE.erl +++ b/lib/xmerl/test/xmerl_SUITE.erl @@ -58,7 +58,7 @@ groups() -> {ticket_tests, [], [ticket_5998, ticket_7211, ticket_7214, ticket_7430, ticket_6873, ticket_7496, ticket_8156, ticket_8697, - ticket_9411, ticket_9457]}, + ticket_9411, ticket_9457, ticket_9664_schema, ticket_9664_dtd]}, {app_test, [], [{xmerl_app_test, all}]}, {appup_test, [], [{xmerl_appup_test, all}]}]. @@ -284,7 +284,7 @@ export(Config) -> ?line {E,_} = xmerl_scan:file(TestFile), ?line Exported = xmerl:export([E],xmerl_xml,[{prolog,Prolog}]), B = list_to_binary(Exported++"\n"), - ?line {ok,B} = file:read_file(TestFile), + ?line {ok, B} = file:read_file(TestFile), ok. %%---------------------------------------------------------------------- @@ -609,6 +609,38 @@ ticket_9457_cont(Continue, Exception, GlobalState) -> Exception(GlobalState) end. + +ticket_9664_schema(suite) -> []; +ticket_9664_schema(doc) -> + ["Test that comments are handled correct whith"]; +ticket_9664_schema(Config) -> + + ?line {E, _} = xmerl_scan:file(filename:join([?config(data_dir, Config), misc, + "ticket_9664_schema.xml"]),[]), + ?line {ok, S} = xmerl_xsd:process_schema(filename:join([?config(data_dir, Config), misc, + "motorcycles.xsd"])), + ?line {E1, _} = xmerl_xsd:validate(E, S), + + ?line {E1,_} = xmerl_xsd:process_validate(filename:join([?config(data_dir,Config), misc, + "motorcycles.xsd"]),E,[]), + + ?line {E1,_} = xmerl_scan:file(filename:join([?config(data_dir,Config), misc, + "ticket_9664_schema.xml"]), + [{schemaLocation, [{"mc", "motorcycles.xsd"}]}, + {validation, schema}]), + ok. + +ticket_9664_dtd(suite) -> []; +ticket_9664_dtd(doc) -> + ["Test that comments are handled correct whith"]; +ticket_9664_dtd(Config) -> + ?line {E, _} = xmerl_scan:file(filename:join([?config(data_dir, Config), misc, + "ticket_9664_dtd.xml"]),[]), + ?line {E, _} = xmerl_scan:file(filename:join([?config(data_dir, Config), misc, + "ticket_9664_dtd.xml"]),[{validation, true}]), + ok. + + %%====================================================================== %% Support Functions %%====================================================================== diff --git a/lib/xmerl/test/xmerl_SUITE_data/misc.tar.gz b/lib/xmerl/test/xmerl_SUITE_data/misc.tar.gz Binary files differindex fef7431845..ffc1d327a5 100644 --- a/lib/xmerl/test/xmerl_SUITE_data/misc.tar.gz +++ b/lib/xmerl/test/xmerl_SUITE_data/misc.tar.gz diff --git a/lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_abbrev.erl b/lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_abbrev.erl index 850b7f8135..7b6f1e95b3 100644 --- a/lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_abbrev.erl +++ b/lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_abbrev.erl @@ -210,7 +210,7 @@ ticket_7496() -> ?line {Doc3,_} = xmerl_scan:file("documentRoot.xml"), ?line ok = Test(Doc3,"//child",[child,child,child]), ?line ok = Test(Doc3,"//child[@name='beta']",[child]), - ?line [{xmlAttribute,id,[],[],[],[],1,[],"2",false}] = + ?line [{xmlAttribute,id,[],[],[],_,1,[],"2",false}] = xmerl_xpath:string("/documentRoot/parent/child[@name='beta']/@id",Doc3), ?line ok = Test(Doc3,"/documentRoot/parent/child|/documentRoot/parent/pet", [child,child,child,pet,pet]), |