\XMLname{div}{\DIV}
\XMLname{figure}{\FIGURE}
\XMLname{label}{\LABEL}
\XMLname{P}{\PARA}
\XMLname{list}{\LIST}
\XMLname{table}{\TABLE}
\XMLstring\type@equation<>equation</>
\XMLstring\type@display<>display</>
\XMLstring\type@subeqn<>subeqn</>
\XMLstring\rend@slide<>slide</>
\XMLstring\rend@box<>box</>
\XMLstring\rend@pausing<>pausing</>

\XMLelement{TEI.2}{}
  { 
\documentclass{article}
\newenvironment{teislide}{}{}
\usepackage[bookmarks=false,pdftex]{hyperref}
\usepackage[gray,panelleft,screen]{pdfscreen}
\usepackage{teixmlslides}
\hypersetup{pdfpagemode=FullScreen}
\pagestyle{title}
\color{section0}
\def\capfont{\@setfontsize\capfont{24}{26}\sffamily\color{white}}
\def\titlefont{\@setfontsize\titlefont{30}{34}\color{dm}\sffamily\bfseries}
 }
{}

\XMLelement{body}{}
{
 \begin{document}
% \urlid{www.oucs.ox.ac.uk/}
% \affname{Oxford University Computing Services}
% \emblema{summer4.jpg}
 \vbox to .8\paperheight{\vfill
 \begin{center}
 \Huge                 
 \@title\\[30pt]             
 \@author\\
 \@date
 \end{center}            
\vfill}
 \raggedright    
}
 {\end{document}}

\newcount\SCOUNT
\global\SCOUNT-1\relax
\XMLelement{div}{
 \XMLattribute{id}{\idval}{\@nil}
 \XMLattribute{rend}{\divrend}{plain}
 }
 {
  \advance\SCOUNT\@ne
  \ifx\divrend\rend@slide
     \begin{teislide}
  \else
     \ifnum\SCOUNT=0\clearpage\fi
  \fi  
 }
 {\ifx\divrend\rend@slide
      \end{teislide}
  \fi
 }

\XMLelement{head}{  }
  {\xmlgrab}
  {
  \ifx\XML@parent\DIV
   \protected@xdef\temp{
     \expandafter\noexpand\ifcase\SCOUNT
     \section\or\subsection\or\subsubsection\fi
     {#1}\ifx\idval\@nnil\else\noexpand\label{\idval}
   \fi}
   \aftergroup\temp
   \else
     \ifx\XML@parent\TABLE\caption{#1}\fi
     \ifx\XML@parent\FIGURE\caption{#1}\fi
   \fi

}


\XMLelement{term}{}
 {\itshape}
 {}

\XMLelement{emph}{}
 {\itshape}
 {}

\XMLelement{formula}
 {\XMLattribute{type}{\Formulatype}{}}
 {
  \ifx\Formulatype\type@display
   \begin{displaymath}
  \else
    \ifx\Formulatype\type@equation
       \begin{equation}
    \else
       \ifx\Formulatype\type@subeqn
          \(
       \else
          \(
       \fi
    \fi
  \fi
  }
 {  \ifx\Formulatype\type@display
   \end{displaymath}
  \else
    \ifx\Formulatype\type@equation
       \end{equation}
    \else
       \ifx\Formulatype\type@subeqn
          \)
       \else
          \)
       \fi
    \fi
  \fi
}

\XMLelement{figure}
 {\XMLattribute{id}{\figid}{}
  \XMLattribute{file}{\figfile}{}
  \XMLattribute{width}{\figwidth}{}
  \XMLattribute{height}{\figheight}{}
  }
 {
  \ifx\figwidth\@empty\else\setkeys{Gin}{width=\figwidth}\fi
  \ifx\figheight\@empty\else\setkeys{Gin}{height=\figheight}\fi
  \ifx\XML@parent\PARA
    \centerline{\includegraphics{\figfile}}
  \else
    \includegraphics{\figfile}
  \fi
  }
 {}

\XMLelement{code}{}
 {\color{black}\ttfamily}
 {}

\XMLelement{hi}{}
 {\bfseries}
 {}

\XMLelement{gi}{}
 {\ttfamily\textless}
 {\textgreater}

\XMLelement{eg}{}
 {\xmlgrab}
 {\@tempdima\linewidth
  \advance\@tempdima by -1cm
  \fboxrule1pt
  \fboxsep4pt
  \vskip6pt
  \fcolorbox{egframe}{egback}{\begin{minipage}{\@tempdima}
  \color{black}\small\ttfamily\obeylines\obeyspaces
  #1\end{minipage}}\vskip6pt}

\XMLelement{p}
 {\XMLattribute{rend}{\Prend}{}}
 {\xmlgrab}
 {
  \ifx\Prend\rend@box
   \@tempdima\linewidth
   \advance\@tempdima by -1cm
   \fboxrule1pt
   \fboxsep4pt
   \vskip6pt
   \fcolorbox{egframe}{boxback}{\begin{minipage}{\@tempdima}
   \color{black}#1\end{minipage}}\vskip6pt
  \else
    \par#1
  \fi
}

\XMLelement{revisionDesc}{}
 {\xmlgrab}
 {}

\XMLelement{fileDesc}{}
 {\xmlgrab}
 {}

\XMLelement{titleStmt}{}
 {\xmlgrab}
 {}

\XMLelement{xptr}
 {
   \XMLattribute{doc}{\xptrdoc}{}
   \XMLattribute{url}{\xptrurl}{}
 }
 {
 \ifx\@empty\xptrurl
   \NDATAEntity\xptrdoc\@gobble\url
 \else
   \url{\xptrurl}
 \fi
 }
 {}

\XMLelement{xref}
 {
   \XMLattribute{doc}{\xptrdoc}{}
   \XMLattribute{url}{\xptrurl}{}
 }
 {\xmlgrab}
 {
 \ifx\@empty\xptrurl
   \NDATAEntity\xptrdoc\@gobble\url
 \else
   \href{\xptrurl}{#1}
 \fi
 }
 

\XMLelement{docDate}{}
 {\xmlgrab}
 {\date{#1}}

\XMLelement{docAuthor}{}
 {\xmlgrab}
 {\author{#1}}

\XMLelement{docTitle}{}
 {\xmlgrab}
 {\title{#1}}

\XMLelement{item}
 {}
 {\csname Item\listtype\endcsname}
 {\endItem}

\XMLelement{label}
 {}
 {\xmlgrab}
 {\gdef\foo{\item[#1]}\aftergroup\foo}

\XMLelement{list}{
 \XMLattribute{type}{\listtype}{unordered}
 \XMLattribute{rend}{\listrend}{plain}
}
 {\csname List\listtype\endcsname}
 {\csname endList\listtype\endcsname}


\XMLelement{q}{
 \XMLattribute{rend}{\qrend}{}}
 {\xmlgrab}
 {  \ifx\qrend\type@display
    \begin{quote}
     \ifthenelse{\equal{\qrend}{eg}}{\color{black}\ttfamily\obeylines}#1\end{quote}
 \else
  `#1'
 \fi
}

\XMLelement{ptr}
 {\XMLattribute{target}{\ptrtarget}{}}
 {\href{\ptrtarget}{\ref{\ptrtarget}}}
 {}

\XMLelement{ref}
 {\XMLattribute{target}{\reftarget}{}}
 {\xmlgrab}
 {\href{\reftarget}{#1}}


\XMLelement{table}
 {
  \XMLattribute{tex}{\tableheader}{*{99}{l}}
  \XMLattribute{rend}{\tablerend}{}
 }
 {\begingroup
\utfeight@protect@chars\xdef\temp{\tableheader}%
\endgroup
\expandafter\doTable\temp\\}
 {\end{tabular}}

\XMLelement{row}{}
 {\xmlgrab}
 {\gdef\temp{#1\\}\aftergroup\temp}

\XMLelement{cell}{}
 {\xmlgrab}
 {\gdef\temp{#1\tabcellsep}\aftergroup\temp}

\XMLelement{lb}{}{\gdef\temp{\\}\aftergroup\temp}{}


% cheating, a bit
\XMLentity{TeX}{\TeX}
\XMLentity{LaTeX}{\LaTeX}
