blob: bf527a7478073a2bb2e1aa7498e066b63608a9a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
% interface=en
\defineXMLargument
[title] [label=]
{\title[\XMLop{label}]}
\defineXMLenvironment
[itemize] [packed=]
{\doifelseXMLop{packed}{yes}
{\startitemize[packed]}
{\startitemize}}
{\stopitemize}
\defineXMLenvironment
[item]
{\item}
{\par}
\defineXMLenvironment
[p]
{\ignorespaces}
{\par}
\starttext
\startXMLdata
<title label="example">Just an Example</title>
<p>There are three items:</p>
<itemize packed="yes">
<item>Number One</item>
<item>Number Two</item>
<item>Number Three</item>
</itemize>
<p>And tree more</p>
<itemize>
<item>First Line</item>
<item>Second Line</item>
<item>Third Line</item>
</itemize>
\stopXMLdata
Instead of putting the data in here you can put it in a file, say
\type {sample.xml} and load that file using:
\starttyping
\processXMLfilegrouped{sample.xml}
\stoptyping
\stoptext
|