* xml input @ 2016-04-13 14:21 Meer, Hans van der 2016-04-13 15:35 ` Meer, Hans van der 2016-04-14 8:45 ` Hans Hagen 0 siblings, 2 replies; 15+ messages in thread From: Meer, Hans van der @ 2016-04-13 14:21 UTC (permalink / raw) To: NTG ConTeXt [-- Attachment #1.1: Type: text/plain, Size: 624 bytes --] I would like to process several input sources as one xml tree. Like this: <?xml version="1.0" encoding="UTF-8"?> <takenotes> <include buffer="notes-example"/> <include file="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? Hans van der Meer [-- Attachment #1.2: Type: text/html, Size: 2358 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-13 14:21 xml input Meer, Hans van der @ 2016-04-13 15:35 ` Meer, Hans van der 2016-04-14 8:44 ` Hans Hagen 2016-04-14 8:45 ` Hans Hagen 1 sibling, 1 reply; 15+ messages in thread From: Meer, Hans van der @ 2016-04-13 15:35 UTC (permalink / raw) To: NTG ConTeXt [-- Attachment #1.1: Type: text/plain, Size: 907 bytes --] Just a thought. \xmlprocessbuffer and \xmlprocessfile{id}... register the tree they read under id. Is there a way to merge several id's to one tree? Hans van der Meer On 13 Apr 2016, at 16:21, Meer, Hans van der <H.vanderMeer@uva.nl<mailto:H.vanderMeer@uva.nl>> wrote: I would like to process several input sources as one xml tree. Like this: <?xml version="1.0" encoding="UTF-8"?> <takenotes> <include buffer="notes-example"/> <include file="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? Hans van der Meer [-- Attachment #1.2: Type: text/html, Size: 3179 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-13 15:35 ` Meer, Hans van der @ 2016-04-14 8:44 ` Hans Hagen 0 siblings, 0 replies; 15+ messages in thread From: Hans Hagen @ 2016-04-14 8:44 UTC (permalink / raw) To: ntg-context On 4/13/2016 5:35 PM, Meer, Hans van der wrote: > Just a thought. > > \xmlprocessbuffer and \xmlprocessfile{id}... register the tree they read > under id. Is there a way to merge several id's to one tree? no, but you can of course access trees mixed (as long as #1 reflects id) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-13 14:21 xml input Meer, Hans van der 2016-04-13 15:35 ` Meer, Hans van der @ 2016-04-14 8:45 ` Hans Hagen 2016-04-14 20:30 ` Meer, Hans van der 1 sibling, 1 reply; 15+ messages in thread From: Hans Hagen @ 2016-04-14 8:45 UTC (permalink / raw) To: ntg-context 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="1.0" encoding="UTF-8"?> > <takenotes> > <include buffer="notes-example"/> > <include file="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 ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-14 8:45 ` Hans Hagen @ 2016-04-14 20:30 ` Meer, Hans van der 2016-04-14 20:31 ` luigi scarso 2016-04-14 20:56 ` Pablo Rodriguez 0 siblings, 2 replies; 15+ messages in thread From: Meer, Hans van der @ 2016-04-14 20:30 UTC (permalink / raw) To: NTG ConTeXt [-- Attachment #1.1: Type: text/plain, Size: 3848 bytes --] On 14 Apr 2016, at 10:45, Hans Hagen <pragma@wxs.nl<mailto: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="1.0" encoding="UTF-8"?> <takenotes> <include buffer="notes-example"/> <include file="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 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 <?xml version="1.0" encoding="UTF-8"?> <takenotes> <!-- <include buffer="notes-example"/> --> <include file="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 % 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 [-- Attachment #1.2: Type: text/html, Size: 10481 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-14 20:30 ` Meer, Hans van der @ 2016-04-14 20:31 ` luigi scarso 2016-04-14 20:56 ` Pablo Rodriguez 1 sibling, 0 replies; 15+ messages in thread From: luigi scarso @ 2016-04-14 20:31 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 4046 bytes --] On Thu, Apr 14, 2016 at 10:30 PM, Meer, Hans van der <H.vanderMeer@uva.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="1.0" encoding="UTF-8"?> > <takenotes> > <include buffer="notes-example"/> > <include file="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 *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 > <?xml version="1.0" encoding="UTF-8"?> > <takenotes> > <!-- <include buffer="notes-example"/> --> > <include file="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 > % 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 [-- Attachment #1.2: Type: text/html, Size: 8850 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-14 20:30 ` Meer, Hans van der 2016-04-14 20:31 ` luigi scarso @ 2016-04-14 20:56 ` Pablo Rodriguez 2016-04-14 21:22 ` Meer, Hans van der 2016-04-14 22:47 ` Mica Semrick 1 sibling, 2 replies; 15+ messages in thread From: Pablo Rodriguez @ 2016-04-14 20:56 UTC (permalink / raw) To: mailing list for ConTeXt users Hans, excuse my top-posting. I was really interested in this thread. But Dutch isn’t something in between English and German (two languages I used to know). My apologies for the comment, if the message was intended as private. I’m eager to learn XML in ConTeXt, since the possibilities are less than with standard (or the other) ConTeXt. Pablo On 04/14/2016 10:30 PM, Meer, Hans van der wrote: >> On 14 Apr 2016, at 10:45, Hans Hagen wrote: >> [...] >> 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 > <?xml version="1.0" encoding="UTF-8"?> > <takenotes> > <!-- <include buffer="notes-example"/> --> > <include file="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 > % 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 -- http://www.ousia.tk ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-14 20:56 ` Pablo Rodriguez @ 2016-04-14 21:22 ` Meer, Hans van der 2016-04-14 22:47 ` Mica Semrick 1 sibling, 0 replies; 15+ messages in thread From: Meer, Hans van der @ 2016-04-14 21:22 UTC (permalink / raw) To: NTG ConTeXt My fault, wholly my fault! Just didn't look precise enough in replying. Thought to answer Hans Hagen in private but was a little offguard. No offense taken. Hans van der Meer > On 14 Apr 2016, at 22:56, Pablo Rodriguez <oinos@gmx.es> wrote: > > Hans, > > > My apologies for the comment, if the message was intended as private. > > > Pablo > ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-14 20:56 ` Pablo Rodriguez 2016-04-14 21:22 ` Meer, Hans van der @ 2016-04-14 22:47 ` Mica Semrick 2016-04-21 7:41 ` Meer, Hans van der 1 sibling, 1 reply; 15+ messages in thread From: Mica Semrick @ 2016-04-14 22:47 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 4633 bytes --] I'm interested in this thread too... But I'm american, so English only. I appreciate your understanding! -m On April 14, 2016 1:56:18 PM PDT, Pablo Rodriguez <oinos@gmx.es> wrote: >Hans, > >excuse my top-posting. > >I was really interested in this thread. But Dutch isn’t something in >between English and German (two languages I used to know). > >My apologies for the comment, if the message was intended as private. > >I’m eager to learn XML in ConTeXt, since the possibilities are less >than >with standard (or the other) ConTeXt. > > >Pablo > > >On 04/14/2016 10:30 PM, Meer, Hans van der wrote: >>> On 14 Apr 2016, at 10:45, Hans Hagen wrote: >>> [...] >>> 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 >> <?xml version="1.0" encoding="UTF-8"?> >> <takenotes> >> <!-- <include buffer="notes-example"/> --> >> <include file="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 >> % 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 > > >-- >http://www.ousia.tk >___________________________________________________________________________________ >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 >___________________________________________________________________________________ [-- Attachment #1.2: Type: text/html, Size: 4953 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-14 22:47 ` Mica Semrick @ 2016-04-21 7:41 ` Meer, Hans van der 2016-04-21 8:41 ` Hans Hagen 2016-04-21 14:38 ` Mica Semrick 0 siblings, 2 replies; 15+ messages in thread From: Meer, Hans van der @ 2016-04-21 7:41 UTC (permalink / raw) To: NTG ConTeXt [-- Attachment #1.1: Type: text/plain, Size: 3885 bytes --] 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 <mica@silentumbrella.com<mailto:mica@silentumbrella.com>> 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: <notes> <note> <body>Body of first note</body> </note> <note> <body>Body of second note</body> </note> </notes> Three exampel programs: \enabletrackers[lxml.loading,lxml.setups] \startbuffer[notes-xml] <?xml version="1.0" encoding="UTF-8"?> <takenotes> <include file="minimal-example.xml"/> </takenotes> \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} ===> number of <note> = \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} ===> number of <note> = \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} ===> number of <note> = \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 [-- Attachment #1.2: Type: text/html, Size: 10370 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-21 7:41 ` Meer, Hans van der @ 2016-04-21 8:41 ` Hans Hagen 2016-04-22 7:33 ` Meer, Hans van der 2016-04-21 14:38 ` Mica Semrick 1 sibling, 1 reply; 15+ messages in thread From: Hans Hagen @ 2016-04-21 8:41 UTC (permalink / raw) To: mailing list for ConTeXt users On 4/21/2016 9:41 AM, Meer, Hans van der wrote: > long mail ... your \xmlsetsetup{#1}{*}{-} makex takenotes into a nothing ... (comment that line if needed to see effects in your code) \enabletrackers[lxml.loading,lxml.setups] \startbuffer[notes-xml] <?xml version="1.0" encoding="UTF-8"?> <takenotes> <foo>bar</foo> <include file="minimal-example.xml"/> </takenotes> \stopbuffer \startxmlsetups notes:setups \xmlinclude{#1}{include}{file} \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{notes|foo|takenotes}{notes:*} \stopxmlsetups \xmlregistersetup{notes:setups} \startxmlsetups notes:notes \xmlshow{#1} ===> number of <note> = \xmlcount{#1}{note} \stopxmlsetups \startxmlsetups notes:foo DONE: \xmlflush{#1} \stopxmlsetups \startxmlsetups notes:takenotes \xmlflush{#1} \stopxmlsetups \starttext test \xmlprocessbuffer{notes}{notes-xml}{} \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-21 8:41 ` Hans Hagen @ 2016-04-22 7:33 ` Meer, Hans van der 2016-04-22 7:46 ` Hans Hagen 0 siblings, 1 reply; 15+ messages in thread From: Meer, Hans van der @ 2016-04-22 7:33 UTC (permalink / raw) To: NTG ConTeXt [-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --] On 21 Apr 2016, at 10:41, Hans Hagen <pragma@wxs.nl<mailto:pragma@wxs.nl>> wrote: your \xmlsetsetup{#1}{*}{-} makex takenotes into a nothing ... (comment that line if needed to see effects in your code) I got that line from your first demo program in "Dealing with XML in ConTeXt Mkiv": \startxmlsetups xml:demo:base (1) \xmlsetsetup{#1}{*}{-} (2) \xmlsetsetup{#1}{document|section|p}{xml:demo:*} \stopxmlsetups The comment on page 7 with that demo: (1) \xmlsetup{demo}{*}{-} sets the default for each element (the *) to 'just ignore it' (the -). A + would... (2) followed by "this means that at this point we only handle" and I understood from this that because of the 'section' in statement (2) the <section> node will get processed. Congruent with this example I wrote in my example: \startxmlsetups notes:setups \xmlinclude{#1}{include}{file} \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{takenotes}{notes:*} \stopxmlsetups expecting this to mean that <takenotes> will be activated by it. Is that a misunderstanding? Hans van der Meer [-- Attachment #1.2: Type: text/html, Size: 2655 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-22 7:33 ` Meer, Hans van der @ 2016-04-22 7:46 ` Hans Hagen 0 siblings, 0 replies; 15+ messages in thread From: Hans Hagen @ 2016-04-22 7:46 UTC (permalink / raw) To: ntg-context On 4/22/2016 9:33 AM, Meer, Hans van der wrote: > >> On 21 Apr 2016, at 10:41, Hans Hagen <pragma@wxs.nl >> <mailto:pragma@wxs.nl>> wrote: >> >> >> your >> >> \xmlsetsetup{#1}{*}{-} >> >> makex takenotes into a nothing ... (comment that line if needed to see >> effects in your code) >> > > I got that line from your first demo program in "Dealing with XML in > ConTeXt Mkiv": > > \startxmlsetups xml:demo:base > (1) \xmlsetsetup{#1}{*}{-} > (2) \xmlsetsetup{#1}{document|section|p}{xml:demo:*} > \stopxmlsetups > > The comment on page 7 with that demo: > (1) \xmlsetup{demo}{*}{-} sets the default for each element (the *) to > 'just ignore it' (the -). A + would... > (2) followed by "this means that at this point we only handle" and I > understood from this that because of the 'section' in statement (2) the > <section> node will get processed. Congruent with this example I wrote > in my example: > >> \startxmlsetups notes:setups >> \xmlinclude{#1}{include}{file} >> \xmlsetsetup{#1}{*}{-} >> \xmlsetsetup{#1}{takenotes}{notes:*} >> \stopxmlsetups > > expecting this to mean that <takenotes> will be activated by it. Is that > a misunderstanding? given that you have a setup "notes:takenotes" Hans -- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-21 7:41 ` Meer, Hans van der 2016-04-21 8:41 ` Hans Hagen @ 2016-04-21 14:38 ` Mica Semrick 2016-04-23 11:18 ` Meer, Hans van der 1 sibling, 1 reply; 15+ messages in thread From: Mica Semrick @ 2016-04-21 14:38 UTC (permalink / raw) To: mailing list for ConTeXt users [-- Attachment #1.1: Type: text/plain, Size: 4761 bytes --] Thank you, 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 >Dutch) with Hans Hagen. I already apologized for this. > >On 15 Apr 2016, at 00:47, Mica Semrick ><mica@silentumbrella.com<mailto:mica@silentumbrella.com>> 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: > ><notes> ><note> ><body>Body of first note</body> ></note> ><note> ><body>Body of second note</body> ></note> ></notes> > >Three exampel programs: > >\enabletrackers[lxml.loading,lxml.setups] >\startbuffer[notes-xml] ><?xml version="1.0" encoding="UTF-8"?> ><takenotes> ><include file="minimal-example.xml"/> ></takenotes> >\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} >===> number of <note> = \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} >===> number of <note> = \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} >===> number of <note> = \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 >___________________________________________________________________________________ [-- Attachment #1.2: Type: text/html, Size: 11465 bytes --] [-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: xml input 2016-04-21 14:38 ` Mica Semrick @ 2016-04-23 11:18 ` Meer, Hans van der 0 siblings, 0 replies; 15+ messages in thread From: Meer, Hans van der @ 2016-04-23 11:18 UTC (permalink / raw) To: NTG ConTeXt [-- Attachment #1.1: Type: text/plain, Size: 765 bytes --] For those still interested in the inclusion of nodes into the root of the xml-tree. With the help of a hint by Hans Hagen, the following is the best I am able to produce. The code below includes the contents of the file twice as can be seen in the pdf. \startbuffer[test] <?xml version="1.0" encoding="UTF-8"?> <takenotes> <include file="minimal-example.xml"/> <include file="minimal-example.xml"/> </takenotes> \stopbuffer \startxmlsetups notes:setups \xmlinclude{#1}{include}{file} \xmlsetsetup{#1}{takenotes}{notes:*} \stopxmlsetups \xmlregisterdocumentsetup{demo}{notes:setups} \startxmlsetups notes:takenotes \xmlshow{\xmldocument} \stopxmlsetups \starttext \xmlprocessbuffer{demo}{test}{} \stoptext Hans van der Meer [-- Attachment #1.2: Type: text/html, Size: 2607 bytes --] [-- Attachment #2: mini.pdf --] [-- Type: application/pdf, Size: 9054 bytes --] [-- Attachment #3: Type: text/plain, Size: 485 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://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2016-04-23 11:18 UTC | newest] Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2016-04-13 14:21 xml input Meer, Hans van der 2016-04-13 15:35 ` Meer, Hans van der 2016-04-14 8:44 ` Hans Hagen 2016-04-14 8:45 ` Hans Hagen 2016-04-14 20:30 ` Meer, Hans van der 2016-04-14 20:31 ` luigi scarso 2016-04-14 20:56 ` Pablo Rodriguez 2016-04-14 21:22 ` Meer, Hans van der 2016-04-14 22:47 ` Mica Semrick 2016-04-21 7:41 ` Meer, Hans van der 2016-04-21 8:41 ` Hans Hagen 2016-04-22 7:33 ` Meer, Hans van der 2016-04-22 7:46 ` Hans Hagen 2016-04-21 14:38 ` Mica Semrick 2016-04-23 11:18 ` Meer, Hans van der
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).