ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* letters in context mkiv
@ 2017-07-28  6:18 r.ermers
  0 siblings, 0 replies; 16+ messages in thread
From: r.ermers @ 2017-07-28  6:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/html, Size: 7557 bytes --]

[-- Attachment #1.2: brieven2mkiv.pdf --]
[-- Type: application/pdf, Size: 15333 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread
* letters in context mkiv
@ 2017-07-30 12:15 r.ermers
  2017-07-30 15:38 ` Schmitz Thomas A.
       [not found] ` <597DFB2C.60001@gmail.com>
  0 siblings, 2 replies; 16+ messages in thread
From: r.ermers @ 2017-07-30 12:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/html, Size: 10281 bytes --]

[-- Attachment #1.2: brieven2mkiv.pdf --]
[-- Type: application/pdf, Size: 15333 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread
* letters in context mkiv
@ 2017-07-28  6:18 r.ermers
  0 siblings, 0 replies; 16+ messages in thread
From: r.ermers @ 2017-07-28  6:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3038 bytes --]

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]
<contacts>
  <contact class='participant' label='Hendriks'>
    <formalname>Hendriks</formalname>
    <informalname>Karel</informalname>
    <prefix>mr.</prefix>
    <initials>K.</initials>
    <city>Arnhem</city>
    <address>
      <p>Mr. K. Hendriks</p>
      <p>Grotestraat 5</p>
      <p>1234 BB Arnhem</p>
    </address>
    <kix>1234bb5</kix>
  </contact>
  <contact class='participant' label='Janssen'>
    <formalname>Janssen</formalname>
    <informalname>Piet</informalname>
    <initials>P.</initials>
    <prefix>mr.</prefix>
    <city>Nijmegen</city>
    <address>
     <p>Mr. P. Janssen</p>
     <p>Kortestraat 8</p>
     <p>1234 AA Nijmegen</p>
    </address>
    <kix>1234aa8</kix>
  </contact>
</contacts>
\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

[-- Attachment #1.2.1: Type: text/html, Size: 2231 bytes --]

[-- Attachment #1.2.2: brieven2mkiv.pdf --]
[-- Type: application/pdf, Size: 15333 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 5337 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread
* letters in context mkiv
@ 2017-07-25 11:14 r.ermers
  0 siblings, 0 replies; 16+ messages in thread
From: r.ermers @ 2017-07-25 11:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3075 bytes --]

Dear Contex’ers,

I use Context for many things. One of them is letters.
I have used the letter module of mkii 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]
<contacts>
  <contact class='participant' label='Hendriks'>
    <formalname>Hendriks</formalname>
    <informalname>Karel</informalname>
    <prefix>mr.</prefix>
    <initials>K.</initials>
    <city>Arnhem</city>
    <address>
      <p>Mr. K. Hendriks</p>
      <p>Grotestraat 5</p>
      <p>1234 BB Arnhem</p>
    </address>
    <kix>1234bb5</kix>
  </contact>
  <contact class='participant' label='Janssen'>
    <formalname>Janssen</formalname>
    <informalname>Piet</informalname>
    <initials>P.</initials>
    <prefix>mr.</prefix>
    <city>Nijmegen</city>
    <address>
     <p>Mr. P. Janssen</p>
     <p>Kortestraat 8</p>
     <p>1234 AA Nijmegen</p>
    </address>
    <kix>1234aa8</kix>
  </contact>
</contacts>
\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

[-- Attachment #1.2.1: Type: text/html, Size: 1904 bytes --]

[-- Attachment #1.2.2: brieven2mkiv.pdf --]
[-- Type: application/pdf, Size: 15333 bytes --]

[-- Attachment #1.2.3: Type: text/html, Size: 4955 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-08-01 12:04 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-28  6:18 letters in context mkiv r.ermers
  -- strict thread matches above, loose matches on Subject: below --
2017-07-30 12:15 r.ermers
2017-07-30 15:38 ` Schmitz Thomas A.
2017-07-31  8:09   ` r.ermers
     [not found] ` <597DFB2C.60001@gmail.com>
2017-07-31 10:48   ` r.ermers
2017-07-31 15:23     ` Pablo Rodriguez
2017-07-31 16:58       ` r.ermers
2017-07-31 17:23         ` Pablo Rodriguez
2017-07-31 21:57         ` Schmitz Thomas A.
2017-08-01  7:55           ` r.ermers
2017-08-01  8:46             ` Schmitz Thomas A.
2017-08-01 10:15               ` r.ermers
2017-08-01 11:17                 ` Schmitz Thomas A.
2017-08-01 12:04                   ` r.ermers
2017-07-28  6:18 r.ermers
2017-07-25 11:14 r.ermers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).