diff options
author | Björn Gustavsson <[email protected]> | 2010-09-02 15:44:33 +0200 |
---|---|---|
committer | Lars Thorsen <[email protected]> | 2011-05-10 09:13:23 +0200 |
commit | 824a6db3ff111f8d2427ac5adad0362bf078630a (patch) | |
tree | f146685c27e4c8f91b07f76d3e1e3510553e2e88 /lib/xmerl/test/xmerl_SUITE_data/xpath/xpath_text.erl | |
parent | 1a5796cd12061ebb21e7e51a0b7bdf05ed4786a7 (diff) | |
download | otp-824a6db3ff111f8d2427ac5adad0362bf078630a.tar.gz otp-824a6db3ff111f8d2427ac5adad0362bf078630a.tar.bz2 otp-824a6db3ff111f8d2427ac5adad0362bf078630a.zip |
Add test suite for xmerl
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). + |