%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
