Vocabulary
syndication

Inputs and outputs
feeda feed
xmla xml


Word description
Converts a feed to Atom XML form.

Notes
The result of this word can then be passed to write-xml, or stored in an HTTP response object.

Definition


: feed>xml ( feed -- xml )
[ title>> ] [ url>> present ]
[ entries>> [ entry>xml ] map ] tri 3 nenum T{ xml
{ prolog
T{ prolog { version "1.0" } { encoding "UTF-8" } }
}
{ before V{ } }
{ body
T{ tag
{ name
T{ name
{ space "" }
{ main "feed" }
{ url "http://www.w3.org/2005/Atom" }
}
}
{ attrs T{ attrs { alist ~vector~ } } }
{ children
V{
"\n "
~tag~
"\n "
~tag~
"\n "
~interpolated~
"\n "
}
}
}
}
{ after V{ "" } }
} interpolate-xml ;