From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/98247 Path: news.gmane.org!.POSTED!not-for-mail From: r.ermers@hccnet.nl Newsgroups: gmane.comp.tex.context Subject: Re: typesetting serial letters in Context Date: Thu, 15 Jun 2017 23:58:46 +0200 Message-ID: <28CF9D81-7E39-4F45-AEA2-72B7CE679965@hccnet.nl> References: <646D24DD-DA7B-4F0C-ABA3-DBC3477258D4@hccnet.nl> <5C680E0F-A1F2-418E-A47E-30A2E8A7C44B@hccnet.nl> <39CF32AB-08D2-4F5C-9D92-4E71F7FC7286@hccnet.nl> <7fb67473-c59c-9fd5-5ff5-f9648d7d3d89@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Content-Type: multipart/mixed; boundary="===============3833249106503989214==" X-Trace: blaine.gmane.org 1497563951 16043 195.159.176.226 (15 Jun 2017 21:59:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Jun 2017 21:59:11 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jun 15 23:59:07 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLcnC-0003zY-ST for gctc-ntg-context-518@m.gmane.org; Thu, 15 Jun 2017 23:59:06 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B7991103D11; Thu, 15 Jun 2017 23:59:01 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hpFgcKGc3c7s; Thu, 15 Jun 2017 23:59:00 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id DE1FB103CE6; Thu, 15 Jun 2017 23:59:00 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 59A0F103CE6 for ; Thu, 15 Jun 2017 23:58:59 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XZkGaKBNus9c for ; Thu, 15 Jun 2017 23:58:58 +0200 (CEST) Original-Received: from cpsmtpb-ews01.kpnxchange.com (cpsmtpb-ews01.kpnxchange.com [213.75.39.4]) by zapf.ntg.nl (Postfix) with ESMTP id C3F3A103CDB for ; Thu, 15 Jun 2017 23:58:48 +0200 (CEST) Original-Received: from cpsps-ews05.kpnxchange.com ([10.94.84.172]) by cpsmtpb-ews01.kpnxchange.com with Microsoft SMTPSVC(7.5.7601.17514); Thu, 15 Jun 2017 23:58:48 +0200 Original-Received: from CPSMTPM-CMT101.kpnxchange.com ([195.121.3.17]) by cpsps-ews05.kpnxchange.com with Microsoft SMTPSVC(8.5.9600.16384); Thu, 15 Jun 2017 23:58:48 +0200 DKIM-Signature: v=1; a=rsa-sha256; d=kpnmail.nl; s=kpnmail01; c=relaxed/relaxed; t=1497563928; h=mime-version:date:message-id:subject:from:to:content-type; bh=sHcN4DxDcaa91WEz4vZ+7KpuSAJUgsP8lFgX9i9uh8g=; b=Q0E06FCW5MXpXznCTekDRo/hmBsu2qyMZayGxD0ojoW5cR2AT5xu9XmxpLfk+rzyN6a4yly1vVp VWYNz4HTR/2flCwGo7axQNacsstdq5dHKsPYgdRuEsNabu/drt+hapxZOwb9Ah9xjS96HST+ZaUo3 DHih6LBF1HMr1Ax7Yxc= Original-Received: from [192.168.2.12] ([62.131.125.253]) by CPSMTPM-CMT101.kpnxchange.com over TLS secured channel with Microsoft SMTPSVC(8.5.9600.16384); Thu, 15 Jun 2017 23:58:48 +0200 In-Reply-To: <7fb67473-c59c-9fd5-5ff5-f9648d7d3d89@uni-bonn.de> X-Mailer: Apple Mail (2.3251) X-OriginalArrivalTime: 15 Jun 2017 21:58:48.0032 (UTC) FILETIME=[90D4FE00:01D2E622] X-RcptDomain: ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:98247 Archived-At: --===============3833249106503989214== Content-Type: multipart/alternative; boundary="Apple-Mail=_4A9B65F4-A92D-4655-9157-D6694722AFA2" --Apple-Mail=_4A9B65F4-A92D-4655-9157-D6694722AFA2 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Thomas, Thanks for your advice. I would like to have a system with which I can send letters to people in = my database. It would be nice to be able to make selections according to labels = (probably with xmlatt), but that can be done later. I am not a programmer - when I read the documentation, I do not = understand enough of it to the extent to port it to a new program, but I = can adapt and try existing code. Thusfar I have been trying to use the letter module with the xmltext and = xmlflush commands. What can be done to make this work? Thanks! Robert \usemodule[letter] \startbuffer[participants] Hendriks Karel mr. K. levelA 1 june 2017 =20 Arnhem

Mr. K. Hendriks

Grotestraat 5

1234 Arnhem

Janssen Piet P. mr. levelA 1 june 2017 =20 Nijmegen

Mr. P. Janssen

Kortestraat 8

1234 Nijmegen

\stopbuffer \startxmlsetups xml:setups \xmlsetsetup{#1}{contacts|contact|address|prefix}{xml:*} \stopxmlsetups \xmlregistersetup{xml:setups} \startxmlsetups xml:contacts \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:contact %\setupletter[ % name=3D{Sender}, % email=3D{}, % signature=3D{X}] \startletter [opening=3D{Dear \xmltext{#1}{/prefix} \xmltext{#1}{/formalname},}, closing=3D{Kind regards,}, signature=3D{X}, toaddress=3D{\xmltext{#1}{/address}}, subject=3D{Interesting offer}] \input knuth %\xmltext{#1}{/informalname} %Without the letter instructions, the code yields the names in = informalname. \stopletter \stopxmlsetups \starttext \xmlprocessbuffer{main}{participants}{} \stoptext tex error on line 17 in file = /Users/mac/Documents/doc/moperspectief/brieven/brieven2mkiv.tex: ! Use = of \correspondence_start_parameters doesn't match its definition \doifelsenextoptional ...\def \m_syst_action_yes { #1}\def = \m_syst_action_nop... \setupletter ...bleargument \correspondence_setup=20 [\v!letter ] \14>:xml:contact #1->\setupletter=20 = [name=3D{Sender},email=3D{},signature=3D{X}]\def... l.17 } =20 \14>:xml:contacts #1->\xmlflush {#1} =20 l.7 } ' > Op 15 jun. 2017, om 19:02 heeft Thomas A. Schmitz = het volgende geschreven: >=20 > On 06/15/2017 10:51 AM, r.ermers@hccnet.nl wrote: >> I still cannot generate letters from my xml database >=20 > So what are you missing? Make a complete minimal example (you can pack = the xml part into a buffer and then use \xmlprocessbuffer), then people = will try to help you. Right now, we can't even guess where your problems = lie. And writing "I'm not a programmer, so I can't read documentation" = is not very motivating - you've been told where to begin, and you appear = to be making some progress, so show us what you have. >=20 > Thomas --Apple-Mail=_4A9B65F4-A92D-4655-9157-D6694722AFA2 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Hi Thomas,

Thanks for your advice.

I would like to have a = system with which I can send letters to people in my database.

It would be nice to be = able to make selections according to labels (probably with xmlatt), but = that can be done later.

I am not a programmer - when I read the documentation, I do = not understand enough of it to the extent to port it to a new program, = but I can adapt and try existing code.

Thusfar I have been trying to use the = letter module with the xmltext and xmlflush commands. What can be done = to make this work?

Thanks!

Robert


\usemodule[letter]
\startbuffer[participants]

<contacts>
  <contact class=3D'participant' = label=3D'Hendriks'>
    = <formalname>Hendriks</formalname>
  =   <informalname>Karel</informalname>
    <prefix>mr.</prefix>
    <initials>K.</initials>
    = <courselevel>levelA</courselevel>
  =   <coursedate>1 june 2017</coursedate>  
    <city>Arnhem</city>
    <address>
  =     <p>Mr. K. Hendriks</p>
      <p>Grotestraat = 5</p>
      <p>1234 = Arnhem</p>
    = </address>
  </contact>

  <contact = class=3D'participant' label=3D'Janssen'>
  =   <formalname>Janssen</formalname>
    = <informalname>Piet</informalname>
  =   <initials>P.</initials>
  =   <prefix>mr.</prefix>
  =   <courselevel>levelA</courselevel>
    <coursedate>1 june = 2017</coursedate>  
    = <city>Nijmegen</city>
    = <address>
     <p>Mr. P. = Janssen</p>
    =  <p>Kortestraat 8</p>
  =    <p>1234 Nijmegen</p>
  =   </address>
  = </contact>
</contacts>

\stopbuffer


\startxmlsetups xml:setups
\xmlsetsetup{#1}{contacts|contact|address|prefix}{xml:*}
<= div class=3D"">\stopxmlsetups

\xmlregistersetup{xml:setups}

\startxmlsetups = xml:contacts
\xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:contact

%\setupletter[
% =  name=3D{Sender},
%  email=3D{},
%  signature=3D{X}]

\startletter
  = [opening=3D{Dear \xmltext{#1}{/prefix} = \xmltext{#1}{/formalname},},
  =  closing=3D{Kind regards,},
  =  signature=3D{X},
  =  toaddress=3D{\xmltext{#1}{/address}},
  =  subject=3D{Interesting offer}]

\input knuth

%\xmltext{#1}{/informalname}
%Without the letter instructions, the code yields the names = in informalname.

\stopletter
\stopxmlsetups

\starttext
\xmlprocessbuffer{main}{participants}{}
\stoptext


tex error on line 17 in file = /Users/mac/Documents/doc/moperspectief/brieven/brieven2mkiv.tex: ! Use = of \correspondence_start_parameters doesn't match its = definition


\doifelsenextoptional ...\def = \m_syst_action_yes {
  =                     =                     =         #1}\def = \m_syst_action_nop...
\setupletter ...bleargument = \correspondence_setup 
                =                     =               [\v!letter = ]
\14>:xml:contact = #1->\setupletter 
                =                 =   [name=3D{Sender},email=3D{},signature=3D{X}]\def...
l.17 }
    
\14>:xml:contacts #1->\xmlflush {#1}
                 =                   =  
l.7 }


'
Op 15 jun. 2017, om 19:02 heeft Thomas A. = Schmitz <thomas.schmitz@uni-bonn.de> het volgende = geschreven:

On 06/15/2017 10:51 AM, r.ermers@hccnet.nl = wrote:
I still cannot = generate letters from my xml database

So what are you missing? Make a complete minimal example (you = can pack the xml part into a buffer and then use \xmlprocessbuffer), = then people will try to help you. Right now, we can't even guess where = your problems lie. And writing "I'm not a programmer, so I can't read = documentation" is not very motivating - you've been told where to begin, = and you appear to be making some progress, so show us what you have.

Thomas

= --Apple-Mail=_4A9B65F4-A92D-4655-9157-D6694722AFA2-- --===============3833249106503989214== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============3833249106503989214==--