1 IN: xmode.utilities.tests
2 USING: accessors xmode.utilities tools.test xml xml.data kernel
3 strings vectors sequences io.files prettyprint assocs
6 TUPLE: company employees type ;
8 : <company> V{ } clone f company boa ;
10 : add-employee employees>> push ;
12 <TAGS: parse-employee-tag
14 TUPLE: employee name description ;
18 { { "name" f (>>name) } { f (>>description) } }
19 init-from-tag swap add-employee ;
23 \ parse-employee-tag see
28 { { "type" >upper (>>type) } }
31 children>> [ tag? ] filter
32 [ parse-employee-tag ] with each ;
37 T{ employee f "Joe" "VP Sales" }
38 T{ employee f "Jane" "CFO" }
43 "vocab:xmode/utilities/test.xml"
44 file>xml parse-company-tag