From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94456 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: xml input Date: Thu, 14 Apr 2016 22:31:47 +0200 Message-ID: References: <8ACED9AF-31FB-4C80-9D4C-6A545EA13634@uva.nl> <570F58C0.4090107@wxs.nl> <545694FE-156E-4912-9D98-A59815EB6F47@uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8764274238548675908==" X-Trace: ger.gmane.org 1460666154 27320 80.91.229.3 (14 Apr 2016 20:35:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2016 20:35:54 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 14 22:35:43 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 1aqnzL-0007vH-1d for gctc-ntg-context-518@m.gmane.org; Thu, 14 Apr 2016 22:35:43 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 95920A589; Thu, 14 Apr 2016 22:32: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 btHuxpVTDUtv; Thu, 14 Apr 2016 22:32:00 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id BBC69A58D; Thu, 14 Apr 2016 22:32:00 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4D2C2A58D for ; Thu, 14 Apr 2016 22:31: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 WTPs-lx2mo9H for ; Thu, 14 Apr 2016 22:31:58 +0200 (CEST) Original-Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 91337A589 for ; Thu, 14 Apr 2016 22:31:48 +0200 (CEST) Original-Received: by mail-lf0-f48.google.com with SMTP id e190so122996149lfe.0 for ; Thu, 14 Apr 2016 13:31:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=JN8mhgSZDPq9O3QWMPiDSWGeEh9zuSGTA7XT2QVzO54=; b=wUj3mmt0WIpYhvF2flcLPJ8q3JSvAiC+eU9q2upK2PVtxCPwuqksT0gkHRpMSAgLKr Beh09xbveTCWn2VYVOTNQLEcUdnDsjaaSokWnzsn/+lIaQ9s+68qY/KQcAL4iJV9FyXC 800kSye8Otptvtvnl6bd2mK3GPS3CkWqLQVBORYHicl2usc05Fz3kQJki6jAxaRcmqgw t+U9W/LAiMD/Tse2Qbwp4OsHQ5hd1sDB7W12VmDembl3iYYnVqoPnAdWgS3TjdTuv2kY DuEsG6A4qK6UmM9DoxG55l5d+e7242x+UXRNkoBPTONZaPfAy80ELQKZkQPBya647Wgf lWmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=JN8mhgSZDPq9O3QWMPiDSWGeEh9zuSGTA7XT2QVzO54=; b=Ekubi98qOimQdhsfbM74rGm/2lhZKVf1OB+zB6IF7v5Xh2MtXP9dHNtUPgKNCEdNwG o4Rny0K+nW3xDPQSQfi0W5/5vnlXXzLYIbrRH3L27FSaB604xzIgQfA/jGdSgZOzKS8H UzmsD2AmILs/sZ7EQasg4vw3/i0ECVADRKMRAqvgQsOMtC9jG11pgc362W0kHTzzc68G z0s8nrjuiuscX6GJ8Bwqezh8uaZbLZAbhR/TAsAMW1A40SUaJCtz4etWz5D0aUqZ2Fsy av0trpdABjdXIah277YnDt6ih8TBYA7aJhAzzFY2/57ueoSCFGPn3NLyglswdVEr11iq c8EQ== X-Gm-Message-State: AOPr4FW27yCg1NCgY3xkZFo1KNm5byEag/QhgCi4hw8b8agP25vMgm1clo9LrFQoesPX11jQct2f4r5aOs2kdw== X-Received: by 10.25.4.202 with SMTP id 193mr7521421lfe.49.1460665907991; Thu, 14 Apr 2016 13:31:47 -0700 (PDT) Original-Received: by 10.25.86.85 with HTTP; Thu, 14 Apr 2016 13:31:47 -0700 (PDT) In-Reply-To: <545694FE-156E-4912-9D98-A59815EB6F47@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:94456 Archived-At: --===============8764274238548675908== Content-Type: multipart/alternative; boundary=001a113eb08e94db55053077c8f8 --001a113eb08e94db55053077c8f8 Content-Type: text/plain; charset=UTF-8 On Thu, Apr 14, 2016 at 10:30 PM, Meer, Hans van der wrote: > > On 14 Apr 2016, at 10:45, Hans Hagen wrote: > > On 4/13/2016 4:21 PM, Meer, Hans van der wrote: > > I would like to process several input sources as one xml tree. Like this: > > > > > > > > with the sources having the structure > > ... > ... > > > and the code for containing: > read from all sources given on -notes > afterwards process all content at once > > Thus the content of the various source should be read into one tree to > be processed, but I cannot get this done. > How to amalgam this separate sources into one? > > > a clue: \xmlinclude > > By the way: hoe laad ik de inhoud van een *buffer* net als van een file, > is er een buffer equivalent van \xmlinclude? > > Hans, het spijt me zeer, maar ik begrijp er geen hout meer van want er > volgt een crash met een lua-error. > Ik lees voor \xmlinclude dat \xmlinclude{NODE}{LPATH}{ATTRIBUTE} de file > in het attribuut laadt. > > Ik heb wat in de code rondgeneusd. > Uit lxml > tex > including file 'notes-example.xml' > in de log blijkt dat in function > lxml.include(id,pattern,attribute,options) > moet zijn uitgevoerd > > if trace_loading then > report_lxml("including file %a",filename) > end > noffiles, nofconverted = noffiles + 1, nofconverted + 1 > return resolvers.loadtexfile(filename) or "" > > Met resolvers tracking komt hier nog tussen: > lxml > tex > including file 'notes-example.xml' > resolvers > methods > resolving, method 'finders', how 'uri', > handler 'file', argument 'notes-example.xml' > resolvers > resolving > remembering file 'notes-example.xml' using > hash 'xml::notes-example.xml' > resolvers > files > file finder: 'notes-example.xml' found > resolvers > methods > resolving, method 'loaders', how 'uri', > handler 'file', argument 'notes-example.xml' > resolvers > files > file loader: 'notes-example.xml' loaded > het lijkt erop dat de gezochte file wel geladen is en dat pas daarna > ConTeXt het opgeeft met de error. > > De log geeft me hier: > > HVDM-NOTE-DEBUG > enter notes:include > HVDM-NOTE-DEBUG > ..looking for file notes-example.xml > lxml > tex > including file 'notes-example.xml' > > lua error > lua error on line 14 in file > /Users/hansm/Documents/TeX/texmf/publications/takenotes/take notes.tex: > > ...-35/tex/texmf-context/tex/context/base/mkiv/lxml-aux.lua:428: attempt > to index field 'settings' (a nil value) > stack traceback: > ...-35/tex/texmf-context/tex/context/base/mkiv/lxml-aux.lua:428: in > function 'include' > ...-35/tex/texmf-context/tex/context/base/mkiv/lxml-tex.lua:579: in > function <...-35/tex/texmf-context/tex/context/base/mkiv/lxml-tex.lua:567> > (...tail calls...) > > > De navolgende code is toch niet fout? > > De main input is > > > > > > > De file notes-example.xml bevat slechts > subnodes etc > omsluiten met ... doet niets anders. > > Ik doe het volgende (met loading tracker enabled > \startxmlsetups notes:takenotes > % Include files and buffers. > \xmlfilter{#1}{/include/command(notes:include)} > \stopxmlsetups > > \startxmlsetups notes:include > % Include from file. > \doifnot{\xmlatt{#1}{file}}{\empty} > {\writestatus{HVDM-NOTE-DEBUG}{..looking for file \xmlatt{#1}{file}} > \xmlinclude{#1}{}{file}} > \stopxmlsetups > > Zelfde crash in de volgende gevallen > \xmlinclude{#1}{}{file} > \xmlinclude{#1}{.}{file} > \xmlinclude{#1}{../include}{file} > > met vriendelijke groet > Hans van der Meer > met vriendelijke groet > Hans van der Meer > > > private message ? -- luigi --001a113eb08e94db55053077c8f8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu, Apr 14, 2016 at 10:30 PM, Meer, Hans van der = <H.vanderMeer@u= va.nl> wrote:

On 14 Apr 2016, at 10:45, Hans Hagen <pragma@wxs.nl> wrote:

On 4/13/2016 4:21 PM, Meer, Hans van der wrote:
I would like to process several input sources as = one xml tree. Like this:

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<takenotes>
<include buffer=3D"notes-example"/>
<include file=3D"notes-example.xml"/>
</takenotes>

with the sources having the structure
<notes>
<note>...</note>
...
</notes>

and the code for <takenotes> containing:
read from all sources given on <include>-notes
afterwards process all content at once

Thus the content of the various source should be read into one tree to
be processed, but I cannot get this done.
How to amalgam this separate sources into one?

a clue: \xmlinclude

By the way: hoe laad ik de inhoud van een=C2=A0buffer=C2= =A0net als van een file, is er een buffer equivalent van \xmlinclude?

Hans, het spijt me zeer, maar ik begrijp er geen hout meer van want er= volgt een crash met een lua-error.
Ik lees voor \xmlinclude dat \xmlinclude{NODE}{LPATH}{ATTRIBUTE} de fi= le in het attribuut laadt.

Ik heb wat in de code rondgeneusd.=C2=A0
Uit =C2=A0lxml=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0=C2=A0> tex > including file 'notes-example.= xml'=C2=A0
in de log blijkt dat in=C2=A0function lxml.include(id,pattern,attribute,options= )
moet zijn uitgevoerd

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if trace_loading then
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 report_lxml(&q= uot;including file %a",filename)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 end
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 noffiles, nofconverted =3D n= offiles + 1, nofconverted + 1
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return resolvers.loadtexfile= (filename) or ""

Met resolvers tracking komt hier nog tussen:
lxml=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 > tex > including file 'notes-= example.xml'
resolvers = =C2=A0 =C2=A0 =C2=A0 > methods > resolving, method 'finders',= how 'uri', handler 'file', argument 'notes-example.xml= '
resolvers = =C2=A0 =C2=A0 =C2=A0 > resolving > remembering file 'notes-exampl= e.xml' using hash 'xml::notes-example.xml'
resolvers = =C2=A0 =C2=A0 =C2=A0 > files > file finder: 'notes-example.xml= 9; found
resolvers = =C2=A0 =C2=A0 =C2=A0 > methods > resolving, method 'loaders',= how 'uri', handler 'file', argument 'notes-example.xml= '
resolvers = =C2=A0 =C2=A0 =C2=A0 > files > file loader: 'notes-example.xml= 9; loaded
het lijkt erop dat de gezochte file wel geladen is en dat pas daarna C= onTeXt het opgeeft met de error.

De log geeft me hier:

HVDM-NO= TE-DEBUG > enter notes:include
HVDM-NO= TE-DEBUG > ..looking for file notes-example.xml
lxml=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0> tex > including file &#= 39;notes-example.xml'

lua err= or=C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0> lua error on line 14 in file /Users/= hansm/Documents/TeX/texmf/publications/takenotes/take notes.tex:

...-35/= tex/texmf-context/tex/context/base/mkiv/lxml-aux.lua:428: attempt to index = field 'settings' (a nil value)
stack t= raceback:
...-35/tex/texmf-context/tex/context/b= ase/mkiv/lxml-aux.lua:428: in function 'include'
...-35/tex/texmf-context/tex/context/b= ase/mkiv/lxml-tex.lua:579: in function <...-35/tex/texmf-context/tex/con= text/base/mkiv/lxml-tex.lua:567>
(...tail calls...)


De navolgende code is toch niet fout?

De main input is
<?xml version=3D"1.0"= encoding=3D"UTF-8"?>
<takenotes>
=C2=A0 <!-- <include buffer=3D"notes= -example"/> -->
<include file=3D"notes-example.xml"= ;/>
</takenotes>

De file notes-example.xml bevat slechts
<note> subnodes </note> etc
omsluiten met <root>...</root> doet niets anders.

Ik doe het volgende (met loading tracker enabled
\startxmlsetups notes:takenotes
=C2=A0 % Include files and buffers.
=C2=A0 \xmlfilter{#1}{/include/command(notes:in= clude)}
\stopxmlsetups

\startxmlsetups notes:include
=C2=A0=C2=A0% Include from file.
=C2=A0\doifnot{\xmlatt{#1}{file}}{\empty}
=C2=A0 =C2=A0 {\writestatus{HVDM-NOTE-DEBUG}{..looking for file \xmlatt{#1}{fil= e}}
=C2=A0 =C2=A0 =C2=A0\xmlinclude{#1}{}{file}}
\stopxmlsetups

Zelfde crash in de volgende gevall= en
\xmlinc= lude{#1}{}{file}
\xmlinc= lude{#1}{.}{file}
\xmlinc= lude{#1}{../include}{file}

met vriendelijke groet
Hans van der Meer
met vriendelijke groet<= br> Hans van der Meer




private message ?=C2=A0

--
luigi
--001a113eb08e94db55053077c8f8-- --===============8764274238548675908== 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= --===============8764274238548675908==--