From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: XML Lua engine in ConTeXt
Date: Tue, 05 Mar 2013 11:54:42 +0100 [thread overview]
Message-ID: <5135CEF2.6070909@wxs.nl> (raw)
In-Reply-To: <op.wtgwpeygtpjj8f@lpr>
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
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2013-03-05 10:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 9:59 Procházka Lukáš Ing. - Pontex s. r. o.
2013-03-05 10:38 ` Thomas A. Schmitz
2013-03-05 10:54 ` Hans Hagen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5135CEF2.6070909@wxs.nl \
--to=pragma@wxs.nl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).