lxml-ctx.mkiv /size: 1309 b    last modification: 2020-07-01 14:35
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
15
%D instead if core code.
16 17
\writestatus
{
loading
}{
ConTeXt
XML
Support
/
Goodies
}
18 19
\registerctxluafile
{
lxml
-
ctx
}{}
20 21
\unprotect
22 23
\settrue
\xmllshowbuffer
24
\setfalse
\xmllshowtitle
25
\settrue
\xmllshowwarning
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
\xmllshowtitle
39
title
=
"
lshowtitle
"
,
40
\fi
41
\ifconditional
\xmllshowwarning
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
\xmllshowbuffer
50
xmlroot
=
"
#1
"
,
51
attribute
=
"
#3
"
,
52
\fi
53
\ifconditional
\xmllshowwarning
54
warning
=
true
,
55
\fi
56
}
}
}
57 58
\protect
59