diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-22 22:14:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-22 22:14:39 +0000 |
commit | fc4466b32ed330a956ac603b00fd145524cff49a (patch) | |
tree | 2c50e2b8de13aa9233b2c76dffe201558f169e86 /Master/texmf-dist/tex/context/modules/mkii/x-xml-11.mkii | |
parent | 50e2368597d5f6fe2057195d0ae6a9f2044923e4 (diff) |
context (22apr16)
git-svn-id: svn://tug.org/texlive/trunk@40691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/modules/mkii/x-xml-11.mkii')
-rw-r--r-- | Master/texmf-dist/tex/context/modules/mkii/x-xml-11.mkii | 134 |
1 files changed, 134 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/modules/mkii/x-xml-11.mkii b/Master/texmf-dist/tex/context/modules/mkii/x-xml-11.mkii new file mode 100644 index 00000000000..047561370e9 --- /dev/null +++ b/Master/texmf-dist/tex/context/modules/mkii/x-xml-11.mkii @@ -0,0 +1,134 @@ +%D \module +%D [ file=x-xml-11, +%D version=2004.09.16, +%D title=\CONTEXT\ XML Style File, +%D subtitle=Formatting X?? files, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% xmltools --analyze yourfile.xml +% texexec --use=xml-analyze yourfile.* + +% \doifnothing {\inputfilename} {\end} +% \doiffileelse {\inputfilename} {} {\end} + +\doifnothing {\jobfullname} {\end} +\doiffileelse {\jobfullname} {} {\end} + +\useXMLfilter[ent] +\useXMLfilter[utf] + +\chardef\XMLtokensreduction\plustwo + +\definehead + [SomeElement] + [subsection] + +\setuphead + [SomeElement] + [ownnumber=yes, + style=\tfb, + numberstyle=\tfxx, + alternative=margin] + +\setuplayout + [width=middle, + height=middle, + backspace=2cm, + cutspace=1cm, + topspace=1cm, + header=0pt] + +\setupfootertexts + [\jobfullname] % [\inputfilename] + +\usetypescript[modern][texnansi] \setupbodyfont[modern,tt,10pt] + +\defineXMLenvironment + [document] + {} + {} + +\defineXMLpickup + [entities][n=0] + {\expanded{\SomeElement{\XMLop{n}}{Entities}} + \starttabulate[|l|l|l|]} + {\stoptabulate} + +\defineXMLcommand % ugly hack (make macro of it) + [entity][name=,n=0] + {\startexpanded + \noexpand \NC \XMLop{name} + \noexpand \NC \XMLop{n} + \noexpand \NC \noexpand\doXMLentity\XMLop{name}; + \noexpand \NC + \noexpand \NR + \stopexpanded} + +\defineXMLpickup + [characters][n=0] + {\expanded{\SomeElement{\XMLop{n}}{Characters}} + \bgroup + \let\nonbreakablespace\empty % messes up the table + \starttabulate[|l|r|r|l|l|l|l|]} + {\stoptabulate + \egroup} + +% todo: narrowtt + +\defineXMLcommand + [character][number=,utf=,n=0,uname=,pname=,cname=] + {\startexpanded + \noexpand \NC \noexpand \unicodehexnumber{\XMLop{number}} + \noexpand \NC \XMLop{number} + \noexpand \NC \XMLop{n} + \noexpand \NC \noexpand \unicodechar {\XMLop{number}} + \noexpand \NC \tx \lowercase\expandafter{\XMLop{uname}} + \noexpand \NC \tx \noexpand \unicodepair {\XMLop{number}} + \noexpand \NC \tx \XMLop{cname} + \noexpand \NC + \noexpand \NR + \stopexpanded} + +\defineXMLenvironment + [elements] + {} + {} + +\newtoks \TabulateToks + +\defineXMLpickup + [element][name=,n=0] + {\expanded{\SomeElement{\XMLop{n}}{\XMLop{name}}} + \TabulateToks\emptytoks} + {\starttabulate[|l|r|p|] + \the\TabulateToks + \stoptabulate} + +\defineXMLenvironment + [attribute][name=] + {\xdef\AttributeName{\XMLop{name}}} + {} + +\defineXMLenvironment + [instance][value=,n=0] + {\appendetoks + \noexpand \NC \AttributeName + \noexpand \NC \XMLop{n} + \noexpand \NC \XMLop{value} + \noexpand \NC + \noexpand \NR + \to \TabulateToks} + {\xdef\AttributeName{}} + +\starttext + +% \processXMLfilegrouped{\inputfilename} +\processXMLfilegrouped{\jobfullname} + +\stoptext |