![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 3/5/2013 10:59 AM, Procházka Lukáš Ing. - Pontex s. r. o. wrote:
Hello,
which XML processing Lua engine is used by ConTeXt?
There are more XML processors developed for Lua - LuaXML, LuaExpat etc.
Does ConTeXt use one of these or another, or its own - a built-in one?
Its own (1) because there was none and (2) because we want full control over the two-way interface.
As I'm processing XML tables with pure Lua, too, I'd like to use only one engine in pure Lua scripts and within ConTeXt; I believe it could be possible.
Just use the one that is built in context mkiv. You can load the xml parser code in regular Lua code that you write. Here is the most recent list of reasonable defaults: "l-lua.lua", "l-lpeg.lua", "l-function.lua", "l-string.lua", "l-table.lua", "l-io.lua", "l-number.lua", "l-set.lua", "l-os.lua", "l-file.lua", -- limited functionality when no lfs "l-md5.lua", -- not loaded when no md5 library "l-url.lua", "l-dir.lua", -- limited functionality when no lfs "l-boolean.lua", "l-unicode.lua", "l-math.lua", "util-tab.lua", "util-sto.lua", "util-str.lua", "util-mrg.lua", "util-prs.lua", "trac-inf.lua", "trac-set.lua", "trac-log.lua", "util-tpl.lua", "util-env.lua", "lxml-tab.lua", "lxml-lpt.lua", "lxml-mis.lua", "lxml-aux.lua", "lxml-xml.lua", If you cannot use mtxrun --script <yourscript> for some reason, you can load these files explicitly. In one of the upcoming betas I'll add a script that I use for some months now that permits you to build a merged lib out of these (and more) that then can be includes with one require call (and put alongside whatever code you use). The advantage is that you then have a sort of snapshot. (I use that approach in for instance web services.) Think of: lua mtxlibs.lua --selfmerge my-used-libs.lua trac-lmx util-jsn util-sql util-sql-imp-client util-sql-imp-library util-sql-sessions util-sql-tickets util-sql-loggers util-sql-users util-sql-logins This produces my-used-libs.lua which on top of the list above adds some more to it. You then only need to require this one lib and can avoid dependencies, path mess, etc. 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 -----------------------------------------------------------------