1 USING: kernel xml sequences assocs tools.test io arrays namespaces
2 xml.data xml.utilities xml.writer generic sequences.deep ;
6 T{ name f f "sub" "http://littledan.onigirihouse.com/namespaces/replace" } ;
10 GENERIC: (r-ref) ( xml -- )
16 M: object (r-ref) drop ;
19 [ (r-ref) ] deep-each ;
25 "<html xmlns:f='http://littledan.onigirihouse.com/namespaces/replace'>"
29 "<p f:sub='baz'>paragraph</p>"
33 : test-refs ( -- string )
37 { "bar" { "blah" T{ tag T{ name f "" "a" "" } V{ } f } } }
40 sample-doc string>xml dup template xml>string
43 [ "<?xml version=\"1.0\" encoding=\"UTF-8\"?><html xmlns:f=\"http://littledan.onigirihouse.com/namespaces/replace\"><body><span f:sub=\"foo\">foo</span><div f:sub=\"bar\">blah<a/></div><p f:sub=\"baz\"/></body></html>" ] [ test-refs ] unit-test