[NTG-context] xml and lua again

Hans Hagen pragma at wxs.nl
Mon Oct 24 14:26:50 CEST 2011


On 24-10-2011 14:18, Thomas A. Schmitz wrote:
> On 10/24/2011 12:17 PM, Hans Hagen wrote:
>> why so complex
>
> Hi Hans,
>
> yes, I'm aware that this procedure is quite silly for this example, this
> was just for myself, for educational purposes. As soon as the setup
> becomes more complex, I thought it might be easier to collect and
> process the options in lua than in tex (as I have done before), but I'm
> running against a wall here (see my exchange with Peter about goat milk
> yesterday). So the real question is: how can I collect data such as an
> attribute value to process it with lua, say in the form
>
> 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


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


More information about the ntg-context mailing list