On 24-10-2011 19:00, Thomas A. Schmitz wrote:
On 10/24/2011 02:26 PM, Hans Hagen wrote:
if lxml.att(t, "frame") == "on" then context("Yes, the frame is really on!") else context("Nope, sorry, it's still off.") end
I don't really understand what kind of object a call such as lxml.att(t, "frame") produces.
all lxml.* calls print something to tex, so when you're at the lua end and want to stay there you should use the xml.* methods; also, when you have an element, say e then there is an e.at table that has all attributes
OK, excuse me for being particularly thick today: there doesn't seem to be xml.att, only xml.attribute, so it should be something like:
function tableinit(t) if xml.attribute(t, "/", "frame", "off") == "on" then context("Yes, the framestate is really on!") else context("Nope, sorry, it's still off.") end end
(if I understand the definition of xml.attribute correctly: id,pattern,a,default)?
sure, oryou can play with if xml.filter(t,".[@frame=on]) then the x-*.lua show some tricks Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------