[NTG-context] TEI to context XML mappings?

Hans Hagen pragma at wxs.nl
Wed Feb 24 15:51:42 CET 2016

On 2/24/2016 3:32 PM, Thomas A. Schmitz wrote:
> On 02/24/2016 03:15 PM, Hans Hagen wrote:
>> if you need more info i can add it ... one can then generate whatever
>> table one wants
>> elements in element .. one level i assume?
> Yes, one level, otherwise things become too complex. And you're right,
> it's already there in the "children" element. My question was not so
> much about the information but about the visualization. Let's put it in
> a slightly different way: the context parser holds the information about
> my xml tree as a lua table, right? It would be handy to have a typeset
> version of this table, as a, well, table, so we could see how to access
> the different parts of it in lua and/or tex code. So I know that my
> element is e, I know that it has a table e.at that collects the
> different attributes in subtables of the form e.at["attribute"]. I
> assume there's also e.text, e.first etc. Would it be possible to typeset
> this information for elements.

no, there are no such fields


     local t = xml.load("t:/sources/i-en-xml.xml")
     print(table.serialize(t,true,{})) -- you need to call this way


at : attributes
ns : namespace
rn : remapped namespace
tg : tag (@..@ names indicate special tags)
dt : text

text is a table of strings and elements

(there are a few extra private fields and when applying searched there 
are index fields added)


                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl

More information about the ntg-context mailing list