Re: [NTG-context] XML export: basic questions

2019-05-22 Thread Hans Hagen
On 5/22/2019 10:30 PM, Procházka Lukáš Ing. wrote: Hello, suppose having "Main.mkiv": \setupbackend[export=yes] \starttext   \startsection[title={Sec},MyPar=MyVal]     \input knuth   \stopsection \stoptext Some questions concerning XML export: 1. Normally, with \setupbackend[exp

[NTG-context] XML export: basic questions

2019-05-22 Thread Procházka Lukáš Ing .
Hello, suppose having "Main.mkiv": \setupbackend[export=yes] \starttext \startsection[title={Sec},MyPar=MyVal] \input knuth \stopsection \stoptext Some questions concerning XML export: 1. Normally, with \setupbackend[export=yes], Ctx creates "Main-export" directory containi

Re: [NTG-context] XML roundtripping

2019-05-16 Thread Denis Maier
Ok. Have tried it. It seems to work on line 2. Where can I find documentation about these ctx files? Denis Maier schrieb am Do., 16. Mai 2019, 12:27: > >> > > Just after the xml declaration? Like on line 2? > > >> >> with "somefile.ctx" being: >> >> >> >> >> My very special style >>

Re: [NTG-context] XML roundtripping

2019-05-16 Thread Hans Hagen
On 5/15/2019 10:31 PM, Denis Maier wrote: Hans Hagen mailto:j.ha...@xs4all.nl>> schrieb am Mi., 15. Mai 2019, 18:32: On 5/15/2019 4:35 PM, Denis Maier wrote: > Our workflow is not settled yet; we're still discussing options. All > depends upon what is possible ... > >

Re: [NTG-context] XML roundtripping

2019-05-15 Thread Denis Maier
Hans Hagen schrieb am Mi., 15. Mai 2019, 18:32: > On 5/15/2019 4:35 PM, Denis Maier wrote: > > Our workflow is not settled yet; we're still discussing options. All > > depends upon what is possible ... > > > > That being said, for the purpose of displaying the articles online we'll > > need every

Re: [NTG-context] XML roundtripping

2019-05-15 Thread nyssus
On 15/05/2019 15:35, Denis Maier wrote: > Another option could be: > - Typeset each article individually. > - Get the last page number => in the next article, set the first page > number to this + 1 > (So, we do not necessarily need to write the page numbers back to the XML, > but we'll somehow ne

Re: [NTG-context] XML roundtripping

2019-05-15 Thread Mica Semrick
If your web requirement is single XML files per article, you should be able to feed ConTeXt multiple XML files and typeset them as one PDF. On May 15, 2019 7:35:47 AM PDT, Denis Maier wrote: >Our workflow is not settled yet; we're still discussing options. All >depends upon what is possible ...

Re: [NTG-context] XML roundtripping

2019-05-15 Thread Hans Hagen
On 5/15/2019 4:35 PM, Denis Maier wrote: Our workflow is not settled yet; we're still discussing options. All depends upon what is possible ... That being said, for the purpose of displaying the articles online we'll need every article in a separate XML file. The question is if and how we wil

Re: [NTG-context] XML roundtripping

2019-05-15 Thread Denis Maier
Our workflow is not settled yet; we're still discussing options. All depends upon what is possible ... That being said, for the purpose of displaying the articles online we'll need every article in a separate XML file. The question is if and how we will produce a PDF version containing a whole vol

Re: [NTG-context] XML roundtripping

2019-05-15 Thread Hans Hagen
On 5/15/2019 12:57 PM, Denis Maier wrote: Hmm, getting the page number back from the tuc file sound feasible. I'll have to look into this. But how would I write the information back to the XML? Is this explained somewhere? all depends on the workflow ... why does it need to be written back?

Re: [NTG-context] XML roundtripping

2019-05-15 Thread Denis Maier
Hmm, getting the page number back from the tuc file sound feasible. I'll have to look into this. But how would I write the information back to the XML? Is this explained somewhere? Am Mi., 15. Mai 2019 um 09:19 Uhr schrieb Hans Hagen : > On 5/14/2019 9:38 AM, Denis Maier wrote: > > Hi everyone >

Re: [NTG-context] XML roundtripping

2019-05-15 Thread Hans Hagen
On 5/14/2019 9:38 AM, Denis Maier wrote: Hi everyone I am setting up a workflow for a journal where we will be using JATS XML as an input format. PDFs should be typeset via ConTeXt. Is roundtripping possible with ConTeXt? I will perhaps need to write page numbers back to a XML file (either to

[NTG-context] XML roundtripping

2019-05-14 Thread Denis Maier
Hi everyone I am setting up a workflow for a journal where we will be using JATS XML as an input format. PDFs should be typeset via ConTeXt. Is roundtripping possible with ConTeXt? I will perhaps need to write page numbers back to a XML file (either to the input file or to a new file.). Best, Den

Re: [NTG-context] XML xmldoif struggle!

2019-05-03 Thread Geert Verhaag
Hi Aditya, The ConTeXt team did a great job in writing the manual xml-mkiv.pdf, but I think it is not meant for a beginner. Its contents is rather overwhelming when trying it for the first time. For me, I don't use luatex a lot, so that adds to the difficulty of trying it out. Regards, Ger

Re: [NTG-context] XML xmldoif struggle!

2019-05-02 Thread Aditya Mahajan
On Thu, 2 May 2019, Geert Verhaag wrote: Yes, I got it working! It is somewhat tricky. Trying to understanding the concepts behind all this isn't easy for me, but I'm bashing on. I also find understanding XML processing rules to be complicated. I simply convert the XML to a lua table, and

Re: [NTG-context] XML xmldoif struggle!

2019-05-02 Thread Geert Verhaag
Hi Pablo, Yes, I got it working! It is somewhat tricky. Trying to understanding the concepts behind all this isn't easy for me, but I'm bashing on. Thanks! Regards, Gerard On 02-05-19 14:47, Pablo Rodriguez wrote: On 5/1/19 9:28 PM, Geert Verhaag wrote: Hoi Pablo, Thanks for your prompt

Re: [NTG-context] XML xmldoif struggle!

2019-05-02 Thread Pablo Rodriguez
On 5/1/19 9:28 PM, Geert Verhaag wrote: > Hoi Pablo, > > Thanks for your prompt reply! > > The output Euro set! is printed always, it doesn't matter whether I put > EURO or DOLLAR first?! Hi Geert, my fault, the conditional should read: \xmldoif{#1}{currency[position()==1 and contains(text()

Re: [NTG-context] XML xmldoif struggle!

2019-05-01 Thread Geert Verhaag
Hoi Pablo, Thanks for your prompt reply! The output Euro set! is printed always, it doesn't matter whether I put EURO or DOLLAR first?! Also I can't find any clue on the suggested page 49 of xml-mkiv.pdf manual, sorry! By the way, in my document it still doesn't seem to work! I'm afraid a

Re: [NTG-context] XML xmldoif struggle!

2019-05-01 Thread Pablo Rodriguez
On 4/30/19 9:58 PM, Geert Verhaag wrote: > [...] > \startxmlsetups xml:invoice:invoice >   \xmlfirst{#1}{currency} \par >   \xmldoif{\xmlfirst{#1}{currency}}{contains(text(),'EURO')} { > Euro set! \par >   } > [...] > But the xmldoif command doesn't cause the Euro set be printed?! > > What

[NTG-context] XML xmldoif struggle!

2019-04-30 Thread Geert Verhaag
Hi, I've the following XML tag in my XML file:   EURO . with invoice being the root tag! Now I have a setup defined as below (only part!): \startxmlsetups xml:invoice:invoice   \xmlfirst{#1}{currency} \par   \xmldoif{\xmlfirst{#1}{currency}}{contains(text(),'EURO')} { Euro set! \par

Re: [NTG-context] XML and math

2019-01-10 Thread Aditya Mahajan
On Thu, 10 Jan 2019, Aditya Mahajan wrote: On Thu, 10 Jan 2019, Hans Hagen wrote: On 1/10/2019 10:26 PM, Aditya Mahajan wrote: Hi, I have an XML file (which is generated via a program that I have no control over), which contains elements as follows:      

Re: [NTG-context] XML and math

2019-01-10 Thread Aditya Mahajan
On Thu, 10 Jan 2019, Hans Hagen wrote: On 1/10/2019 10:26 PM, Aditya Mahajan wrote: Hi, I have an XML file (which is generated via a program that I have no control over), which contains elements as follows:        height="15px" src="Lab01_eq1040162379890930

Re: [NTG-context] XML and math

2019-01-10 Thread Aditya Mahajan
On Fri, 11 Jan 2019, Henri Menke wrote: On 11/01/19 10:26 AM, Aditya Mahajan wrote: Hi, I have an XML file (which is generated via a program that I have no control over), which contains elements as follows:            I want to typeset the `

Re: [NTG-context] XML and math

2019-01-10 Thread Hans Hagen
On 1/10/2019 10:26 PM, Aditya Mahajan wrote: Hi, I have an XML file (which is generated via a program that I have no control over), which contains elements as follows:        height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/>    

Re: [NTG-context] XML and math

2019-01-10 Thread Henri Menke
On 11/01/19 10:26 AM, Aditya Mahajan wrote: > Hi, > > I have an XML file (which is generated via a program that I have no > control over), which contains elements as follows: > > >     >    height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/> >  

[NTG-context] XML and math

2019-01-10 Thread Aditya Mahajan
Hi, I have an XML file (which is generated via a program that I have no control over), which contains elements as follows: height="15px" src="Lab01_eq10401623798909303081.png" width="95px"/> I want to typeset the `text` attribute o

Re: [NTG-context] xml in lua advice ?

2018-09-19 Thread Taco Hoekwater
Hi, > it actually depends on what you do ... anyway here is some insight (as > xml-tex old-timer you'll probably recognize the madness) What I am mostly trying to do is to have as much of the xml processing in lua as possible. > > % \enabletrackers[context*] > > \starttext > > % here is you

Re: [NTG-context] xml in lua advice ?

2018-09-19 Thread mf
My 2 cents: local xmlflush = lxml.flush local function text_or_xml(...) for i,v in ipairs(arg) do if "table" == type(v) then xmlflush(v) else context(v) end end end function xml.functions.heading(t) text_or_xml( "\\section{" , t , "}" ) end Massimiliano Il giorno

Re: [NTG-context] xml in lua advice ?

2018-09-19 Thread Hans Hagen
On 9/19/2018 2:50 PM, Taco Hoekwater wrote: Hi, Is there a more elegant way to feed an xml tree into a context() command that what I have below? \startluacode function xml.functions.heading(t) context.section("{") lxml.flush(t) context("}") end \stopluacode The subtree in ’t’ coul

[NTG-context] xml in lua advice ?

2018-09-19 Thread Taco Hoekwater
Hi, Is there a more elegant way to feed an xml tree into a context() command that what I have below? \startluacode function xml.functions.heading(t) context.section("{") lxml.flush(t) context("}") end \stopluacode The subtree in ’t’ could have embedded xml tags that should be processed

Re: [NTG-context] XML to ConTeXt: converting date attribute from ISO date

2018-08-15 Thread Hans Hagen
On 8/15/2018 12:27 PM, Mike O'Connor wrote: G’Day, Having a first go at converting TEI XML to ConTeXt. Steep learning curve, but easier (for me) than XSLT, and first results were amazing.  Using http://www.pragma-ade.com/general/manuals/xml-mkiv.pdf as a guide. Currently stuck on converting

[NTG-context] XML to ConTeXt: converting date attribute from ISO date

2018-08-15 Thread Mike O'Connor
G’Day, Having a first go at converting TEI XML to ConTeXt. Steep learning curve, but easier (for me) than XSLT, and first results were amazing. Using http://www.pragma-ade.com/general/manuals/xml-mkiv.pdf as a guide. Currently stuck o

Re: [NTG-context] xml, language, btx problems

2018-06-18 Thread Pablo Rodriguez
On 06/17/2018 10:10 PM, Thomas A. Schmitz wrote: > On 06/17/2018 09:37 PM, Pablo Rodriguez wrote: > [...] > Thank you for your suggestion, Pablo, but this is just a slightly > different syntax to express the same test, this doesn't change anything. > Maybe this document is clearer in explaining m

Re: [NTG-context] xml, language, btx problems

2018-06-18 Thread Thomas A. Schmitz
sometimes you need to do \starttexcode   ... \stoptexcode when inside some special caocode regime (which happens in xml) Hans Hans, thank you - that was the golden hint! It works now as I've always wanted! And I realize once again that I know far less about ConTeXt than I wished and thou

Re: [NTG-context] xml, language, btx problems

2018-06-18 Thread Hans Hagen
On 6/18/2018 12:19 PM, Thomas A. Schmitz wrote: Hi Alan, thanks for joining the discussion! Just to answer your two queries about my setup: On 06/18/2018 12:58 AM, Alan Braslau wrote: Thomas, Why would the definitions need to be loaded before \starttext? The bibliographic data can be loaded

Re: [NTG-context] xml, language, btx problems

2018-06-18 Thread Thomas A. Schmitz
Hi Alan, thanks for joining the discussion! Just to answer your two queries about my setup: On 06/18/2018 12:58 AM, Alan Braslau wrote: Thomas, Why would the definitions need to be loaded before \starttext? The bibliographic data can be loaded independent of any rendering or use definitions.

Re: [NTG-context] xml, language, btx problems

2018-06-17 Thread Alan Braslau
On Sun, 17 Jun 2018 19:52:35 +0200 "Thomas A. Schmitz" wrote: > However, this implies a \starttext. And the btxdefinitions need to be > loaded before \starttext, or so it seems. Thomas, Why would the definitions need to be loaded before \starttext? The bibliographic data can be loaded independ

Re: [NTG-context] xml, language, btx problems

2018-06-17 Thread Wolfgang Schuster
One option is to load your document at the beginning with different setups where you only process the language information. Another option is to put the language dependent options in a setups block and load them when you process the XML file. \startbuffer[test] test \stopbuffer \startxm

Re: [NTG-context] xml, language, btx problems

2018-06-17 Thread Thomas A. Schmitz
On 06/17/2018 09:37 PM, Pablo Rodriguez wrote: Hi Thomas, this may work in your case: \startxmlsetups xml:document \mainlanguage[\xmlatt{#1}{language}] \doifmodeelse{**en} {\usebtxdefinitions [english]} {\usebtxdefinitions [deutsch]} \stopxmlsetups I have just c

Re: [NTG-context] xml, language, btx problems

2018-06-17 Thread Pablo Rodriguez
On 06/17/2018 07:52 PM, Thomas A. Schmitz wrote: > Hi, > > I have a conceptual problem integrating btx into my xml workflow. There > are too many files involved, so no minimal example, but a minimal > description. Root of my xml document: > > > ... > > > I have two files with btx definitions

[NTG-context] xml, language, btx problems

2018-06-17 Thread Thomas A. Schmitz
Hi, I have a conceptual problem integrating btx into my xml workflow. There are too many files involved, so no minimal example, but a minimal description. Root of my xml document: ... I have two files with btx definitions: publ-imp-deutsch.mkvi publ-imp-english.mkvi Loading one of these

Re: [NTG-context] xml verbatim in xml...

2017-08-12 Thread Pablo Rodriguez
On 08/09/2017 08:48 AM, Schmitz Thomas A. wrote: > >> On 8. Aug 2017, at 23:26, Pablo Rodriguez wrote: >> >> Thomas, >> >> \xmlprettyprint seems an easier approach. > > Thank you, I did’n know about \xmlprettyprint. But I want to define > my own prettyprinters, so it’s not suitable for my purpos

Re: [NTG-context] xml verbatim in xml...

2017-08-09 Thread Pablo Rodriguez
On 08/09/2017 11:03 AM, Hans Hagen wrote: > \startbuffer[test] > > > \starttext > \ConTeXt\ is awesome! > \stoptext > > > > > > ... > > > ... > > > > > \stopbuffer > > \startxmlsetups xml:testsetups > \x

Re: [NTG-context] xml verbatim in xml...

2017-08-09 Thread Jean-Pierre Delange
Thank you Hans ! This code is ... awesome ! JP Le 09/08/2017 à 11:03, Hans Hagen a écrit : \startbuffer[test] \starttext \ConTeXt\ is awesome! \stoptext ... ... \stopbuffer \startxmlsetups xml:testsetups \xml

Re: [NTG-context] xml verbatim in xml...

2017-08-09 Thread Hans Hagen
On 8/8/2017 11:37 PM, Pablo Rodriguez wrote: On 08/08/2017 11:26 PM, Pablo Rodriguez wrote: On 08/08/2017 10:46 PM, Schmitz Thomas A. wrote: Hi all, excellent excuse to pester the list with a program: it’s for my presentation at the ConTeXt meeting (have YOU registered yet?)… So: I want to sho

Re: [NTG-context] xml verbatim in xml...

2017-08-08 Thread Schmitz Thomas A.
> On 8. Aug 2017, at 23:26, Pablo Rodriguez wrote: > > Thomas, > > \xmlprettyprint seems an easier approach. Thank you, I did’n know about \xmlprettyprint. But I want to define my own prettyprinters, so it’s not suitable for my purpose. And it doesn’t solve the issue I was asking about. Tho

Re: [NTG-context] xml verbatim in xml...

2017-08-08 Thread Pablo Rodriguez
On 08/08/2017 11:26 PM, Pablo Rodriguez wrote: > On 08/08/2017 10:46 PM, Schmitz Thomas A. wrote: >> Hi all, >> >> excellent excuse to pester the list with a program: it’s for my >> presentation at the ConTeXt meeting (have YOU registered yet?)… >> So: I want to show verbatim xml, and I’m writing i

Re: [NTG-context] xml verbatim in xml...

2017-08-08 Thread Pablo Rodriguez
On 08/08/2017 10:46 PM, Schmitz Thomas A. wrote: > Hi all, > > excellent excuse to pester the list with a program: it’s for my > presentation at the ConTeXt meeting (have YOU registered yet?)… > So: I want to show verbatim xml, and I’m writing in xml. This > solution: http://wiki.contextgarden.net

[NTG-context] xml verbatim in xml...

2017-08-08 Thread Schmitz Thomas A.
Hi all, excellent excuse to pester the list with a program: it’s for my presentation at the ConTeXt meeting (have YOU registered yet?)… So: I want to show verbatim xml, and I’m writing in xml. This solution: http://wiki.contextgarden.net/Verbatim_XML mostly works (for Lua and TeX code), except

Re: [NTG-context] XML inclusion

2017-04-12 Thread Meer, Hans van der
On 9 Apr 2017, at 16:42, Hans Hagen mailto:pra...@wxs.nl>> wrote: On 4/7/2017 1:42 PM, Meer, Hans van der wrote: The command \xmlinclude{}{}{} includes the file specified by attribute IDENTIFIER of the element located by LPATH at NODE. What I would like to do is including a bunch of .xml files

Re: [NTG-context] XML inclusion

2017-04-09 Thread Hans Hagen
On 4/7/2017 1:42 PM, Meer, Hans van der wrote: The command \xmlinclude{}{}{} includes the file specified by attribute IDENTIFIER of the element located by LPATH at NODE. What I would like to do is including a bunch of .xml files where the directory to load from is given. Is this a possibility

[NTG-context] XML inclusion

2017-04-07 Thread Meer, Hans van der
The command \xmlinclude{}{}{} includes the file specified by attribute IDENTIFIER of the element located by LPATH at NODE. What I would like to do is including a bunch of .xml files where the directory to load from is given. Is this a possibility or could this be a feature added to the ConTeXt

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 i

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 s

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 xml.attribute

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: \st

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 \startxml

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 chapt

[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

Re: [NTG-context] XML export of a lua table

2017-02-23 Thread Peter Rolf
Am 23.02.2017 um 14:10 schrieb Hans Hagen: > On 2/23/2017 1:50 PM, Peter Rolf wrote: >> Hi, >> >> what is the easiest way to export a lua table (mostly key-value pairs) >> into a XML file? I found 'lxml.save', but no luck with a converter >> function. Any help welcome. > > kind of obvious: > > lo

Re: [NTG-context] XML export of a lua table

2017-02-23 Thread Hans Hagen
On 2/23/2017 1:50 PM, Peter Rolf wrote: Hi, what is the easiest way to export a lua table (mostly key-value pairs) into a XML file? I found 'lxml.save', but no luck with a converter function. Any help welcome. kind of obvious: local t = { a = { b = 1 } } inspect(table.toxml(t)) ---

[NTG-context] XML export of a lua table

2017-02-23 Thread Peter Rolf
Hi, what is the easiest way to export a lua table (mostly key-value pairs) into a XML file? I found 'lxml.save', but no luck with a converter function. Any help welcome. Peter ___ If your question is of interest to

Re: [NTG-context] xml: spurious empty spaces

2016-10-19 Thread Thomas A. Schmitz
On 10/19/2016 01:47 PM, Hans Hagen wrote: \startxmlsetups xml:a \ignorespaces \xmlflush{#1} \removeunwantedspaces \stopxmlsetups \startxmlsetups xml:b \ignorespaces \xmlfunction{#1}{b} \removeunwantedspaces \stopxmlsetups Ah OK, I had tried applying these within the l

Re: [NTG-context] xml: spurious empty spaces

2016-10-19 Thread Hans Hagen
On 10/19/2016 12:07 PM, Thomas A. Schmitz wrote: Hi all, below is a slightly silly example that demonstrates a problem I’m having: I want to process (in Lua) the xml element “b” only when it has an attribute “display” set. This works, but elements without the attribute leave spurious spaces i

[NTG-context] xml: spurious empty spaces

2016-10-19 Thread Thomas A. Schmitz
Hi all, below is a slightly silly example that demonstrates a problem I’m having: I want to process (in Lua) the xml element “b” only when it has an attribute “display” set. This works, but elements without the attribute leave spurious spaces in the pdf output. The workaround I’m currently usin

Re: [NTG-context] xml expression error

2016-05-12 Thread Hans Hagen
On 5/12/2016 1:49 PM, Meer, Hans van der wrote: I think I have the problem nailed down to the fact that in the comparison: something >= -1234 the parser in question separates the minus in the negative number into a separate child node, apart from the digits; witness the errormessage in the log be

Re: [NTG-context] xml expression error

2016-05-12 Thread Meer, Hans van der
I think I have the problem nailed down to the fact that in the comparison: something >= -1234 the parser in question separates the minus in the negative number into a separate child node, apart from the digits; witness the errormessage in the log below. Changing the number -1234 in the arithmeti

Re: [NTG-context] xml expression error

2016-04-29 Thread Meer, Hans van der
On 28 Apr 2016, at 22:13, Pablo Rodriguez mailto:oi...@gmx.es>> wrote: On 04/28/2016 05:06 PM, dr. Hans van der Meer wrote: Why is there anexpression error here? I would expect that the expression number(-1101) evaluates to a negative number taking part in the comparsion. It looks as if the

Re: [NTG-context] xml expression error

2016-04-28 Thread Meer, Hans van der
> On 28 Apr 2016, at 22:13, Pablo Rodriguez wrote: > > On 04/28/2016 05:06 PM, dr. Hans van der Meer wrote: >> Why is there anexpression error here? I would expect that the expression >> number(-1101) evaluates to a negative number taking part in the >> comparsion. It looks as if the minus s

Re: [NTG-context] xml expression error

2016-04-28 Thread Pablo Rodriguez
On 04/28/2016 05:06 PM, dr. Hans van der Meer wrote: > Why is there anexpression error here? I would expect that the expression > number(-1101) evaluates to a negative number taking part in the > comparsion. It looks as if the minus sign is not seen as an unary minus, > while -1101 should h

[NTG-context] xml expression error

2016-04-28 Thread dr. Hans van der Meer
Why is there anexpression error here? I would expect that the expression number(-1101) evaluates to a negative number taking part in the comparsion. It looks as if the minus sign is not seen as an unary minus, while -1101 should have be evaluated by Lua's tonumber(-1101). relevant c

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 \star

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 mailto:pra...@wxs.nl>> 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 "Dea

Re: [NTG-context] xml input

2016-04-22 Thread Meer, Hans van der
On 21 Apr 2016, at 10:41, Hans Hagen mailto:pra...@wxs.nl>> 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

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 >mailto:m...@

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 \startxm

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 mailto:m...@silentumbrella.com>> wrote: I'm interested in this thread too... But I'm american, so English only. I appreciate you

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 Germ

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

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

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

Re: [NTG-context] xml input

2016-04-14 Thread Meer, Hans van der
On 14 Apr 2016, at 10:45, Hans Hagen mailto:pra...@wxs.nl>> 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

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 co

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 -

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 mailto:h.vanderm...@uva.nl>> wrote: I would like to process several input sources

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

Re: [NTG-context] XML interface commands

2016-01-25 Thread Jan U. Hasecke
Am 25.01.2016 um 17:41 schrieb Hans Hagen: > We're also extending the system a bit to cover more variants of commands > (currently I'm updating the xml manual and adding setups there too). Great, for me this system would be the first place to look up commands if it covers everything. juh

Re: [NTG-context] XML interface commands

2016-01-25 Thread Hans Hagen
On 1/25/2016 3:56 PM, Wolfgang Schuster wrote: Jan U. Hasecke 25. Januar 2016 um 15:14 Dear list, I am currently trying to setup a small documentation about ConTeXt and I would like to use the \showsetup command to introduce the documentation of a command. B

Re: [NTG-context] XML interface commands

2016-01-25 Thread Wolfgang Schuster
Jan U. Hasecke 25. Januar 2016 um 15:14 Dear list, I am currently trying to setup a small documentation about ConTeXt and I would like to use the \showsetup command to introduce the documentation of a command. But it seems that not all commands are accessible

[NTG-context] XML interface commands

2016-01-25 Thread Jan U. Hasecke
Dear list, I am currently trying to setup a small documentation about ConTeXt and I would like to use the \showsetup command to introduce the documentation of a command. But it seems that not all commands are accessible through this command. Eg. startchapter etc. is not accessible. Are there pl

Re: [NTG-context] XML expression to read HTML classes

2015-08-27 Thread Hans Hagen
On 8/27/2015 10:57 PM, Hans Hagen wrote: On 8/25/2015 5:05 PM, mass...@fastwebnet.it wrote: Hello list, I'm working on HTML typesetting with ConTeXt. I wrote a custom expression to test whether an element has a class: function xml.functions.classes(classAttr) local classes = {} if classAt

Re: [NTG-context] XML expression to read HTML classes

2015-08-27 Thread Hans Hagen
On 8/25/2015 5:05 PM, mass...@fastwebnet.it wrote: Hello list, I'm working on HTML typesetting with ConTeXt. I wrote a custom expression to test whether an element has a class: function xml.functions.classes(classAttr) local classes = {} if classAttr then for c in string.gmatch(classA

Re: [NTG-context] XML expression to read HTML classes

2015-08-26 Thread massifr
A working example to clarify my request: \startluacode -- splits the attribute class using spaces as classes' separator -- returns an array of strings function xml.functions.classes(classAttr) local classes = {} if classAttr then for c in string.gmatch(classAttr, "%S+") do

[NTG-context] XML expression to read HTML classes

2015-08-25 Thread massifr
Hello list, I'm working on HTML typesetting with ConTeXt. I wrote a custom expression to test whether an element has a class: function xml.functions.classes(classAttr) local classes = {} if classAttr then for c in string.gmatch(classAttr, "%S+") do if (string.len(c) > 0) then classes

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

Re: [NTG-context] XML - accessing parental children attribute (was: some troubles)

2015-02-17 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello, thanks Hans, this works perfectly... Lukas \startbuffer[demo] -- A1 X1 B1 -- A2 X2 B2 -- A3 X3 B3 \stopbuffer \startxmlsetups xml:initialize \xmlsetsetup{#1}{*}{xml:*} \stopxmlsetups \startxmlsetups xml:a \xmlflush{#1} \stopxmlsetups \

Re: [NTG-context] XML - accessing parental children attribute (was: some troubles)

2015-02-17 Thread Hans Hagen
On 2/17/2015 3:25 PM, Procházka Lukáš Ing. - Pontex s. r. o. wrote: Hello, a slightly modified example: t.xml AA AB and the Ctx source: t.mkiv \startxmlsetups xml:T \xmlfunction{#1}{test} \xmlsetsetup{\xmldocument}{*}{+} % \xmlsetsetup{\xmldocument}{*}{-} %

Re: [NTG-context] XML - accessing parental children attribute (was: some troubles)

2015-02-17 Thread Procházka Lukáš Ing . - Pontex s . r . o .
Hello, a slightly modified example: t.xml AA AB and the Ctx source: t.mkiv \startxmlsetups xml:T \xmlfunction{#1}{test} \xmlsetsetup{\xmldocument}{*}{+} % \xmlsetsetup{\xmldocument}{*}{-} % Empties output?! \xmlsetsetup{\xmldocument}{a/aa}{xml:*} \xmlsetsetup{

<    1   2   3   4   5   6   >