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,
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
> 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
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
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
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
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
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
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
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.
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
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
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
13 matches
Mail list logo