summaryrefslogtreecommitdiff
path: root/tex/context/base/x-xml-02.tex
blob: 24f811c4dad3d566b86e6f8f204bdbb30ec6e729 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
%D \module
%D   [      file=x-xml-02,
%D        version=2001.10.10,
%D          title=\CONTEXT\ XML Style File,
%D       subtitle=Pretty Printing,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA / Hans Hagen \& Ton Otten}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% texexec --use=xml-pretty yourfile.x** [--mode=letter]

\doifnothing  {\inputfilename}    {\end}
\doiffileelse {\inputfilename} {} {\end}

\startmode[letter]
  \setuppapersize[letter][letter]
\stopmode

\setuplayout
  [backspace=1.5cm,
   topspace=1.5cm,
   bottomspace=1cm,
   width=middle,
   height=middle,
   header=1.5cm,
   footer=1.5cm]

\setupcolors
  [state=local]

\setuppagenumbering
  [location=]

\setuplayout
  [style=type]

\setupbodyfont
  [10pt,tt]

\setuptolerance
  [verytolerant]

\setupalign
  [broad,right]

\lowercasestring\inputfilename   \to \lcinputfilename
\defconvertedcommand\lcinputfilename\lcinputfilename % make _ safe

\setupheadertexts
  [\lcinputfilename]

\setupfootertexts
  [\currentdate\space\string| \currenttime\space \string| \pagenumber]

% let's have a look at the type of content:

\setupXMLfile
  [level=2]

\startmode[*suffix-xml]
  % ok
\stopmode

\startmode[*suffix-rng]
  \showXMLlin[value]
\stopmode

\startmode[*suffix-rlg]
  \showXMLlin
    [rl:type,rl:state,rl:name,rl:suffix,rl:label,rl:file,rl:original,
     rl:width,rl:height,rl:base,rl:page]
\stopmode

\startmode[*suffix-exa]
  \showXMLlin
    [exa:resolve,exa:include]
\stopmode

\def\XMLbannerprocessor#1{\string<\string ?xml #1\string ?\string>\endgraf}

\defineXMLprocessor [xml] {\XMLbannerprocessor}

\starttext

\showXMLfile{\inputfilename}

\stoptext