ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mica Semrick <mica@silentumbrella.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: xml input
Date: Thu, 21 Apr 2016 07:38:25 -0700	[thread overview]
Message-ID: <7F1E79E7-6FE3-4D33-B27D-0B6E0D22F9FD@silentumbrella.com> (raw)
In-Reply-To: <9C2C0247-95F7-47B1-A1A8-4FE147A880F7@uva.nl>


[-- 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
___________________________________________________________________________________

  parent reply	other threads:[~2016-04-21 14:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-13 14:21 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 [this message]
2016-04-23 11:18             ` Meer, Hans van der

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7F1E79E7-6FE3-4D33-B27D-0B6E0D22F9FD@silentumbrella.com \
    --to=mica@silentumbrella.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).