Changes

Jump to navigation Jump to search
221 bytes added ,  08:32, 28 March 2013
no edit summary
end
</pre></code>
What does this do? As you can see, we mostly use the <tt>context...</tt> commands which are described in the [http://www.pragma-ade.com/general/manuals/cld-mkiv.pdf cld manual]. They are Lua functions which print to ConTeXt. With the <tt>list</tt> function, we start a ConTeXt table and typeset a first row with the meta information. The functions for <tt>item</tt> and <tt>model</tt> do nothing more than print the argument of the connected elements as table rows and the first table column. Things get a bit more interesting for the <tt>price</tt> function: this is where we use the power of Lua to do some easy calculations and convert the Euros to other currencies. First, we extract the content of the <xmlcodett><price></tt> element. We need to tell Lua that this content is not a string, but a number, hence the use of the <tt>tonumber</tt> function. As you can see, the equivalent of <pre>\xmltext{#1}{./}</pre> in Lua is <pre>xml.text(t, "./")</xmlcodepre>.
gardener
111

edits

Navigation menu