Re: [NTG-context] xml input

2016-04-23 Thread Meer, Hans van der
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]





\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






mini.pdf
Description: mini.pdf
___
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
___

Re: [NTG-context] xml input

2016-04-22 Thread Hans Hagen

On 4/22/2016 9:33 AM, Meer, Hans van der wrote:



On 21 Apr 2016, at 10:41, Hans Hagen > 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
 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  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
___

Re: [NTG-context] xml input

2016-04-22 Thread Meer, Hans van der

On 21 Apr 2016, at 10:41, Hans Hagen > 
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 
 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  will be activated by it. Is that a 
misunderstanding?

Hans van der Meer




___
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
___

Re: [NTG-context] xml input

2016-04-21 Thread Mica Semrick
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}
>===> number of  = \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  = \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  = \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
>___
___
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
___

Re: [NTG-context] xml input

2016-04-21 Thread Hans Hagen

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]


bar


\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  = \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
___

Re: [NTG-context] xml input

2016-04-21 Thread Meer, Hans van der
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}
===> number of  = \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  = \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  = \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
___

Re: [NTG-context] xml input

2016-04-14 Thread Mica Semrick
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  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
>> 
>> 
>>   
>> 
>> 
>> 
>> 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
>
>
>-- 
>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
>___
___
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
___

Re: [NTG-context] xml input

2016-04-14 Thread Meer, Hans van der
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  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
___

Re: [NTG-context] xml input

2016-04-14 Thread Pablo Rodriguez
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
> 
> 
>   
> 
> 
> 
> 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


-- 
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
___

Re: [NTG-context] xml input

2016-04-14 Thread luigi scarso
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
___
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
___

Re: [NTG-context] xml input

2016-04-14 Thread Meer, Hans van der

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




___
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
___

Re: [NTG-context] xml input

2016-04-14 Thread Hans Hagen

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


-
  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
___

Re: [NTG-context] xml input

2016-04-14 Thread Hans Hagen

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
___

Re: [NTG-context] xml input

2016-04-13 Thread Meer, Hans van der
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 
> 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?

Hans van der Meer





___
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
___

[NTG-context] xml input

2016-04-13 Thread Meer, Hans van der
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?

Hans van der Meer




___
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
___