factor/basis/xml/tests/soap.factor

16 lines
432 B
Factor
Raw Normal View History

2009-02-05 22:17:03 -05:00
USING: sequences xml kernel arrays xml.traversal io.files tools.test ;
2008-03-01 17:00:45 -05:00
IN: xml.tests
2007-09-20 18:09:08 -04:00
: assemble-data ( tag -- 3array )
{ "URL" "snippet" "title" }
2008-01-09 17:36:30 -05:00
[ tag-named children>string ] with map ;
2007-09-20 18:09:08 -04:00
: parse-result ( xml -- seq )
2007-12-23 14:57:39 -05:00
"resultElements" deep-tag-named "item" tags-named
2007-09-20 18:09:08 -04:00
[ assemble-data ] map ;
[ "http://www.foxnews.com/oreilly/" ] [
2009-02-15 20:53:21 -05:00
"vocab:xml/tests/soap.xml" file>xml
2007-09-20 18:09:08 -04:00
parse-result first first
] unit-test