Dear Contex’ers, I have used the letter module of mkii for serial letters with an xml database (see example), but now I would like to step forward to mkiv. I have found out how to process the xml data from an xml file (now in the buffer). The recipient’s address neatly shows up in the designed place. (See pdf). So far, everything seems OK. Yet when I add text, only the text appears, and all address data from the xml file disappear. You can try it out by uncommenting the %\input knuth or %tekst lines. I have tried various options, but for now I have no idea how to proceed further. Context Version: 2017.07.17 00:20 Lua 5.2.4, This is LuaTeX, Version 1.05.0. Your help is much appreciated! Kind regards, Robert \usemodule[letter] \setuplanguage[nl][date={year, –, mm, –, dd}] % ISO 8601 date \setupletteroptions[language=netherlands,bodyfont={rm,10pt},whitespace=1.5ex] \startbuffer[participants] Hendriks Karel mr. K. Arnhem

Mr. K. Hendriks

Grotestraat 5

1234 BB Arnhem

1234bb5
Janssen Piet P. mr. Nijmegen

Mr. P. Janssen

Kortestraat 8

1234 AA Nijmegen

1234aa8
\stopbuffer \startxmlsetups xml:setups \xmlsetsetup{#1}{document|contacts|contact|prefix|initials|address|city|text|kix|p}{xml:*} %\xmlsetsetup{\xmldocument}{text:p}{xml:paragraph} \stopxmlsetups \xmlregistersetup{xml:setups} \startxmlsetups xml:contacts \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:contact \setupletter [toaddress={\xmlall{#1}{/address/p}\par\xmltext{#1}{/kix}}] \defineletterelement[layer][address][example]% {\correspondenceparameter{toname}\\\correspondenceparameter{toaddress}\par} %toname is not used in setupletter because toaddress contains all data. %kix is used for adding a barcode to the address. \setupletterlayer[address][alternative=example,y=6cm,x=12cm,color=red,style=\tfa\sans] \startletter [opening={Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},}, closing={Kind regards,}, subject={subject: your life in \xmltext{#1}{/city}}, signature={X}] \stopletter \stopxmlsetups \startxmlsetups xml:address \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:p \xmlflushtext{#1}\par \stopxmlsetups \starttext %\input knuth %tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst tekst \xmlprocessbuffer{main}{participants}{} \stoptext