On 03/05/2013 11:11 AM, Hans Hagen wrote:
\startluacode local lookuptable = { } function xml.functions.lookup(t) local mytype = xml.text(t, "c") local myvalue = lookuptable[mytype] if not myvalue then myvalue = xml.first(t, "d") lookuptable[mytype] = myvalue context("registered: ") else context("reused: ") end -- each found node gets an id lxml.flush(lxml.id(myvalue)) context(" or ") -- in tex mode a to-tex serializer is the default xml.cprint(myvalue) end \stopluacode
One place to look for tricks is in x-mathml.mkiv / lua (I know, I should finish that manual).
Hans
Beautiful! Thanks a lot, that's just what I needed. And yes, in the medium-to-long run, finishing the manual will save you from being pestered with my questions... :-) Thomas