Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-03-04 Thread Hans Hagen
On 3/3/2017 5:47 PM, Thomas A. Schmitz wrote: On 25.02.2017 21:49, Hans Hagen wrote: xml.attribute(e,"..[tag()='section' or tag()='chapter']","title") with an optional default (there is also p = xml.parent(e) and then you can access p.at.title .. so there are several ways( Hans I am sorry

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-03-03 Thread Thomas A. Schmitz
On 25.02.2017 21:49, Hans Hagen wrote: xml.attribute(e,"..[tag()='section' or tag()='chapter']","title") with an optional default (there is also p = xml.parent(e) and then you can access p.at.title .. so there are several ways( Hans I am sorry it took me so long to play with this... But it

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Thomas A. Schmitz
On 02/25/2017 09:49 PM, Hans Hagen wrote: xml.attribute(e,"..[tag()='section' or tag()='chapter']","title") with an optional default (there is also p = xml.parent(e) and then you can access p.at.title .. so there are several ways( Excellent, I can work with that! Thanks a lot Thomas

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Hans Hagen
On 2/25/2017 9:35 PM, Thomas A. Schmitz wrote: On 02/25/2017 09:10 PM, Hans Hagen wrote: then you can just use xml.attribute (or lxml.attribute) Yes, exactly: how does something like \xmlattribute{#1}{..[tag()='section' or tag()='chapter']}{title} translate into lua? such as

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Thomas A. Schmitz
On 02/25/2017 09:10 PM, Hans Hagen wrote: then you can just use xml.attribute (or lxml.attribute) Yes, exactly: how does something like \xmlattribute{#1}{..[tag()='section' or tag()='chapter']}{title} translate into lua? such as xml.attribute(e, "../../chapter", "title", "")? Thomas

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Hans Hagen
On 2/25/2017 8:24 PM, Thomas A. Schmitz wrote: Hans, thanks for your efforts and your help - but I need a lua solution because I have to process my document in lua tables. then you can just use xml.attribute (or lxml.attribute) Thanks Thomas On 02/25/2017 07:30 PM, Hans Hagen wrote:

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Thomas A. Schmitz
Hans, thanks for your efforts and your help - but I need a lua solution because I have to process my document in lua tables. Thanks Thomas On 02/25/2017 07:30 PM, Hans Hagen wrote: \startbuffer[test] Text Text \stopbuffer

Re: [NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Hans Hagen
On 2/25/2017 5:18 PM, Thomas A. Schmitz wrote: Hi all, no real example, just snippets, sorry: I need to process xml documents in lua (because I want to collect information in tables). The structure is a bit irregular: Text Text So

[NTG-context] xml in lua: how to say "ancestor"?

2017-02-25 Thread Thomas A. Schmitz
Hi all, no real example, just snippets, sorry: I need to process xml documents in lua (because I want to collect information in tables). The structure is a bit irregular: Text Text So chapters may or may not have sections. If, on