summaryrefslogtreecommitdiff
path: root/tex/context/base/x-xml-02.mkii
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/x-xml-02.mkii')
-rw-r--r--tex/context/base/x-xml-02.mkii91
1 files changed, 91 insertions, 0 deletions
diff --git a/tex/context/base/x-xml-02.mkii b/tex/context/base/x-xml-02.mkii
new file mode 100644
index 000000000..24f811c4d
--- /dev/null
+++ b/tex/context/base/x-xml-02.mkii
@@ -0,0 +1,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