From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94507 Path: news.gmane.org!not-for-mail From: Mica Semrick Newsgroups: gmane.comp.tex.context Subject: Re: xml input Date: Thu, 21 Apr 2016 07:38:25 -0700 Message-ID: <7F1E79E7-6FE3-4D33-B27D-0B6E0D22F9FD@silentumbrella.com> References: <8ACED9AF-31FB-4C80-9D4C-6A545EA13634@uva.nl> <570F58C0.4090107@wxs.nl> <545694FE-156E-4912-9D98-A59815EB6F47@uva.nl> <571003F2.6040105@gmx.es> <500669F7-BE73-4372-8F05-35E6997C3B9F@silentumbrella.com> <9C2C0247-95F7-47B1-A1A8-4FE147A880F7@uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3921030412060160388==" X-Trace: ger.gmane.org 1461249555 28522 80.91.229.3 (21 Apr 2016 14:39:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Apr 2016 14:39:15 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 21 16:39:01 2016 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 plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1atFkt-0003c8-RB for gctc-ntg-context-518@m.gmane.org; Thu, 21 Apr 2016 16:38:55 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id C7C45AC69; Thu, 21 Apr 2016 16:38:42 +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 xRAL8hf2MDOM; Thu, 21 Apr 2016 16:38:41 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id E9DCBAC6E; Thu, 21 Apr 2016 16:38:41 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 3B8FCAC69 for ; Thu, 21 Apr 2016 16:38:40 +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 XRcMtVzmfrBw for ; Thu, 21 Apr 2016 16:38:39 +0200 (CEST) Original-Received: from slow1-d.mail.gandi.net (slow1-d.mail.gandi.net [217.70.178.86]) by zapf.ntg.nl (Postfix) with ESMTP id 61B5DAC67 for ; Thu, 21 Apr 2016 16:38:29 +0200 (CEST) Original-Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id EBCAA47E9B2 for ; Thu, 21 Apr 2016 16:38:28 +0200 (CEST) X-Originating-IP: 96.229.204.29 Original-Received: from android-1dd7324701492dc5.lan (unknown [96.229.204.29]) (Authenticated sender: mica@silentumbrella.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 42B8CFB8C2 for ; Thu, 21 Apr 2016 16:38:27 +0200 (CEST) User-Agent: K-9 Mail for Android In-Reply-To: <9C2C0247-95F7-47B1-A1A8-4FE147A880F7@uva.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:94507 Archived-At: --===============3921030412060160388== Content-Type: multipart/alternative; boundary="----0809RHNP4IOURCC9859DNOV3PYYYHV" Content-Transfer-Encoding: 7bit ------0809RHNP4IOURCC9859DNOV3PYYYHV Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thank you, this is much appreciated! Best, Mica On April 21, 2016 12:41:26 AM PDT, "Meer, Hans van der" wrote: >A week ago I posted here by accident part of a private conversation (in >Dutch) with Hans Hagen. I already apologized for this. > >On 15 Apr 2016, at 00:47, Mica Semrick >> wrote: > >I'm interested in this thread too... But I'm american, so English only. >I appreciate your understanding! > > >>From reactions I understood that other people are interested in this >subject of \xmlinclude too, but at that moment I could not produce a >coherent story. >After having produced some minimal (1) working, (2) not working and >(3) crashing examples, I dare hope that my contribution of these will >be of some use. And perhaps they will spawn better suggestions and >better understanding of what happens, because I must confess I am >somewhat unsure with functional language behaviour, being raised with >Assembler, Algol, Pascal, Fortran, and so on ;-) > >Find below my examples. One can call each of them by commenting out the >\starthiding. >The last one can be executed by removing the %%%%'s at the front of the >offending statement. >Again, I hope this post will be of some use. > >Hans van der Meer > >contents of file minimal-example.xml: > > > >Body of first note > > >Body of second note > > > >Three exampel programs: > >\enabletrackers[lxml.loading,lxml.setups] >\startbuffer[notes-xml] > > > > >\stopbuffer > >\starthiding >% Test #1 >\startxmlsetups notes:setups >\xmlsetsetup{#1}{*}{-} >\xmlsetsetup{#1}{notes}{notes:*} >\stopxmlsetups >\xmlregisterdocumentsetup{notes}{notes:setups} >\startxmlsetups notes:notes >\xmlinclude{#1}{include}{file} >\xmlshow{#1} >=3D=3D=3D> number of =3D \xmlcount{#1}{note} >\stopxmlsetups >\starttext >Ok with \type{\xmlprocessbuffer{notes}{notes-xml}{notes:notes}}\crlf >\xmlprocessbuffer{notes}{notes-xml}{notes:notes} >\blank >Not ok with \type{\xmlprocessbuffer{notes}{notes-xml}{}}\crlf >\xmlprocessbuffer{notes}{notes-xml}{} >\textrule{end of test \#1} >\stoptext >\stophiding > >\starthiding >% Test #2 >\startxmlsetups notes:setups > \xmlsetsetup{#1}{*}{-} > \xmlsetsetup{#1}{takenotes}{notes:*} >\stopxmlsetups >\xmlregisterdocumentsetup{notes}{notes:setups} >\startxmlsetups notes:takenotes >\xmlinclude{#1}{include}{file} >\xmlshow{#1} >=3D=3D=3D> number of =3D \xmlcount{#1}{note} >\stopxmlsetups >\startxmlsetups notes:setups >\xmlflush{#1} >\stopxmlsetups >\starttext >Nothing with \type{\xmlprocessbuffer{takenotes}{notes-xml}{}}\crlf >\xmlprocessbuffer{takenotes}{notes-xml}{} >\blank >Not ok with \type{\xmlprocessbuffer{notes}{notes-xml}{}}\crlf >\xmlprocessbuffer{notes}{notes-xml}{} >\blank >Not ok with >\type{\xmlprocessbuffer{notes}{notes-xml}{notes:takenotes}}\crlf >\xmlprocessbuffer{notes}{notes-xml}{} >\textrule{end of test \#2} >\stoptext >\stophiding > >%\starthiding >% Test #3 >\startxmlsetups notes:setups >\xmlsetsetup{#1}{*}{-} >\xmlsetsetup{#1}{notes}{notes:*} >\stopxmlsetups >\xmlregisterdocumentsetup{notes}{notes:setups} >\startxmlsetups notes:notes >\xmlfilter{#1}{takenotes/include/command(notes:include)} >\xmlshow{#1} >=3D=3D=3D> number of =3D \xmlcount{#1}{note} >\stopxmlsetups >\startxmlsetups notes:include >\writestatus{DEBUG}{enter notes: include file >\xmlattribute{#1}{../include}{file}} >\xmlinclude{#1}{../include}{file} >\stopxmlsetups >\starttext >\type{\xmlprocessbuffer{notes}{notes-xml}{notes:notes}} will crash >%%%%\xmlprocessbuffer{notes}{notes-xml}{notes:notes}%%%% >\crlf prints in the log: >\crlf \type{DEBUG > enter notes: include file minimal-example.xml} >\crlf \type{lxml > tex > including file 'minimal-example.xml'} >\crlf \type{lua error ... attempt to index field 'settings' (a nil >value) ...tail calls} >\textrule{end of test \#3} >\stoptext >\stophiding > > > > >------------------------------------------------------------------------ > >________________________________________________________________________= ___________ >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://tex.aanhet.net >archive : http://foundry.supelec.fr/projects/contextrev/ >wiki : http://contextgarden.net >________________________________________________________________________= ___________ ------0809RHNP4IOURCC9859DNOV3PYYYHV Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Thank y= ou, this is much appreciated!

Best,
Mica

On April 21, 2016 12:41:26 AM PDT,= "Meer, Hans van der" <H.vanderMeer@uva.nl> wrote: A week ago I posted here by accident part of a private conversation (in D= utch) with Hans Hagen. I already apologized for this.

On 15 Apr 2016, at 00:47, Mica Semrick <mica@silentumbrella.com> w= rote:

I'm interested in this thread too... But I'm american, so= English only. I appreciate your understanding!


From reactions I understood that other people are interes= ted in this subject of \xmlinclude too, but at that moment I could not pr= oduce a coherent story.
After having produced some minimal (1) working, (2)  = ;not working and (3) crashing examples, I dare hope that my contribution = of these will be of some use. And perhaps they will spawn better suggesti= ons and better understanding of what happens, because I must confess I am somewhat unsure with functional language beh= aviour, being raised with Assembler, Algol, Pascal, Fortran, and so on ;-= )

Find below my examples. One can call each of them by comm= enting out the \starthiding.
The last one can be executed by removing the %%%%'s at th= e front of the offending statement.
Again, I hope this post will be of some use.

Hans van der Meer

contents of file minimal-example.xml:

<notes>
<note>
<body>Body of fir= st note</body>
</note>
<note>
<body>Body of sec= ond note</body>
</note>
</notes>

Three exampel programs:

\enabletrackers[lxml.lo= ading,lxml.setups]
\startbuffer[notes-xml]=
<?xml version=3D&quo= t;1.0" encoding=3D"UTF-8"?>
<takenotes>
<include file=3D&quo= t;minimal-example.xml"/>
</takenotes>
\stopbuffer

\starthiding
% Test #1
\startxmlsetups notes:s= etups
\xmlsetsetup{#1}{*}{-}<= /font>
\xmlsetsetup{#1}{notes}= {notes:*}
\stopxmlsetups
\xmlregisterdocumentset= up{notes}{notes:setups}
\startxmlsetups notes:n= otes
\xmlinclude{#1}{include= }{file}
\xmlshow{#1}
=3D=3D=3D> number of= <note> =3D \xmlcount{#1}{note}
\stopxmlsetups
\starttext
Ok with \type{\xmlproce= ssbuffer{notes}{notes-xml}{notes:notes}}\crlf
\xmlprocessbuffer{notes= }{notes-xml}{notes:notes}
\blank
Not ok with \type{\xmlp= rocessbuffer{notes}{notes-xml}{}}\crlf
\xmlprocessbuffer{notes= }{notes-xml}{}
\textrule{end of test \= #1}
\stoptext
\stophiding

\starthiding
% Test #2
\startxmlsetups notes:s= etups
    \xmlsetse= tup{#1}{*}{-}
    \xmlsetse= tup{#1}{takenotes}{notes:*}
\stopxmlsetups
\xmlregisterdocumentset= up{notes}{notes:setups}
\startxmlsetups notes:t= akenotes
\xmlinclude{#1}{include= }{file}
\xmlshow{#1}
=3D=3D=3D> number of= <note> =3D \xmlcount{#1}{note}
\stopxmlsetups
\startxmlsetups notes:s= etups
\xmlflush{#1}
\stopxmlsetups
\starttext
Nothing with \type{\xml= processbuffer{takenotes}{notes-xml}{}}\crlf
\xmlprocessbuffer{taken= otes}{notes-xml}{}
\blank
Not ok with \type{\xmlp= rocessbuffer{notes}{notes-xml}{}}\crlf
\xmlprocessbuffer{notes= }{notes-xml}{}
\blank
Not ok with \type{\xmlp= rocessbuffer{notes}{notes-xml}{notes:takenotes}}\crlf
\xmlprocessbuffer{notes= }{notes-xml}{}
\textrule{end of test \= #2}
\stoptext
\stophiding

%\starthiding
% Test #3
\startxmlsetups notes:s= etups
\xmlsetsetup{#1}{*}{-}<= /font>
\xmlsetsetup{#1}{notes}= {notes:*}
\stopxmlsetups
\xmlregisterdocumentset= up{notes}{notes:setups}
\startxmlsetups notes:n= otes
\xmlfilter{#1}{takenote= s/include/command(notes:include)}
\xmlshow{#1}
=3D=3D=3D> number of= <note> =3D \xmlcount{#1}{note}
\stopxmlsetups
\startxmlsetups notes:i= nclude
\writestatus{DEBUG}{ent= er notes: include file \xmlattribute{#1}{../include}{file}}
\xmlinclude{#1}{../incl= ude}{file}
\stopxmlsetups
\starttext
\type{\xmlprocessbuffer= {notes}{notes-xml}{notes:notes}} will crash
%%%%\xmlprocessbuffer{n= otes}{notes-xml}{notes:notes}%%%%
\crlf prints in the log= :
\crlf \type{DEBUG > = enter notes: include file minimal-example.xml}
\crlf \type{lxml  = > tex > including file 'minimal-example.xml'}
\crlf \type{lua error .= .. attempt to index field 'settings' (a nil value) ...tail calls}<= /div>
\textrule{end of test \= #3}
\stoptext
\stophiding




If your question is of int= erest to others as well, please add an entry to the Wiki!

mail= list : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
web= page : http://www.pragma-ade.nl= / http://tex.aanhet.net
archi= ve : http://fo= undry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net

------0809RHNP4IOURCC9859DNOV3PYYYHV-- --===============3921030412060160388== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============3921030412060160388==--