Re: [NTG-context] Xml filtering in Lua

2022-11-21 Thread Thomas A. Schmitz via ntg-context
On 11/20/22 19:19, Thomas A. Schmitz via ntg-context wrote: I load data from an external xml file (not the one I'm processing) and store some of it in a lua table. local examples = lxml.load ("my_examples", "examples.xml") Replying to myself, and sorry for the noise (this was fairly easy,

Re: [NTG-context] Xml filtering in Lua

2022-11-20 Thread Thomas A. Schmitz via ntg-context
On 11/17/22 11:04, Hans Hagen via ntg-context wrote: so, basically you collect data and use it later ... for huge datasets that saves some time if you have only chapters to process you can even decide to flush in that function Alright, I'm making very good progress here, but right now I'm

Re: [NTG-context] Xml filtering in Lua

2022-11-17 Thread Thomas A. Schmitz via ntg-context
> On 17. Nov 2022, at 11:04, Hans Hagen via ntg-context > wrote: > > so, basically you collect data and use it later ... for huge datasets that > saves some time > > if you have only chapters to process you can even decide to flush in that > function > > Hans I think this is exactly the

Re: [NTG-context] Xml filtering in Lua

2022-11-17 Thread Hans Hagen via ntg-context
On 11/16/2022 8:56 PM, mf via ntg-context wrote: This works: local metadata = xml.filter (t, '../../topics/topic[@t:id=="' .. ch_id .. '"]') also this: local lpath = string.format('../../topics/topic[@t:id=="%s"]', ch_id) local metadata = xml.filter (t, lpath) It looks like xml.filter

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread Hans Hagen via ntg-context
On 11/16/2022 10:09 PM, Thomas A. Schmitz via ntg-context wrote: On 11/16/22 21:51, Denis Maier via ntg-context wrote: Just a quick question regarding this? Is xml.filter equivalent to \xmlfilter? If so, how do you pass the match to a command as you'd do with \xmlfilter? I'm still digesting

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread Thomas A. Schmitz via ntg-context
On 11/16/22 21:51, Denis Maier via ntg-context wrote: Just a quick question regarding this? Is xml.filter equivalent to \xmlfilter? If so, how do you pass the match to a command as you'd do with \xmlfilter? I'm still digesting and playing with Massi's reply; will probably be back with more

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread Denis Maier via ntg-context
16. November 2022 20:56 > An: ntg-context@ntg.nl > Cc: mf > Betreff: Re: [NTG-context] Xml filtering in Lua > > This works: > > local metadata = xml.filter (t, '../../topics/topic[@t:id=="' .. ch_id .. > '"]') > > also this: > > local lpath = string.f

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread mf via ntg-context
This works: local metadata = xml.filter (t, '../../topics/topic[@t:id=="' .. ch_id .. '"]') also this: local lpath = string.format('../../topics/topic[@t:id=="%s"]', ch_id) local metadata = xml.filter (t, lpath) It looks like xml.filter supports only 2 arguments (see lxml-tex.lua), and

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread Thomas A. Schmitz via ntg-context
On 11/16/22 19:56, mf via ntg-context wrote: local ch_id = t.at["ch:id"] You're right, of course, using a colon was a stupid idea. When I replace it with an underscore, you can see that both are in fact identical: \startbuffer[test] This is the first test 22/11/16

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread mf via ntg-context
Il 16/11/22 18:33, Thomas A. Schmitz via ntg-context ha scritto: \startbuffer[test] This is the first test 22/11/16 This is the second test 22/11/17 This will be the content of the first chapter.

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread Thomas A. Schmitz via ntg-context
Hi Duncan, Thank you for pointing this out! I knew this was true inside the xmlns namespace, so you can’t have identical xml:id tags, but you’re probably right that it’s better to avoid this confusion altogether. Alas, this doesn’t help with my problem. Since there was a type in my minimal

Re: [NTG-context] Xml filtering in Lua

2022-11-16 Thread Duncan Hothersall via ntg-context
Hi Thomas. I'm not sure about the code, sorry, but I do know that an XML document can't have two IDs of the same value. Typically you would use a linkend attribute on the element which is referencing an id (in this case the topics, I think). Probably doesn't help with your problem, but it's

[NTG-context] Xml filtering in Lua

2022-11-16 Thread Thomas A. Schmitz via ntg-context
Hi all, I thought this was easy, but I overestimated my competence… I want to filter xml elements via their attributes and retrieve and typeset parts belonging together. Here is a small test file that explains what I’m trying: \startbuffer[test] This is the first test

[NTG-context] XML filtering and \setupcombinations

2015-05-19 Thread Michael Eidenbenz
Hello, I'm enjoying the power of the new publication framework and started to manage my images with it. This works quite nice. But now I reached the point where my (limited) context knowledge comes to an end. I would like to print a contact sheet of my large image database. To save paper I

[NTG-context] XML filtering

2006-09-03 Thread WN
Hello, I have a couple of XML's generated by a freeware program which I want to process with Context. I started experimenting and things look good, however I want to skip/filter out some of the xml tags like computeraudit Some Text /computeraudit and disclaimer Some Text /disclaimer so

Re: [NTG-context] XML filtering

2006-09-03 Thread Hans Hagen
WN wrote: Hello, I have a couple of XML's generated by a freeware program which I want to process with Context. I started experimenting and things look good, however I want to skip/filter out some of the xml tags like *computeraudit Some Text /computeraudit* and *disclaimer Some

Re: [NTG-context] XML filtering

2006-09-03 Thread WN
[EMAIL PROTECTED] wrote: WN wrote: Another question, still learning, I am struggling with the following. In the XML there is a tag recordset indicating a set of records which I map to table entries. After this tag a couple of tags labelled fieldname should be translated to table header