29.05.2014 Views

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

The history of luaTEX 2006–2009 / v 0.50 - Pragma ADE

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>The</strong>se commands tell MkIV that elements with a namespace specication that contains<br />

cals will be remapped to the internal namespace cals and the setup associates a function<br />

with this internal namespace.<br />

By now it will be clear that from the perspective <strong>of</strong> the user hardly any Lua is visible. Sure,<br />

he or she can deduce that deep down some magic takes place, especially when you run<br />

into more complex expressions like this (the @ denotes an attribute):<br />

\xmlsetsetup<br />

{main} {item[@type='mpctext' or @type='mrtext']}<br />

{questions:multiple:text}<br />

Such expressions resemble xpath, but can go much further than that, just by adding more<br />

functions to the library.<br />

b[position() > 2 and position() < 5 and text() == 'ok']<br />

b[position() > 2 and position() < 5 and text() == upper('ok')]<br />

b[@n=='03' or @n=='08']<br />

b[number(@n)>2 and number(@n)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!