</pre>
The we use this modules to retrive a page:
<pre>
from lxml import etree
writeres(title,preamble,postamble,filename)
</pre>
And in the the mkiv wrapper:
<texcode>
\usetypescriptfile[type-gentium]
\usetypescript[gentium]
\setupbodyfont[gentium,10pt]
\setuppapersize[A5][A5]
\setuplayout[height=middle,topspace=1cm,header={2\lineheight},footer=0pt,backspace=1cm,margin=1cm, width=middle]
\startluacode
function testdbxml(title,preamble,postamble,filename)
require("python")
pg = python.globals()
wikiversity = python.import("wikidbxml_queryTxn")
wikiversity.writeres(title,preamble,postamble,filename)
end
\stopluacode
\def\testdbxml[#1]{%
\getparameters[dbxml][#1]%
\ctxlua{testdbxml("\csname dbxmltitle\endcsname","\csname dbxmlpreamble\endcsname",
"\csname dbxmlpostamble\endcsname","\csname dbxmlfilename\endcsname")}%
\input \csname dbxmlfilename\endcsname %
}
\starttext
\testdbxml[title={Primary mathematics/Numbers},
preamble={},
postamble={},
filename={testres.tex}]
\stoptext
</texcode>