Re: [NTG-context] xml nbsp?

2023-06-13 Thread Bruce Horrocks via ntg-context
is not a pre-defined named character in XML (but it is in HTML which lulls you into a false sense of security). See the link below for some more detail and a fix. > On 13 Jun 2023, at 11:01, Hans van der Meer via

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

Re: [NTG-context] XML Namespaces and XML Setups

2022-05-24 Thread Bruce Horrocks via ntg-context
I haven't seen it explicitly documented - my cue to add it to the Wiki I guess! I work with XML a fair bit and, IMHO, the WWW consortium docs do a very poor job of explaining namespaces because they make them seem much more complicated than they are. Essentially, a tag with a namespace

Re: [NTG-context] XML Namespaces and XML Setups

2022-05-24 Thread Duncan Hothersall via ntg-context
Yes, it does! Thanks Bruce. Is this documented somewhere already and I missed it? Cheers. Duncan On Mon, 23 May 2022 at 21:14, Bruce Horrocks wrote: > Does this help? > > \startxmlsetups xml:demo:base > \xmlsetsetup{#1}{tag}{xml:demo:tag} > \xmlsetsetup{#1}{o:tag}{xml:demo:otag} %% <--- >

Re: [NTG-context] XML Namespaces and XML Setups

2022-05-23 Thread Bruce Horrocks via ntg-context
Does this help? \startxmlsetups xml:demo:base \xmlsetsetup{#1}{tag}{xml:demo:tag} \xmlsetsetup{#1}{o:tag}{xml:demo:otag} %% <--- \stopxmlsetups \xmlregisterdocumentsetup{demo}{xml:demo:base} \startxmlsetups xml:demo:tag \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:demo:otag %% <---

Re: [NTG-context] XML Namespaces and XML Setups

2022-05-23 Thread Duncan Hothersall via ntg-context
I found this unanswered question on the list from November 2020 and find today that I have the same question. How can one handle elements with the same name but in different namespaces? How should the different \startxmlsetups commands be written? Thanks. Duncan On Mon, 16 Nov 2020 at 13:37,

Re: [NTG-context] XML: calculations on attribute values before output

2022-05-05 Thread Duncan Hothersall via ntg-context
Thanks so much Taco, that opens the door to a lot for me. It's a tricky learning curve. Just in case anyone else is copying code in future for CALS, there's a tiny tweak to the rows calculation, it should be (t.at.morerows or 0) + 1. I see a route to solving lots of other problems here too.

Re: [NTG-context] XML: calculations on attribute values before output

2022-05-05 Thread Taco Hoekwater via ntg-context
> On 4 May 2022, at 22:10, Duncan Hothersall via ntg-context > wrote: > > Hi. > > I'm processing an XML table and need to set a row span. Because we use a > variant of the CALS table model, spans are defined by an attribute saying how > many *additional* rows should be spanned, as opposed

Re: [NTG-context] XML processing instructions

2022-05-03 Thread Duncan Hothersall via ntg-context
Just following up on my own question in case anybody else is interested, I realised that the logic of my preprocessor code wasn't the problem, it was just my ignorance of lua and character escaping. Both ? and * are special characters in string.gsub expressions, so they need to be escaped with the

Re: [NTG-context] XML processing instructions

2022-05-02 Thread Duncan Hothersall via ntg-context
Many thanks Denis. Very useful tip on the injectors and generalised command usage. That will definitely come in useful. My problem is that I already have a lot of XML data with the existing processing instructions in it. I know I could use an external preprocess in something like Python to change

Re: [NTG-context] XML processing instructions

2022-05-02 Thread Denis Maier via ntg-context
That was too quick, sorry. Hi Duncan, I have used context’s own injectors for this : \startsetups xml:directive:injector:addlinetopage \adaptlayout[lines=+1] \stopsetups Or, for your line break example : \startsetups xml:directive:injector:newline \crlf \stopsetups Also, I have

Re: [NTG-context] XML processing instructions

2022-05-02 Thread Denis Maier via ntg-context
Hi Duncan, I have used context’s own injectors for this : \startsetups xml:directive:injector:addlinetopage \adaptlayout[lines=+1] \stopsetups Or, for your line break example : Von: ntg-context Im Auftrag von Duncan Hothersall via ntg-context Gesendet: Montag, 2. Mai 2022 09:20 An:

Re: [NTG-context] XML processing instructions

2022-05-02 Thread Duncan Hothersall via ntg-context
Apologies, there are two rogue * in the lxml.preprocessor code, but even when they are removed it doesn't work. On Mon, 2 May 2022 at 08:19, Duncan Hothersall wrote: > I have a big set of existing XML books (held in a derivative of DocBook) > which I'm looking to start processing directly with

Re: [NTG-context] Xml - Lua - context

2022-03-28 Thread Thomas A. Schmitz via ntg-context
> On 28. Mar 2022, at 18:21, Adam Reviczky via ntg-context > wrote: > > Hi Thomas, > > Not sure whether it helps or not, but in regards to combinations and Lua I > have had some challenges as well, but Hans' and Wolfgangs' solution with > externalfigures works fine for me now: > >

Re: [NTG-context] Xml - Lua - context

2022-03-28 Thread Adam Reviczky via ntg-context
Hi Thomas, Not sure whether it helps or not, but in regards to combinations and Lua I have had some challenges as well, but Hans' and Wolfgangs' solution with externalfigures works fine for me now: https://mailman.ntg.nl/pipermail/ntg-context/2021/103822.html

Re: [NTG-context] XML, dealing with whitespace

2022-01-17 Thread Denis Maier via ntg-context
Hi Wolfgang, Von: Wolfgang Schuster Gesendet: Samstag, 15. Januar 2022 20:28 An: mailing list for ConTeXt users ; Denis Maier via ntg-context Cc: Maier, Denis Christian (UB) Betreff: Re: [NTG-context] XML, dealing with whitespace Denis Maier via ntg-context schrieb am 15.01.2022 um 13:04

Re: [NTG-context] XML, dealing with whitespace

2022-01-15 Thread Wolfgang Schuster via ntg-context
Denis Maier via ntg-context schrieb am 15.01.2022 um 13:04: Hi all, I have sources that look like this: %    Bla Bla Bla   Bla   , Bla Bla. % Typesetting this with context gives me a spurious space after the underlined

Re: [NTG-context] xml processing: if elseif else / switch case

2021-12-10 Thread Denis Maier via ntg-context
with an example next week... Denis > -Ursprüngliche Nachricht- > Von: Wolfgang Schuster > Gesendet: Donnerstag, 9. Dezember 2021 18:32 > An: mailing list for ConTeXt users ; Denis Maier via ntg- > context > Cc: Maier, Denis Christian (UB) > Betreff: Re: [NTG-context] xml

Re: [NTG-context] xml processing: if elseif else / switch case

2021-12-09 Thread Wolfgang Schuster via ntg-context
Denis Maier via ntg-context schrieb am 09.12.2021 um 18:24: Thanks for all the answers. That's helpful. But I think that does not work with the xml tests, or does it? I mean, is this a general mechanism? Since you didn't provide a example with your problem there is no way to tell how to

Re: [NTG-context] xml processing: if elseif else / switch case

2021-12-09 Thread Denis Maier via ntg-context
:53:42 An: mailing list for ConTeXt users Cc: Hans Hagen Betreff: Re: [NTG-context] xml processing: if elseif else / switch case On 12/9/2021 5:30 PM, Joey McCollum via ntg-context wrote: > Thanks for correcting that, Wolfgang. I must have added the other \fi > instances because I was trying

Re: [NTG-context] xml processing: if elseif else / switch case

2021-12-09 Thread Hans Hagen via ntg-context
On 12/9/2021 5:30 PM, Joey McCollum via ntg-context wrote: Thanks for correcting that, Wolfgang. I must have added the other \fi instances because I was trying to use \orelse in MKIV and couldn't get it to work. Is it only supported in LMTX? yes, it's one of the native luametatex features

Re: [NTG-context] xml processing: if elseif else / switch case

2021-12-09 Thread Joey McCollum via ntg-context
Thanks for correcting that, Wolfgang. I must have added the other \fi instances because I was trying to use \orelse in MKIV and couldn't get it to work. Is it only supported in LMTX? Joey On Thu, Dec 9, 2021 at 11:30 AM Hans Hagen via ntg-context < ntg-context@ntg.nl> wrote: > On 12/9/2021 5:11

Re: [NTG-context] xml processing: if elseif else / switch case

2021-12-09 Thread Hans Hagen via ntg-context
On 12/9/2021 5:11 PM, Wolfgang Schuster via ntg-context wrote: Joey McCollum via ntg-context schrieb am 09.12.2021 um 15:08: I believe \orelse might be what you want. It works with most \if... macros, and it avoids nesting of \doifelse constructs. Here's an example, which I use in

Re: [NTG-context] xml processing: if elseif else / switch case

2021-12-09 Thread Wolfgang Schuster via ntg-context
Joey McCollum via ntg-context schrieb am 09.12.2021 um 15:08: I believe \orelse might be what you want. It works with most \if... macros, and it avoids nesting of \doifelse constructs. Here's an example, which I use in conditionally removing preceding punctuation if any other keys are defined

Re: [NTG-context] xml processing: if elseif else / switch case

2021-12-09 Thread Joey McCollum via ntg-context
I believe \orelse might be what you want. It works with most \if... macros, and it avoids nesting of \doifelse constructs. Here's an example, which I use in conditionally removing preceding punctuation if any other keys are defined before a specific one in an assignment: ``` % If any of the

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Thangalin via ntg-context
Confirmed that the following worked: 1. Run: rm -rf /tmp/luatex-cache/ (your cache directory location will differ) 2. Edit ./tex/texmf-context/tex/context/base/mkiv/scrn-ref.lua 3. Replace line 15 to assign the empty function as Hans indicated 4. Save the file 5. Run:

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Pablo Rodriguez via ntg-context
On 12/1/21 2:03 PM, Denis Maier via ntg-context wrote: > Sorry for spamming the list, but I was able to narrow it further down: > [...] > \setupinteraction > [state=start, >openaction=FitWidth] % comment this out to make it work > [...] > Can anyone confirm this? Hi Denis, I can confirm

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Hans Hagen via ntg-context
\stoptext % Can anyone confirm this? -Ursprüngliche Nachricht- Von: ntg-context Im Auftrag von Denis Maier via ntg-context Gesendet: Mittwoch, 1. Dezember 2021 11:44 An: j.ha...@xs4all.nl; ntg-context@ntg.nl Cc: Maier, Denis Christian (UB) Betreff: Re: [NTG-context] xml

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Denis Maier via ntg-context
this? > -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von Denis Maier > via ntg-context > Gesendet: Mittwoch, 1. Dezember 2021 11:44 > An: j.ha...@xs4all.nl; ntg-context@ntg.nl > Cc: Maier, Denis Christian (UB) > Betreff: Re: [NTG-context] xml processing errors

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Denis Maier via ntg-context
; > Von: Hans Hagen > > Gesendet: Mittwoch, 1. Dezember 2021 10:52 > > An: mailing list for ConTeXt users > > Cc: Maier, Denis Christian (UB) > > Betreff: Re: [NTG-context] xml processing errors after latest upgrade > > > > On 12/1/2021 10:41 AM, De

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Denis Maier via ntg-context
=, ] \starttext asdf \stoptext Best, Denis > -Ursprüngliche Nachricht- > Von: Hans Hagen > Gesendet: Mittwoch, 1. Dezember 2021 10:52 > An: mailing list for ConTeXt users > Cc: Maier, Denis Christian (UB) > Betreff: Re: [NTG-context] xml processing errors af

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Denis Maier via ntg-context
prüngliche Nachricht- > > > Von: Hans Hagen > > > Gesendet: Mittwoch, 1. Dezember 2021 10:52 > > > An: mailing list for ConTeXt users > > > Cc: Maier, Denis Christian (UB) > > > Betreff: Re: [NTG-context] xml processing errors after latest > > >

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Denis Maier via ntg-context
mber 2021 10:52 > > An: mailing list for ConTeXt users > > Cc: Maier, Denis Christian (UB) > > Betreff: Re: [NTG-context] xml processing errors after latest upgrade > > > > On 12/1/2021 10:41 AM, Denis Maier via ntg-context wrote: > > > > > Not

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Denis Maier via ntg-context
s Christian (UB) > Betreff: Re: [NTG-context] xml processing errors after latest upgrade > > On 12/1/2021 10:41 AM, Denis Maier via ntg-context wrote: > > > Not sure what is going wrong. Any hints how I can start debugging? Any > > ideas what could have caused that change? &g

Re: [NTG-context] xml processing errors after latest upgrade

2021-12-01 Thread Hans Hagen via ntg-context
On 12/1/2021 10:41 AM, Denis Maier via ntg-context wrote: Not sure what is going wrong. Any hints how I can start debugging? Any ideas what could have caused that change? (Ok, let’s build a MWE..) a mix of old / new files? -

Re: [NTG-context] XML-processing: Error with hyphenatedurl

2021-10-27 Thread Hans Hagen via ntg-context
On 10/27/2021 5:37 PM, Denis Maier via ntg-context wrote: Oh, actually that leads to a similar problem as in my original question where Wolfgang suggested using \expandUx: if the URL is broken across lines, the link content is also broken. Interestingly, the plain \startxmlsetups

Re: [NTG-context] XML-processing: Error with hyphenatedurl

2021-10-27 Thread Pablo Rodriguez via ntg-context
On 10/27/21 5:37 PM, Denis Maier via ntg-context wrote: > [...] > Oh, actually that leads to a similar problem as in my original > question where Wolfgang suggested using \expandUx: if the URL is > broken across lines, the link content is also broken. Interestingly, > the plain> > \startxmlsetups

Re: [NTG-context] XML-processing: Error with hyphenatedurl

2021-10-27 Thread Denis Maier via ntg-context
iche Nachricht- > > Von: ntg-context Im Auftrag von Pablo > > Rodriguez via ntg-context > > Gesendet: Mittwoch, 27. Oktober 2021 15:43 > > An: Denis Maier via ntg-context > > Cc: Pablo Rodriguez > > Betreff: Re: [NTG-context] XML-processing: Error with

Re: [NTG-context] XML-processing: Error with hyphenatedurl

2021-10-27 Thread Denis Maier via ntg-context
> -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von Pablo > Rodriguez via ntg-context > Gesendet: Mittwoch, 27. Oktober 2021 15:43 > An: Denis Maier via ntg-context > Cc: Pablo Rodriguez > Betreff: Re: [NTG-context] XML-processing: Error with hyphenatedu

Re: [NTG-context] XML-processing: Error with hyphenatedurl

2021-10-27 Thread Pablo Rodriguez via ntg-context
On 10/27/21 3:03 PM, Denis Maier via ntg-context wrote: > [...] > I’ve receiving errors that seem to be related to hyphenatedurl. The > problem is I cannot really reproduce it in a MWE. The example below > works, but if I include the link in my real document, I’am getting this > error message

Re: [NTG-context] xml processing in latest

2021-04-21 Thread Thomas A. Schmitz
On 4/21/21 10:34 AM, denis.ma...@ub.unibe.ch wrote: Hi What's the exact issue? You're not using the latest version: 2021.04.20 18:45 Thomas ___ If your question is of interest to others as well, please add an

Re: [NTG-context] xml processing in latest

2021-04-21 Thread denis.maier
Ah, now I see ConTeXt ver: 2021.04.20 18:45 LMTX fmt: 2021.4.21 int: english/english gives me the attached result. Denis > -Ursprüngliche Nachricht- > Von: Maier, Denis Christian (UB) > Gesendet: Mittwoch, 21. April 2021 10:34 > An: ntg-context@ntg.nl > Betreff: AW: [NTG-context] xml

Re: [NTG-context] xml processing in latest

2021-04-21 Thread denis.maier
Hi What's the exact issue? I get the same results on my TeXLive version and on the latext lmtx: ConTeXt ver: 2020.01.26 18:34 MKIV beta fmt: 2020.10.2 int: english/english ConTeXt ver: 2021.04.18 18:12 LMTX fmt: 2021.4.20 int: english/english And even with --luatex ConTeXt ver:

Re: [NTG-context] XML/MathML namespace handling bug

2021-03-26 Thread Hans Hagen
On 3/26/2021 6:02 AM, Hugo Landau wrote: in x-math.mkiv search for \startxmlsetups mml:apply and replace this bit: \edef\mmlapplyaction{\xmlfilter{#1}{/*/tag()}} \doifelsesetups {mml:apply:mml:\mmlapplyaction} {

Re: [NTG-context] XML/MathML namespace handling bug

2021-03-25 Thread Hugo Landau
> in x-math.mkiv search for > >\startxmlsetups mml:apply > > and replace this bit: > > \edef\mmlapplyaction{\xmlfilter{#1}{/*/tag()}} > \doifelsesetups {mml:apply:mml:\mmlapplyaction} { > \xmlsetup{#1}{mml:apply:mml:\mmlapplyaction} > } {

Re: [NTG-context] XML/MathML namespace handling bug

2021-03-20 Thread Hans Hagen
On 3/20/2021 10:52 PM, Hugo Landau wrote: Thanks for ConTeXt, it is an amazing system. The following test case demonstrates the bug. \usemodule[mathml] \starttext \xmlprocessdata{}{ http://www.example.com/ns/foo; xmlns:m="http://www.w3.org/1998/Math/MathML;> ab

Re: [NTG-context] xml bookmarks + chapter no. in header

2020-10-07 Thread Pablo Rodriguez
On 10/7/20 5:06 PM, Tomas Hala wrote: > Hi, > > I tried > \setuphead[section][expansion=yes] > with no effect before I wrote my question to the list here. > > With the \setuphead, the .tuc file still contains macro names instead of the > text: > ["title"]="\\expanded \\name ", > whereas without

Re: [NTG-context] xml bookmarks + chapter no. in header

2020-10-07 Thread Tomas Hala
Hi, I tried \setuphead[section][expansion=yes] with no effect before I wrote my question to the list here. With the \setuphead, the .tuc file still contains macro names instead of the text: ["title"]="\\expanded \\name ", whereas without it only: ["title"]=" \\name ", So is there any way

Re: [NTG-context] xml bookmarks

2020-10-07 Thread Jano Kula
On Wed, 7 Oct 2020 at 15:04, Pablo Rodriguez wrote: > On 10/7/20 1:28 PM, Jano Kula wrote: > > Hello to everybody! > > > > I have a similar problem as Tomas two days ago. When inserting bookmarks > > from XML the reference to the node is stored in TUC file > > > > ["titledata"]={ > >

Re: [NTG-context] xml bookmarks

2020-10-07 Thread Pablo Rodriguez
On 10/7/20 1:28 PM, Jano Kula wrote: > Hello to everybody! > > I have a similar problem as Tomas two days ago. When inserting bookmarks > from XML the reference to the node is stored in TUC file > >   ["titledata"]={ >    ["label"]="section", >    ["title"]="\\xmlatt {xml:name::4}{title}" > > and

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

2020-03-11 Thread Hans Hagen
On 3/11/2020 4:54 PM, Axel Kielhorn wrote: Hello Hans and mailing list! Thank you so much. With this example and the help I received earlier from Massi, I’ve been able to write my first finalizer today. It is amazing how powerful luatex is. indeed (and luametatex is supposed to be even bit

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

2020-03-11 Thread Axel Kielhorn
Hello Hans and mailing list! Thank you so much. With this example and the help I received earlier from Massi, I’ve been able to write my first finalizer today. It is amazing how powerful luatex is. My project needs some cleanup and documentation but I hope to put it on GitHub soon. After

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

2020-03-11 Thread Axel Kielhorn
> Am 11.03.2020 um 15:19 schrieb Hans Hagen : > > On 3/11/2020 3:12 PM, Axel Kielhorn wrote: >>> Am 11.03.2020 um 15:01 schrieb Hans Hagen : >>> >>> On 3/11/2020 2:14 PM, Axel Kielhorn wrote: Had to change it to: \startluacode function

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

2020-03-11 Thread Hans Hagen
On 3/11/2020 2:14 PM, Axel Kielhorn wrote: Am 15.08.2018 um 14:04 schrieb 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

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

2020-03-11 Thread Axel Kielhorn
> Am 15.08.2018 um 14:04 schrieb 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

Re: [NTG-context] xml differences between old context and lmtx

2019-12-27 Thread Jan U. Hasecke
Am 27.12.19 um 14:03 schrieb Hans Hagen: > On 12/26/2019 1:19 PM, Jan U. Hasecke wrote: >> Hi all, >> >> are there any documented differences between the xml features of normal >> context and lmtx? >> >> In a fun project I compile xml sources from www.deutschestextarchiv.de >> to pdf via context

Re: [NTG-context] xml differences between old context and lmtx

2019-12-27 Thread Hans Hagen
On 12/26/2019 1:19 PM, Jan U. Hasecke wrote: Hi all, are there any documented differences between the xml features of normal context and lmtx? In a fun project I compile xml sources from www.deutschestextarchiv.de to pdf via context using xmlsetups which kinda works with normal context current

Re: [NTG-context] XML/HTML output of Math

2019-08-09 Thread Atsuhito Kohda
Hi all, I will attach a screenshot of firefox on Ubuntu 10.04 but I'm not familiar with Gmail so I'm uncertain if it goes well or not. Thanks for your help. Best regards, Atsuhito Kohda ___ > If your question is of

Re: [NTG-context] XML/HTML output of Math

2019-08-09 Thread Hans Hagen
On 8/8/2019 9:41 AM, Taco Hoekwater wrote: In case display math mode, we get very weird output of "\int_a^b”. ConTeXt outputs b_a^\int in display mode; the order of the objects inside the generated is wrong, which is clearly a bug. And it seems to do this for all large operators. i'll look

Re: [NTG-context] XML/HTML output of Math

2019-08-09 Thread Taco Hoekwater
Hi, > On 9 Aug 2019, at 07:35, Atsuhito Kohda wrote: > > Dear Taco, thanks for your reply. > > > I opened the xhtml with firefox and the only problem I see > > is the ignored \displaystyle (which is why the integral looks small). > > Inline looks fine otherwise, no interchanging of limits. >

Re: [NTG-context] XML/HTML output of Math

2019-08-08 Thread Atsuhito Kohda
Dear Taco, thanks for your reply. > I opened the xhtml with firefox and the only problem I see > is the ignored \displaystyle (which is why the integral looks small). > Inline looks fine otherwise, no interchanging of limits. Hmm, I use firefox 68.0.1 of Ubuntu 19.04 and firefox 60.8.0 of

Re: [NTG-context] XML/HTML output of Math

2019-08-08 Thread Taco Hoekwater
Hi, > On 8 Aug 2019, at 01:06, Atsuhito Kohda wrote: > > Hi all, > I used to compile a beamer file with LuaLaTeX to generate a PDF > for presentation then convert the beamer file to XHTML with LaTeXML > for Web page. > Recently I begin to use ConTeXt so I try to get a PDF for presentation > and

Re: [NTG-context] XML in latest betas (MkIV & LMTX)

2019-06-02 Thread Hans Hagen
On 6/2/2019 3:07 PM, Pablo Rodriguez wrote: Font expansion (as reported in https://mailman.ntg.nl/pipermail/ntg-context/2019/095175.html). font expansion is always slower (but i admit that i never use it) Hans -

Re: [NTG-context] XML in latest betas (MkIV & LMTX)

2019-06-02 Thread Pablo Rodriguez
On 6/2/19 2:12 PM, Hans Hagen wrote: > On 6/2/2019 1:17 PM, Pablo Rodriguez wrote: >> [...] >> Compiling exactly the same XML sources (a book on ConTeXt in Spanish), >> MkIV needs 40s and LMTX more than 52s. > > Hm. Is that the first time you compare a MKIV runs with an LMTX run for > that

Re: [NTG-context] XML in latest betas (MkIV & LMTX)

2019-06-02 Thread Hans Hagen
On 6/2/2019 1:17 PM, Pablo Rodriguez wrote: Dear list, I have just installed latest betas for both MkIV and LMTX. Compiling exactly the same XML sources (a book on ConTeXt in Spanish), MkIV needs 40s and LMTX more than 52s. Hm. Is that the first time you compare a MKIV runs with an LMTX run

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

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

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

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

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

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

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,

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

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

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

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?! > >

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"

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"/> >  

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

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

  1   2   3   4   5   >