From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: processing lua table in xml...
Date: Tue, 29 Dec 2015 10:14:19 +0100 [thread overview]
Message-ID: <56824EEB.6070400@uni-bonn.de> (raw)
Dear all,
I had asked a similar question some time ago and had received a reply
from Hans (http://article.gmane.org/gmane.comp.tex.context/81049), but
the method there doesn't work in this case. Working example difficult,
hence code snippets, I'm afraid.
I process file A.xml. I pull in stuff from file B.xml and store the
result as a lua table:
for e in xml.collected(xml.load('B.xml'), 'a') do
for d in xml.collected(lxml.id(e), 'b') do
local sortword = xml.attribute(b, "/", "xml:id", "0")
local entryword = xml.text(b, "entry")
local translation = xml.first(b, "translation")
mytable[sortword] = { }
mytable[sortword]["ew"] = entryword
mytable[sortword]["tr"] = translation
end
end
so the table contains the xml. The "translation" part contains further
nested xml elements. Later, when processing A.xml, I want to retrieve
this stored xml and have it processed:
local checkword = xml.text(t, "c")
local translation = mytable[checkword]["tr"]
but whatever I try:
lxml.flush(lxml.id(translation))
or
xml.cprint(voktable[myword]["tr"])
or
xml.cprint(translation)
I always get the serialized xml typeset, but not processed. So: how can
I get context to process the xml that is stored in the table?
All best
Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________
next reply other threads:[~2015-12-29 9:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-29 9:14 Thomas A. Schmitz [this message]
2015-12-29 10:09 ` Hans Hagen
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=56824EEB.6070400@uni-bonn.de \
--to=thomas.schmitz@uni-bonn.de \
--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).