lxml-ctx.mkiv /size: 1330 b    last modification: 2021-10-28 13:50
1%D \module
2%D   [       file=lxml-ctx,
3%D        version=2007.08.17,
4%D          title=\CONTEXT\ \XML\ Support,
5%D       subtitle=Initialization,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14%D Experimental. This might change! Also, it might become a module instead if
15%D core code.
16
17\writestatus{loading}{ConTeXt XML Support / Goodies}
18
19\registerctxluafile{lxml-ctx}{}
20
21\unprotect
22
23\settrue \xmllshowbuffertoo
24\setfalse\xmllshowtitletoo
25\settrue \xmllshowwarningtoo
26
27\definehead
28  [lshowtitle]
29  [subsubsubsubsubject]
30
31\setuphead
32  [lshowtitle]
33  [\c!style=\tta]
34
35\unexpanded\def\xmllshow#1%
36  {\ctxlua{xml.ctx.tshow {
37        pattern = \!!bs\detokenize{#1}\!!es,
38    \ifconditional\xmllshowtitletoo
39        title = "lshowtitle",
40    \fi
41    \ifconditional\xmllshowwarningtoo
42        warning = true,
43    \fi
44    } }}
45
46\unexpanded\def\xmllshowbuffer#1#2#3%
47  {\ctxlua{xml.ctx.tshow {
48        pattern = \!!bs\detokenize{#2}\!!es,
49    \ifconditional\xmllshowbuffertoo
50        xmlroot   = "#1",
51        attribute = "#3",
52    \fi
53    \ifconditional\xmllshowwarningtoo
54        warning = true,
55    \fi
56     } }}
57
58\protect
59