diff options
Diffstat (limited to 'lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_text.erl')
-rw-r--r-- | lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_text.erl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_text.erl b/lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_text.erl new file mode 100644 index 0000000000..e39ad6bcb0 --- /dev/null +++ b/lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_text.erl @@ -0,0 +1,28 @@ +%%%------------------------------------------------------------------- +%%% File : xpath_text.erl +%%% Author : Bertil Karlsson <bertil@finrod> +%%% Description : +%%% +%%% Created : 14 Dec 2004 by Bertil Karlsson <bertil@finrod> +%%%------------------------------------------------------------------- +-module(xpath_text). + +-compile(export_all). + +-include("test_server.hrl"). +-include_lib("xmerl/include/xmerl.hrl"). + +-import(xmerl_xs, + [ xslapply/2, value_of/1, select/2, built_in_rules/2 ]). + + +one() -> + ?line {A,_}=xmerl_scan:file('motorcycles.xml'), + ?line [["Suzuki","Yamaha"]] = template(A), + ok. + +%%% templates, test of OTP-5268 +template(E = #xmlElement{name='motorcycles'}) -> + [value_of(select("bike/name/manufacturer/text()",E))]; +template(E) -> built_in_rules(fun template/1, E). + |