From 736de6a312c37fbb8cea65cf0a86eda7dbbe0575 Mon Sep 17 00:00:00 2001
From: Hans Hagen
Date: Fri, 11 Jan 2002 00:00:00 +0100
Subject: stable 2002.01.11
---
context/config/texexec.rme | 6 +-
context/data/cont-cz.tws | 56 +-
context/data/cont-de.tws | 44 +-
context/data/cont-en.tws | 44 +-
context/data/cont-it.tws | 52 +-
context/data/cont-nl.tws | 44 +-
context/data/cont-ro.tws | 56 +-
context/data/type-buy.dat | 11 +-
context/data/type-tmf.dat | 8 +-
context/perltk/fdf2tan.pl | 3 +
context/perltk/fdf2tex.pl | 213 +++
context/perltk/mptopdf.pl | 52 +-
context/perltk/path_tre.pm | 36 +
context/perltk/runperl.zip | Bin 1451 -> 1698 bytes
context/perltk/texexec.pl | 145 +-
context/perltk/texexec.rme | 6 +-
context/perltk/texfind.pl | 270 +++
context/perltk/texfont.pl | 90 +-
context/perltk/texutil.pl | 129 +-
doc/context/base/minstall.pdf | Bin 95067 -> 95511 bytes
doc/context/base/mreadme.pdf | Bin 70679 -> 71045 bytes
metapost/context/metafun.mp | 4 +
metapost/context/mp-char.mp | 105 +-
metapost/context/mp-form.mp | 378 ++++
metapost/context/mp-func.mp | 59 +
metapost/context/mp-grid.mp | 129 ++
metapost/context/mp-grph.mp | 167 +-
metapost/context/mp-page.mp | 22 +-
metapost/context/mp-shap.mp | 22 +-
metapost/context/mp-spec.mp | 217 ++-
metapost/context/mp-text.mp | 62 +-
metapost/context/mp-tool.mp | 456 +++--
pdftex/config/context/il2-ams-cmr.map | 56 +
pdftex/config/context/original-adobe-euro.map | 25 +
pdftex/config/context/original-ams-cmr.map | 122 ++
pdftex/config/context/original-ams-euler.map | 19 +
pdftex/config/context/original-ams-logo.map | 8 +
pdftex/config/context/original-context-symbol.map | 1 +
pdftex/config/context/original-vogel-symbol.map | 1 +
pdftex/config/context/original-youngryu-px.map | 47 +
pdftex/config/context/original-youngryu-tx.map | 86 +
pdftex/config/context/pl0-ams-cmr.map | 77 +
pdftex/config/ec-youngryu-px.map | 47 -
pdftex/config/ec-youngryu-tx.map | 86 -
pdftex/config/il2-ams-cmr.map | 56 -
pdftex/config/original-adobe-euro.map | 25 -
pdftex/config/original-ams-cmr.map | 122 --
pdftex/config/original-ams-euler.map | 19 -
pdftex/config/original-bh-lucida.map | 49 -
pdftex/config/original-context-symbol.map | 1 -
pdftex/config/original-micropress-informal.map | 7 -
pdftex/config/pl0-ams-cmr.map | 77 -
tex/context/base/colo-ini.tex | 855 +++++----
tex/context/base/colo-rgb.tex | 29 +-
tex/context/base/cont-fil.tex | 8 +
tex/context/base/cont-log.tex | 14 +-
tex/context/base/cont-new.tex | 403 ++---
tex/context/base/cont-sys.ori | 4 +-
tex/context/base/cont-usr.ori | 18 +-
tex/context/base/context.tex | 34 +-
tex/context/base/core-buf.tex | 109 +-
tex/context/base/core-con.tex | 153 +-
tex/context/base/core-dat.tex | 38 +-
tex/context/base/core-des.tex | 46 +-
tex/context/base/core-fig.tex | 265 +--
tex/context/base/core-fil.tex | 115 +-
tex/context/base/core-fld.tex | 65 +-
tex/context/base/core-fnt.tex | 85 +-
tex/context/base/core-gen.tex | 60 +-
tex/context/base/core-grd.tex | 73 +-
tex/context/base/core-hlp.tex | 18 +-
tex/context/base/core-int.tex | 914 ++++++----
tex/context/base/core-itm.tex | 1057 ++++++-----
tex/context/base/core-job.tex | 22 +-
tex/context/base/core-lst.tex | 129 +-
tex/context/base/core-mak.tex | 2 +-
tex/context/base/core-mar.tex | 144 +-
tex/context/base/core-mat.tex | 42 +-
tex/context/base/core-mis.tex | 77 +-
tex/context/base/core-nav.tex | 62 +-
tex/context/base/core-new.tex | 360 ++--
tex/context/base/core-not.tex | 251 ++-
tex/context/base/core-ntb.tex | 180 +-
tex/context/base/core-num.tex | 91 +-
tex/context/base/core-obj.tex | 235 +--
tex/context/base/core-par.tex | 4 +
tex/context/base/core-pos.tex | 226 ++-
tex/context/base/core-ref.tex | 1617 ++++++++++-------
tex/context/base/core-reg.tex | 314 +++-
tex/context/base/core-rul.tex | 469 +++--
tex/context/base/core-sec.tex | 871 +++++----
tex/context/base/core-spa.tex | 1323 +++++++++-----
tex/context/base/core-syn.tex | 46 +-
tex/context/base/core-sys.tex | 101 +-
tex/context/base/core-tab.tex | 99 +-
tex/context/base/core-tbl.tex | 200 ++-
tex/context/base/core-uti.tex | 109 +-
tex/context/base/core-var.tex | 55 +-
tex/context/base/core-ver.tex | 92 +-
tex/context/base/core-vis.tex | 76 +-
tex/context/base/enco-ans.tex | 26 +-
tex/context/base/enco-com.tex | 1 -
tex/context/base/enco-def.tex | 12 +
tex/context/base/enco-fde.tex | 2 +
tex/context/base/enco-fpl.tex | 2 +
tex/context/base/enco-ini.tex | 110 +-
tex/context/base/enco-pfr.tex | 91 +-
tex/context/base/enco-tbo.tex | 5 +-
tex/context/base/font-ini.tex | 1090 +++++++-----
tex/context/base/font-run.tex | 10 +-
tex/context/base/hand-ini.tex | 123 +-
tex/context/base/java-fld.tex | 9 +-
tex/context/base/java-ini.tex | 14 +-
tex/context/base/lang-alt.tex | 30 +-
tex/context/base/lang-ger.tex | 35 +-
tex/context/base/lang-ini.tex | 496 ++++--
tex/context/base/lang-ita.tex | 2 +
tex/context/base/lang-lab.tex | 186 +-
tex/context/base/lang-sla.tex | 2 +
tex/context/base/lang-ura.tex | 2 +
tex/context/base/m-chart.tex | 57 +-
tex/context/base/m-mathml.tex | 46 -
tex/context/base/m-pstric.tex | 14 +-
tex/context/base/m-quest.tex | 8 +-
tex/context/base/m-steps.tex | 5 +-
tex/context/base/m-units.tex | 66 +-
tex/context/base/math-ini.tex | 48 +-
tex/context/base/math-pln.tex | 336 ++++
tex/context/base/math-tex.tex | 19 +
tex/context/base/meta-fig.tex | 57 +-
tex/context/base/meta-ini.tex | 261 ++-
tex/context/base/meta-pag.tex | 111 +-
tex/context/base/meta-txt.tex | 62 +-
tex/context/base/mult-com.tex | 49 +-
tex/context/base/mult-con.tex | 27 +-
tex/context/base/mult-ini.tex | 106 +-
tex/context/base/mult-sys.tex | 18 +-
tex/context/base/page-bck.tex | 138 +-
tex/context/base/page-flt.tex | 585 ++++---
tex/context/base/page-imp.tex | 867 ++++-----
tex/context/base/page-ini.tex | 284 ++-
tex/context/base/page-lay.tex | 363 ++--
tex/context/base/page-lin.tex | 5 +-
tex/context/base/page-log.tex | 8 +-
tex/context/base/page-lyr.tex | 161 +-
tex/context/base/page-mak.tex | 28 +-
tex/context/base/page-mar.tex | 31 +-
tex/context/base/page-mul.tex | 41 +-
tex/context/base/page-num.tex | 206 ++-
tex/context/base/page-one.tex | 135 +-
tex/context/base/page-run.tex | 92 +-
tex/context/base/page-set.tex | 563 ++++--
tex/context/base/page-sid.tex | 175 +-
tex/context/base/page-txt.tex | 65 +-
tex/context/base/ppchtex.tex | 312 ++--
tex/context/base/s-abr-01.tex | 2 +
tex/context/base/s-faq-01.tex | 31 +-
tex/context/base/s-faq-02.tex | 17 +-
tex/context/base/s-faq-03.tex | 40 +-
tex/context/base/s-mod-00.tex | 247 ++-
tex/context/base/s-mod-01.tex | 30 +-
tex/context/base/s-pre-19.tex | 3 -
tex/context/base/setupa.tex | 335 ++--
tex/context/base/setupb.tex | 111 +-
tex/context/base/setupd.tex | 6 +-
tex/context/base/setupe.tex | 310 ++++
tex/context/base/spec-def.tex | 893 ++++++++++
tex/context/base/spec-dpm.tex | 82 +-
tex/context/base/spec-dvi.tex | 16 +-
tex/context/base/spec-fdf.tex | 420 +++--
tex/context/base/spec-ini.tex | 953 +---------
tex/context/base/spec-mis.tex | 12 +-
tex/context/base/spec-pdf.tex | 57 +-
tex/context/base/spec-ps.tex | 18 +-
tex/context/base/spec-tpd.tex | 205 ++-
tex/context/base/spec-tr.tex | 10 +-
tex/context/base/spec-win.tex | 23 +-
tex/context/base/spec-yy.tex | 4 +-
tex/context/base/supp-box.tex | 798 ++++-----
tex/context/base/supp-emp.tex | 4 +
tex/context/base/supp-eps.tex | 151 +-
tex/context/base/supp-fil.tex | 72 +-
tex/context/base/supp-fun.tex | 5 +
tex/context/base/supp-ini.tex | 48 +-
tex/context/base/supp-lan.tex | 140 +-
tex/context/base/supp-mat.tex | 5 +-
tex/context/base/supp-mis.tex | 21 +-
tex/context/base/supp-mpe.tex | 712 +++++---
tex/context/base/supp-mps.tex | 464 +++--
tex/context/base/supp-mrk.tex | 619 +++----
tex/context/base/supp-num.tex | 13 +-
tex/context/base/supp-pdf.tex | 556 +++---
tex/context/base/supp-ran.tex | 21 +-
tex/context/base/supp-vis.tex | 138 +-
tex/context/base/symb-ini.tex | 218 ++-
tex/context/base/symb-mvs.tex | 215 +++
tex/context/base/symb-nav.tex | 4 +-
tex/context/base/symb-run.tex | 53 +
tex/context/base/syst-eet.tex | 270 ---
tex/context/base/syst-etx.tex | 91 +-
tex/context/base/syst-ext.tex | 1364 ++++++++++----
tex/context/base/syst-gen.tex | 1544 ++++++++++------
tex/context/base/syst-new.tex | 200 ++-
tex/context/base/syst-pln.tex | 636 +++++++
tex/context/base/syst-prm.tex | 85 +
tex/context/base/syst-tex.tex | 30 +-
tex/context/base/type-buy.tex | 27 +-
tex/context/base/type-enc.tex | 183 +-
tex/context/base/type-exa.tex | 16 +-
tex/context/base/type-ini.tex | 205 ++-
tex/context/base/type-map.tex | 21 +-
tex/context/base/type-pre.tex | 32 +-
tex/context/base/type-syn.tex | 2 +-
tex/context/base/verb-ini.tex | 189 +-
tex/context/base/verb-raw.tex | 7 +
tex/context/base/x-chemml.tex | 212 +++
tex/context/base/x-contml.tex | 451 +++++
tex/context/base/x-fdf-00.tex | 40 +
tex/context/base/x-fig-00.tex | 12 +-
tex/context/base/x-fig-01.tex | 33 +-
tex/context/base/x-fig-02.tex | 10 +-
tex/context/base/x-mathml.tex | 48 +
tex/context/base/x-physml.tex | 16 +
tex/context/base/x-sch-00.tex | 382 ++++
tex/context/base/x-sch-01.tex | 122 ++
tex/context/base/x-xml-01.tex | 80 +
tex/context/base/x-xml-02.tex | 67 +
tex/context/base/xtag-cml.tex | 222 +++
tex/context/base/xtag-exp.tex | 81 +
tex/context/base/xtag-ext.tex | 115 +-
tex/context/base/xtag-ini.tex | 1949 +++++++++++++++------
tex/context/base/xtag-map.tex | 405 +++--
tex/context/base/xtag-meh.tex | 2 +-
tex/context/base/xtag-mmc.tex | 89 +-
tex/context/base/xtag-mml.tex | 65 +-
tex/context/base/xtag-mmp.tex | 14 +-
tex/context/base/xtag-pml.tex | 83 +
tex/context/base/xtag-pmu.tex | 188 ++
tex/context/base/xtag-pre.tex | 325 ++++
tex/context/base/xtag-run.tex | 233 ++-
tex/context/base/xtag-xsd.tex | 28 +
tex/context/config/cont-usr.tex | 18 +-
tex/context/extra/setup-qr.tex | 169 +-
tex/context/user/cont-sys.rme | 4 +-
tex/generic/context/mptopdf.tex | 2 +-
tex/generic/context/ppchtex.noc | 7 +-
246 files changed, 27610 insertions(+), 13820 deletions(-)
create mode 100644 context/perltk/fdf2tex.pl
create mode 100644 context/perltk/path_tre.pm
create mode 100644 context/perltk/texfind.pl
create mode 100644 metapost/context/mp-form.mp
create mode 100644 metapost/context/mp-func.mp
create mode 100644 metapost/context/mp-grid.mp
create mode 100644 pdftex/config/context/il2-ams-cmr.map
create mode 100644 pdftex/config/context/original-adobe-euro.map
create mode 100644 pdftex/config/context/original-ams-cmr.map
create mode 100644 pdftex/config/context/original-ams-euler.map
create mode 100644 pdftex/config/context/original-ams-logo.map
create mode 100644 pdftex/config/context/original-context-symbol.map
create mode 100644 pdftex/config/context/original-vogel-symbol.map
create mode 100644 pdftex/config/context/original-youngryu-px.map
create mode 100644 pdftex/config/context/original-youngryu-tx.map
create mode 100644 pdftex/config/context/pl0-ams-cmr.map
delete mode 100644 pdftex/config/ec-youngryu-px.map
delete mode 100644 pdftex/config/ec-youngryu-tx.map
delete mode 100644 pdftex/config/il2-ams-cmr.map
delete mode 100644 pdftex/config/original-adobe-euro.map
delete mode 100644 pdftex/config/original-ams-cmr.map
delete mode 100644 pdftex/config/original-ams-euler.map
delete mode 100644 pdftex/config/original-bh-lucida.map
delete mode 100644 pdftex/config/original-context-symbol.map
delete mode 100644 pdftex/config/original-micropress-informal.map
delete mode 100644 pdftex/config/pl0-ams-cmr.map
delete mode 100644 tex/context/base/m-mathml.tex
create mode 100644 tex/context/base/math-pln.tex
create mode 100644 tex/context/base/setupe.tex
create mode 100644 tex/context/base/spec-def.tex
create mode 100644 tex/context/base/symb-mvs.tex
create mode 100644 tex/context/base/symb-run.tex
delete mode 100644 tex/context/base/syst-eet.tex
create mode 100644 tex/context/base/syst-pln.tex
create mode 100644 tex/context/base/syst-prm.tex
create mode 100644 tex/context/base/verb-raw.tex
create mode 100644 tex/context/base/x-chemml.tex
create mode 100644 tex/context/base/x-contml.tex
create mode 100644 tex/context/base/x-fdf-00.tex
create mode 100644 tex/context/base/x-mathml.tex
create mode 100644 tex/context/base/x-physml.tex
create mode 100644 tex/context/base/x-sch-00.tex
create mode 100644 tex/context/base/x-sch-01.tex
create mode 100644 tex/context/base/x-xml-01.tex
create mode 100644 tex/context/base/x-xml-02.tex
create mode 100644 tex/context/base/xtag-cml.tex
create mode 100644 tex/context/base/xtag-exp.tex
create mode 100644 tex/context/base/xtag-pml.tex
create mode 100644 tex/context/base/xtag-pmu.tex
create mode 100644 tex/context/base/xtag-pre.tex
create mode 100644 tex/context/base/xtag-xsd.tex
diff --git a/context/config/texexec.rme b/context/config/texexec.rme
index 91a0adc92..30ecfedf0 100644
--- a/context/config/texexec.rme
+++ b/context/config/texexec.rme
@@ -51,7 +51,7 @@ set TeXShell to tetex
%
% Here are some general defaults. They can be overruled later.
-set UsedInterfaces to en nl de uk
+set UsedInterfaces to en nl metafun mptopdf
set UserInterface to en
set TeXExecutable to tex
@@ -89,7 +89,7 @@ for fptex set TeXPassString to -progname=context
for fptex set TeXBatchFlag to -int=batchmode
for fptex set MpToTeXExecutable to mpto
for fptex set MpVirginFlag to -ini
-for fptex set MpPassString to -progname=mpost
+for fptex set MpPassString to -progname=mpost
for fptex set MpBatchFlag to -int=batchmode
% MikTeX users probably have to set up some paths too.
@@ -100,7 +100,7 @@ for miktex set TeXPassString to --alias=context
for miktex set TeXBatchFlag to --interaction=batchmode
for miktex set MpToTeXExecutable to mptotex
for miktex set MpVirginFlag to --initialize
-for miktex set MpPassString to --alias=mpost
+for miktex set MpPassString to --alias=mpost
for miktex set MpBatchFlag to --interaction=batchmode
for miktex set TeXFormatFlag to --undump=
diff --git a/context/data/cont-cz.tws b/context/data/cont-cz.tws
index b667a8673..487f66256 100644
--- a/context/data/cont-cz.tws
+++ b/context/data/cont-cz.tws
@@ -20,6 +20,7 @@ stopsetup
startsetup
com:nastavjazyk:
typ:val/vars/:
+val:nl,fr,en,uk,de,es,cz,..:nl:
ivr:instalacejazyka::
stopsetup
@@ -214,10 +215,9 @@ stopsetup
startsetup
com:definujskupinubarev:
-typ:val/val/vals/:
+typ:val/val/trips/:
val:*jmeno::
val:rgb,cmyk,seda,s:rgb:
-val:trips/::
stopsetup
startsetup
@@ -260,7 +260,7 @@ stopsetup
startsetup
com:nastavtype:
-typ:var/:
+typ:vars/:
var:mezera:zap,vyp::
var:volba:sklonene,normalni,zadny::
var:pismeno:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz::
@@ -405,6 +405,7 @@ var:alternativa:a,b,c::
var:tloustkalinky:*dimenze::
var:offsetspodku:*dimenze::
var:offsetvrsku:*dimenze::
+var:barvalinky:*jmeno::
stopsetup
startsetup
@@ -993,7 +994,8 @@ stopsetup
startsetup
com:nivy:
-typ:arg/arg/:
+typ:val/arg/arg/:
+val:nizko::
val:*text::
val:*text::
stopsetup
@@ -1725,8 +1727,9 @@ var:zpusob:skrztext,skrz*sekce::
var:text:*text::
var:oddelovaccisla:*text::
var:oddelovactextu:*text::
-var:*sekce*cislo:ano,ne::
+var:*sekcecislo singular: jmeno v singularu:ano,ne::
var:oddelovac:*text::
+var:strut:ano,ne::
var:status:start,stop::
var:prikaz:*\prikaz#1::
stopsetup
@@ -1753,6 +1756,7 @@ stopsetup
startsetup
com:definujstartstop:
typ:val/vars/:
+val:*jmeno::
var:pred:*prikaz::
var:po:*prikaz::
var:pismeno:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz::
@@ -1780,6 +1784,7 @@ var:mezi:*prikaz::
var:zarovnani:vlevo,nastred,vpravo,ne::
var:konverze:cisla,pismena,Pismena,rimskecislice,Rimskecislice::
var:zpusob:skrztext,skrz*sekce::
+var:oddelovac:*text::
stopsetup
startsetup
@@ -1881,9 +1886,9 @@ stopsetup
startsetup
com:nastavodkazovani:
-typ:var/:
+typ:vars/:
var:status:start,stop::
-var:*sekce*cislo:ano,ne::
+var:*sekcecislo singular: jmeno v singularu:ano,ne::
var:prefix:+,-,*text::
var:interakce:popisek,text,vse,symbol::
var:sirka:*dimenze::
@@ -1980,7 +1985,7 @@ val:*jmeno::
var:status:start,stop::
var:alternativa:a,b,c,...,zadny,prikaz::
var:propojeni:zap,vyp::
-var:kriterium:*sekce,lokalne,predchozi,vse::
+var:kriterium:*sekce,lokalne,predchozi,aktualni,vse::
var:hranicestranky:*seznam::
var:pismeno:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz::
var:stylcisla:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz::
@@ -1998,9 +2003,9 @@ var:mezi:*prikaz::
var:vlevo:*text::
var:vpravo:*text::
var:popisek:ano,ne::
-var:prefix:ano,ne::
+var:prefix:ano,ne,zadny::
var:cislostranky:ano,ne::
-var:*sekce*cislo:ano,ne::
+var:*sekcecislo singular: jmeno v singularu:ano,ne::
var:zarovnejtitul:ano,ne::
var:marginalie:*dimenze::
var:sirka:*dimenze,prizpusobive::
@@ -2008,6 +2013,7 @@ var:vyska:*dimenze,prizpusobive,siroky::
var:hloubka:*dimenze,prizpusobive,siroky::
var:vzdalenost:*dimenze::
var:oddelovac:*text::
+var:predel:*text::
var:symbol:zadny,1,2,3,...::
var:expanzen:ano,ne,prikaz::
var:maxsirka:*dimenze::
@@ -2067,6 +2073,7 @@ var:odsadpristi:ano,ne::
var:alternativa:*jmeno::
var:mezerapred:*dimenze::
var:po:*dimenze::
+var:oddelovac:*text::
stopsetup
startsetup
@@ -2291,6 +2298,7 @@ var:alternativa:normalni,naokraji,nastred,text::
var:prikaz:*\prikaz#1#2::
var:ciselnyprikaz:*\prikaz#1::
var:textovyprikaz:*\prikaz#1::
+var:oddelovac:*text::
var:prefix:+,-,*text::
var:umistihlavicku:ano,ne::
var:zvysujicicislo:ano,ne,*soubor::
@@ -2420,14 +2428,14 @@ stopsetup
startsetup
com:definujrejstrik:
typ:val/val/:
-val:*jmeno v singularu::
+val:*\@@mssetupsingular ::
val:*jmeno v pluralu::
stopsetup
startsetup
com:nastavrejstrik:
typ:val/val/vars/:
-val:*jmeno v singularu::
+val:*\@@mssetupsingular ::
val:*jmeno::
var:n:*cislo::
var:rovnovaha:ano,ne::
@@ -2437,7 +2445,7 @@ var:stylstranky:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz::
var:styltextu:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz::
var:indikator:ano,ne::
var:propojeni:ano,ne::
-var:*sekce*cislo:ano,ne::
+var:*sekcecislo singular: jmeno v singularu:ano,ne::
var:kriterium:*sekce,lokalne,vse::
var:vzdalenost:*dimenze::
var:symbol:1,2,...,n,a,...,zadny::
@@ -2467,7 +2475,7 @@ stopsetup
startsetup
com:zapisdorejstriku:
typ:val/val/idxs/:
-val:*jmeno v singularu::
+val:*\@@mssetupsingular ::
val:*text::
val:*text::
stopsetup
@@ -2508,7 +2516,7 @@ stopsetup
startsetup
com:definujsynonyma:
typ:val/val/val/val/:
-val:*jmeno v singularu::
+val:*\@@mssetupsingular ::
val:*jmeno v pluralu::
val:*prikaz::
val:*prikaz::
@@ -2555,7 +2563,7 @@ stopsetup
startsetup
com:definujtrideni:
typ:val/val/val/:
-val:*jmeno v singularu::
+val:*\@@mssetupsingular ::
val:*jmeno v pluralu::
val:*prikaz::
stopsetup
@@ -2625,6 +2633,7 @@ var:statusupati:normalni,stop,start,prazdne,zadny,zadneznaceni::
var:statustextu:normalni,stop,start,prazdne,zadny,zadneznaceni::
var:statusvrsku:stop,start::
var:statusspodku:stop,start::
+var:pagestate:stop,start::
var:barva:*jmeno::
stopsetup
@@ -2642,7 +2651,7 @@ stopsetup
startsetup
com:aktualnidatum:
typ:vals/:
-val:den,mesic,vsedniden,rok, dd,mm,jj,yy,d,m,j,y,znacka:den,mesic,rok:
+ivl:datum::
stopsetup
startsetup
@@ -2651,7 +2660,7 @@ typ:vars/vals/:
var:d:*cislo::
var:m:*cislo::
var:y:*cislo::
-ivl:aktualnidatum::
+val:den,mesic,vsedniden,rok, dd,mm,jj,yy,d,m,j,y,znacka:den,mesic,rok:
stopsetup
startsetup
@@ -2928,7 +2937,7 @@ stopsetup
startsetup
com:definujplvouciobjekt:
typ:val/val/:
-val:*jmeno v singularu::
+val:*\@@mssetupsingular ::
val:*jmeno v pluralu::
stopsetup
@@ -3054,6 +3063,8 @@ typ:vars/:
var:pred:*prikaz::
var:po:*prikaz::
var:pismeno:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz::
+var:barva:*jmeno::
+var:misto:text,marginalie::
stopsetup
startsetup
@@ -3729,9 +3740,7 @@ stopsetup
startsetup
com:oznaceni:
-typ:poss/poss/vars/arg/:
-val:*cislo::
-val:*cislo::
+typ:pos/pos/vars/arg/:
val:*cislo::
val:*cislo::
ivr:nastavoramovani::
@@ -3873,7 +3882,6 @@ com:nastavpole:
typ:val/vals/vars/vars/vars/:
val:*jmeno::
val:popisek,horizontalne,vertikalne,ramecek::
-ivr:oramovani::
ivr:nastavvsechnapole::
stopsetup
@@ -3882,7 +3890,6 @@ com:nastavvsechnapole:
typ:vals/val/vars/vars/vars/:
val:*jmeno::
val:reset,popisek,horizontalne,vertikalne,ramecek::
-ivr:oramovani::
var:n:*cislo::
var:vzdalenost:*dimenze::
var:pred:*prikaz::
@@ -3903,6 +3910,7 @@ var:pocitat:*reference::
var:offsetpole:*dimenze::
var:barvarameckupole:*jmeno::
var:barvapozadipole:*jmeno::
+ivr:oramovani::
stopsetup
startsetup
diff --git a/context/data/cont-de.tws b/context/data/cont-de.tws
index 6475304ca..be43a9135 100644
--- a/context/data/cont-de.tws
+++ b/context/data/cont-de.tws
@@ -20,6 +20,7 @@ stopsetup
startsetup
com:stellespracheein:
typ:val/vars/:
+val:nl,fr,en,uk,de,es,cz,..:nl:
ivr:installieresprache::
stopsetup
@@ -214,10 +215,9 @@ stopsetup
startsetup
com:definierefarbengruppe:
-typ:val/val/vals/:
+typ:val/val/trips/:
val:*Name::
val:rgb,cmyk,grau,s:rgb:
-val:trips/::
stopsetup
startsetup
@@ -260,7 +260,7 @@ stopsetup
startsetup
com:stelletipein:
-typ:var/:
+typ:vars/:
var:spatium:an,aus::
var:option:geneigt,normal,kein::
var:stil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl::
@@ -405,6 +405,7 @@ var:alternative:a,b,c::
var:liniendicke:*Dimension::
var:untenoffset:*Dimension::
var:obenoffset:*Dimension::
+var:linienfarbe:*Name::
stopsetup
startsetup
@@ -993,7 +994,8 @@ stopsetup
startsetup
com:tiho:
-typ:arg/arg/:
+typ:val/arg/arg/:
+val:tief::
val:*Text::
val:*Text::
stopsetup
@@ -1725,8 +1727,9 @@ var:art:protext,pro*Abschnitt::
var:text:*Text::
var:nummernseperator:*Text::
var:textseparator:*Text::
-var:*Abschnitt*Nummer:ja,nein::
+var:*Abschnittnummer:ja,nein::
var:seperator:*Text::
+var:strut:ja,nein::
var:status:start,stop::
var:befehl:*\Befehl#1::
stopsetup
@@ -1753,6 +1756,7 @@ stopsetup
startsetup
com:definierestartstop:
typ:val/vars/:
+val:*Name::
var:vor:*Befehl::
var:nach:*Befehl::
var:stil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl::
@@ -1780,6 +1784,7 @@ var:zwischen:*Befehl::
var:ausrichtung:links,mittig,rechts,nein::
var:konversion:ziffern,buchstaben,Buchstaben,roemischezahlen,Roemischezahlen::
var:art:protext,pro*Abschnitt::
+var:seperator:*Text::
stopsetup
startsetup
@@ -1881,9 +1886,9 @@ stopsetup
startsetup
com:stellereferenzierenein:
-typ:var/:
+typ:vars/:
var:status:start,stop::
-var:*Abschnitt*Nummer:ja,nein::
+var:*Abschnittnummer:ja,nein::
var:prefix:+,-,*Text::
var:interaktion:label,text,alles,symbol::
var:breite:*Dimension::
@@ -1980,7 +1985,7 @@ val:*Name::
var:status:start,stop::
var:alternative:a,b,c,...,kein,befehl::
var:verknuepfung:an,aus::
-var:kriterium:*Abschnitt,lokal,vorig,alles::
+var:kriterium:*Abschnitt,lokal,vorig,aktuell,alles::
var:seitenbegrenzung:*Liste::
var:stil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl::
var:nummernstil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl::
@@ -1998,9 +2003,9 @@ var:zwischen:*Befehl::
var:links:*Text::
var:rechts:*Text::
var:label:ja,nein::
-var:prefix:ja,nein::
+var:prefix:ja,nein,kein::
var:seitennummer:ja,nein::
-var:*Abschnitt*Nummer:ja,nein::
+var:*Abschnittnummer:ja,nein::
var:titelausrichten:ja,nein::
var:marginalie:*Dimension::
var:breite:*Dimension,passend::
@@ -2008,6 +2013,7 @@ var:hoehe:*Dimension,passend,breit::
var:tiefe:*Dimension,passend,breit::
var:abstand:*Dimension::
var:seperator:*Text::
+var:abschnitttrenner:*Text::
var:symbol:kein,1,2,3,...::
var:expansion:ja,nein,befehl::
var:maxbreite:*Dimension::
@@ -2067,6 +2073,7 @@ var:ziehefolgendeein:ja,nein::
var:alternative:*Name::
var:vorspatium:*Dimension::
var:nach:*Dimension::
+var:seperator:*Text::
stopsetup
startsetup
@@ -2291,6 +2298,7 @@ var:alternative:normal,imrand,mittig,text::
var:befehl:*\Befehl#1#2::
var:nummerbefehl:*\Befehl#1::
var:textbefehl:*\Befehl#1::
+var:seperator:*Text::
var:prefix:+,-,*Text::
var:setzekopf:ja,nein::
var:nummererhoehen:ja,nein,*Datei::
@@ -2437,7 +2445,7 @@ var:seitenstil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl::
var:textstil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl::
var:indikator:ja,nein::
var:verknuepfung:ja,nein::
-var:*Abschnitt*Nummer:ja,nein::
+var:*Abschnittnummer:ja,nein::
var:kriterium:*Abschnitt,lokal,alles::
var:abstand:*Dimension::
var:symbol:1,2,...,n,a,...,kein::
@@ -2625,6 +2633,7 @@ var:fusszeilenstatus:normal,stop,start,leer,kein,keinebeschriftung::
var:textstatus:normal,stop,start,leer,kein,keinebeschriftung::
var:statusoben:stop,start::
var:untenstatus:stop,start::
+var:pagestate:stop,start::
var:farbe:*Name::
stopsetup
@@ -2642,7 +2651,7 @@ stopsetup
startsetup
com:heutigesdatum:
typ:vals/:
-val:tag,monat,wochentag,jahr, dd,mm,jj,yy,d,m,j,y,merkmal:tag,monat,jahr:
+ivl:datum::
stopsetup
startsetup
@@ -2651,7 +2660,7 @@ typ:vars/vals/:
var:d:*Nummer::
var:m:*Nummer::
var:y:*Nummer::
-ivl:heutigesdatum::
+val:tag,monat,wochentag,jahr, dd,mm,jj,yy,d,m,j,y,merkmal:tag,monat,jahr:
stopsetup
startsetup
@@ -3054,6 +3063,8 @@ typ:vars/:
var:vor:*Befehl::
var:nach:*Befehl::
var:stil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl::
+var:farbe:*Name::
+var:platz:text,marginalie::
stopsetup
startsetup
@@ -3729,9 +3740,7 @@ stopsetup
startsetup
com:bemerkung:
-typ:poss/poss/vars/arg/:
-val:*Nummer::
-val:*Nummer::
+typ:pos/pos/vars/arg/:
val:*Nummer::
val:*Nummer::
ivr:stelleumrahmtein::
@@ -3873,7 +3882,6 @@ com:stellefeldein:
typ:val/vals/vars/vars/vars/:
val:*Name::
val:label,horizontal,vertikal,rahmen::
-ivr:umrahmt::
ivr:stellefelderin::
stopsetup
@@ -3882,7 +3890,6 @@ com:stellefelderin:
typ:vals/val/vars/vars/vars/:
val:*Name::
val:zuruecksetzten,label,horizontal,vertikal,rahmen::
-ivr:umrahmt::
var:n:*Nummer::
var:abstand:*Dimension::
var:vor:*Befehl::
@@ -3903,6 +3910,7 @@ var:berechnen:*Referenz::
var:feldoffset:*Dimension::
var:feldrahmenfarbe:*Name::
var:feldhintergrundfarbe:*Name::
+ivr:umrahmt::
stopsetup
startsetup
diff --git a/context/data/cont-en.tws b/context/data/cont-en.tws
index 62138e399..a0da7693d 100644
--- a/context/data/cont-en.tws
+++ b/context/data/cont-en.tws
@@ -20,6 +20,7 @@ stopsetup
startsetup
com:setuplanguage:
typ:val/vars/:
+val:nl,fr,en,uk,de,es,cz,..:nl:
ivr:installlanguage::
stopsetup
@@ -214,10 +215,9 @@ stopsetup
startsetup
com:definecolorgroup:
-typ:val/val/vals/:
+typ:val/val/trips/:
val:*name::
val:rgb,cmyk,gray,s:rgb:
-val:trips/::
stopsetup
startsetup
@@ -260,7 +260,7 @@ stopsetup
startsetup
com:setuptype:
-typ:var/:
+typ:vars/:
var:space:on,off::
var:option:slanted,normal,none::
var:style:normal,bold,slanted,boldslanted,type,cap,small...,*command::
@@ -405,6 +405,7 @@ var:alternative:a,b,c::
var:rulethickness:*dimension::
var:bottomoffset:*dimension::
var:topoffset:*dimension::
+var:rulecolor:*name::
stopsetup
startsetup
@@ -993,7 +994,8 @@ stopsetup
startsetup
com:lohi:
-typ:arg/arg/:
+typ:val/arg/arg/:
+val:low::
val:*text::
val:*text::
stopsetup
@@ -1725,8 +1727,9 @@ var:way:bytext,by*section::
var:text:*text::
var:numberseparator:*text::
var:textseparator:*text::
-var:*section*number:yes,no::
+var:*sectionnumber:yes,no::
var:separator:*text::
+var:strut:yes,no::
var:state:start,stop::
var:command:*\command#1::
stopsetup
@@ -1753,6 +1756,7 @@ stopsetup
startsetup
com:definestartstop:
typ:val/vars/:
+val:*name::
var:before:*command::
var:after:*command::
var:style:normal,bold,slanted,boldslanted,type,cap,small...,*command::
@@ -1780,6 +1784,7 @@ var:inbetween:*command::
var:align:left,middle,right,no::
var:conversion:numbers,characters,Characters,romannumerals,Romannumerals::
var:way:bytext,by*section::
+var:separator:*text::
stopsetup
startsetup
@@ -1881,9 +1886,9 @@ stopsetup
startsetup
com:setupreferencing:
-typ:var/:
+typ:vars/:
var:state:start,stop::
-var:*section*number:yes,no::
+var:*sectionnumber:yes,no::
var:prefix:+,-,*text::
var:interaction:label,text,all,symbol::
var:width:*dimension::
@@ -1980,7 +1985,7 @@ val:*name::
var:state:start,stop::
var:alternative:a,b,c,...,none,command::
var:coupling:on,off::
-var:criterium:*section,local,previous,all::
+var:criterium:*section,local,previous,current,all::
var:pageboundaries:*list::
var:style:normal,bold,slanted,boldslanted,type,cap,small...,*command::
var:numberstyle:normal,bold,slanted,boldslanted,type,cap,small...,*command::
@@ -1998,9 +2003,9 @@ var:inbetween:*command::
var:left:*text::
var:right:*text::
var:label:yes,no::
-var:prefix:yes,no::
+var:prefix:yes,no,none::
var:pagenumber:yes,no::
-var:*section*number:yes,no::
+var:*sectionnumber:yes,no::
var:aligntitle:yes,no::
var:margin:*dimension::
var:width:*dimension,fit::
@@ -2008,6 +2013,7 @@ var:height:*dimension,fit,broad::
var:depth:*dimension,fit,broad::
var:distance:*dimension::
var:separator:*text::
+var:stopper:*text::
var:symbol:none,1,2,3,...::
var:expansion:yes,no,command::
var:maxwidth:*dimension::
@@ -2067,6 +2073,7 @@ var:indentnext:yes,no::
var:alternative:*name::
var:spacebefore:*dimension::
var:after:*dimension::
+var:separator:*text::
stopsetup
startsetup
@@ -2291,6 +2298,7 @@ var:alternative:normal,inmargin,middle,text::
var:command:*\command#1#2::
var:numbercommand:*\command#1::
var:textcommand:*\command#1::
+var:separator:*text::
var:prefix:+,-,*text::
var:placehead:yes,no::
var:incrementnumber:yes,no,*file::
@@ -2437,7 +2445,7 @@ var:pagestyle:normal,bold,slanted,boldslanted,type,cap,small...,*command::
var:textstyle:normal,bold,slanted,boldslanted,type,cap,small...,*command::
var:indicator:yes,no::
var:coupling:yes,no::
-var:*section*number:yes,no::
+var:*sectionnumber:yes,no::
var:criterium:*section,local,all::
var:distance:*dimension::
var:symbol:1,2,...,n,a,...,none::
@@ -2625,6 +2633,7 @@ var:footerstate:normal,stop,start,empty,none,nomarking::
var:textstate:normal,stop,start,empty,none,nomarking::
var:topstate:stop,start::
var:bottomstate:stop,start::
+var:pagestate:stop,start::
var:color:*name::
stopsetup
@@ -2642,7 +2651,7 @@ stopsetup
startsetup
com:currentdate:
typ:vals/:
-val:day,month,weekday,year, dd,mm,jj,yy,d,m,j,y,referral:day,month,year:
+ivl:date::
stopsetup
startsetup
@@ -2651,7 +2660,7 @@ typ:vars/vals/:
var:d:*number::
var:m:*number::
var:y:*number::
-ivl:currentdate::
+val:day,month,weekday,year, dd,mm,jj,yy,d,m,j,y,referral:day,month,year:
stopsetup
startsetup
@@ -3054,6 +3063,8 @@ typ:vars/:
var:before:*command::
var:after:*command::
var:style:normal,bold,slanted,boldslanted,type,cap,small...,*command::
+var:color:*name::
+var:location:text,margin::
stopsetup
startsetup
@@ -3729,9 +3740,7 @@ stopsetup
startsetup
com:remark:
-typ:poss/poss/vars/arg/:
-val:*number::
-val:*number::
+typ:pos/pos/vars/arg/:
val:*number::
val:*number::
ivr:setupframed::
@@ -3873,7 +3882,6 @@ com:setupfield:
typ:val/vals/vars/vars/vars/:
val:*name::
val:label,horizontal,vertical,frame::
-ivr:framed::
ivr:setupfields::
stopsetup
@@ -3882,7 +3890,6 @@ com:setupfields:
typ:vals/val/vars/vars/vars/:
val:*name::
val:reset,label,horizontal,vertical,frame::
-ivr:framed::
var:n:*number::
var:distance:*dimension::
var:before:*command::
@@ -3903,6 +3910,7 @@ var:calculate:*reference::
var:fieldoffset:*dimension::
var:fieldframecolor:*name::
var:fieldbackgroundcolor:*name::
+ivr:framed::
stopsetup
startsetup
diff --git a/context/data/cont-it.tws b/context/data/cont-it.tws
index 2c850d62b..29173a4a2 100644
--- a/context/data/cont-it.tws
+++ b/context/data/cont-it.tws
@@ -20,6 +20,7 @@ stopsetup
startsetup
com:impostalingua:
typ:val/vars/:
+val:nl,fr,en,uk,de,es,cz,..:nl:
ivr:installalingua::
stopsetup
@@ -214,10 +215,9 @@ stopsetup
startsetup
com:definiscigruppocolori:
-typ:val/val/vals/:
+typ:val/val/trips/:
val:*name::
val:rgb,cmyk,grigio,s:rgb:
-val:trips/::
stopsetup
startsetup
@@ -260,7 +260,7 @@ stopsetup
startsetup
com:impostatype:
-typ:var/:
+typ:vars/:
var:spazio:attivo,disattivo::
var:opzione:inclinato,normale,nessuno::
var:stile:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command::
@@ -405,6 +405,7 @@ var:alternativa:a,b,c::
var:spessorelinea:*dimension::
var:offsetfondo:*dimension::
var:offsetcima:*dimension::
+var:colorelinea:*name::
stopsetup
startsetup
@@ -993,7 +994,8 @@ stopsetup
startsetup
com:pedap:
-typ:arg/arg/:
+typ:val/arg/arg/:
+val:basso::
val:*text::
val:*text::
stopsetup
@@ -1725,8 +1727,9 @@ var:modo:datesto,da*section::
var:testo:*text::
var:separatorenumero:*text::
var:separatoretesto:*text::
-var:*section*number:si,no::
+var:*sectionnumber:si,no::
var:separatore:*text::
+var:strut:si,no::
var:stato:inizia,termina::
var:comando:*\command#1::
stopsetup
@@ -1753,6 +1756,7 @@ stopsetup
startsetup
com:definisciiniziatermina:
typ:val/vars/:
+val:*name::
var:prima:*command::
var:dopo:*command::
var:stile:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command::
@@ -1780,6 +1784,7 @@ var:tra:*command::
var:allinea:sinistra,centro,destra,no::
var:conversione:numeri,lettere,Lettere,numeriromani,Numeriromani::
var:modo:datesto,da*section::
+var:separatore:*text::
stopsetup
startsetup
@@ -1881,9 +1886,9 @@ stopsetup
startsetup
com:impostariferimento:
-typ:var/:
+typ:vars/:
var:stato:inizia,termina::
-var:*section*number:si,no::
+var:*sectionnumber:si,no::
var:prefisso:+,-,*text::
var:interazione:etichetta,testo,tutti,simbolo::
var:ampiezza:*dimension::
@@ -1980,7 +1985,7 @@ val:*name::
var:stato:inizia,termina::
var:alternativa:a,b,c,...,nessuno,comando::
var:accoppiamento:attivo,disattivo::
-var:criterio:*section,locale,precedente,tutti::
+var:criterio:*section,locale,precedente,corrente,tutti::
var:limitipagina:*list::
var:stile:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command::
var:stilenumero:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command::
@@ -1998,9 +2003,9 @@ var:tra:*command::
var:sinistra:*text::
var:destra:*text::
var:etichetta:si,no::
-var:prefisso:si,no::
+var:prefisso:si,no,nessuno::
var:numeropagina:si,no::
-var:*section*number:si,no::
+var:*sectionnumber:si,no::
var:allineatitolo:si,no::
var:margine:*dimension::
var:ampiezza:*dimension,adatta::
@@ -2008,6 +2013,7 @@ var:altezza:*dimension,adatta,ampio::
var:profondita:*dimension,adatta,ampio::
var:distanza:*dimension::
var:separatore:*text::
+var:stopper:*text::
var:simbolo:nessuno,1,2,3,...::
var:espansione:si,no,comando::
var:ampiezzamax:*dimension::
@@ -2067,6 +2073,7 @@ var:rientrasuccessivo:si,no::
var:alternativa:*name::
var:spazioprima:*dimension::
var:dopo:*dimension::
+var:separatore:*text::
stopsetup
startsetup
@@ -2291,6 +2298,7 @@ var:alternativa:normale,inmargine,centro,testo::
var:comando:*\command#1#2::
var:comandonumero:*\command#1::
var:comandotesto:*\command#1::
+var:separatore:*text::
var:prefisso:+,-,*text::
var:mettitesta:si,no::
var:incrementanumero:si,no,*file::
@@ -2437,7 +2445,7 @@ var:stilepagina:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo.
var:stiletesto:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command::
var:indicatore:si,no::
var:accoppiamento:si,no::
-var:*section*number:si,no::
+var:*sectionnumber:si,no::
var:criterio:*section,locale,tutti::
var:distanza:*dimension::
var:simbolo:1,2,...,n,a,...,nessuno::
@@ -2625,6 +2633,7 @@ var:statopdp:normale,termina,inizia,vuoto,nessuno,nomarcature::
var:statotesto:normale,termina,inizia,vuoto,nessuno,nomarcature::
var:statocima:termina,inizia::
var:statofondo:termina,inizia::
+var:statopagina:termina,inizia::
var:colore:*name::
stopsetup
@@ -2642,7 +2651,7 @@ stopsetup
startsetup
com:datadioggi:
typ:vals/:
-val:giorno,mese,giornosettimana,anno, dd,mm,jj,yy,d,m,j,y,referral:giorno,mese,anno:
+ivl:data::
stopsetup
startsetup
@@ -2651,7 +2660,7 @@ typ:vars/vals/:
var:d:*number::
var:m:*number::
var:y:*number::
-ivl:datadioggi::
+val:giorno,mese,giornosettimana,anno, dd,mm,jj,yy,d,m,j,y,referral:giorno,mese,anno:
stopsetup
startsetup
@@ -3054,6 +3063,8 @@ typ:vars/:
var:prima:*command::
var:dopo:*command::
var:stile:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*command::
+var:colore:*name::
+var:luogo:testo,margine::
stopsetup
startsetup
@@ -3178,7 +3189,7 @@ val:*text::
stopsetup
startsetup
-com:iniziatabulate:
+com:iniziatabulato:
typ:val/vars/stp/:
val:*text::
ivr:usafiguraesterna::
@@ -3336,7 +3347,7 @@ val:*text::
stopsetup
startsetup
-com:rotazione:
+com:ruota:
typ:vars/arg/:
ivr:impostarotazione::
stopsetup
@@ -3354,7 +3365,7 @@ typ:arg/:
stopsetup
startsetup
-com:scale:
+com:scala:
typ:vars/arg/:
var:sx:*number::
var:sy:*number::
@@ -3729,9 +3740,7 @@ stopsetup
startsetup
com:commento:
-typ:poss/poss/vars/arg/:
-val:*number::
-val:*number::
+typ:pos/pos/vars/arg/:
val:*number::
val:*number::
ivr:impostaincorniciato::
@@ -3873,7 +3882,6 @@ com:impostacampo:
typ:val/vals/vars/vars/vars/:
val:*name::
val:etichetta,orizzontale,verticale,cornice::
-ivr:incorniciato::
ivr:impostacampi::
stopsetup
@@ -3882,7 +3890,6 @@ com:impostacampi:
typ:vals/val/vars/vars/vars/:
val:*name::
val:reimposta,etichetta,orizzontale,verticale,cornice::
-ivr:incorniciato::
var:n:*number::
var:distanza:*dimension::
var:prima:*command::
@@ -3903,6 +3910,7 @@ var:calcola:*reference::
var:offsetcampo:*dimension::
var:colorecornicecampo:*name::
var:coloresfondocampo:*name::
+ivr:incorniciato::
stopsetup
startsetup
@@ -4056,7 +4064,7 @@ ivr:impostaposizionamento::
stopsetup
startsetup
-com:posizionetesto:
+com:posizionatesto:
typ:val/arg/:
val:*name::
val:*text::
diff --git a/context/data/cont-nl.tws b/context/data/cont-nl.tws
index 1afde8131..b457504fd 100644
--- a/context/data/cont-nl.tws
+++ b/context/data/cont-nl.tws
@@ -20,6 +20,7 @@ stopsetup
startsetup
com:steltaalin:
typ:val/vars/:
+val:nl,fr,en,uk,de,es,cz,..:nl:
ivr:installeertaal::
stopsetup
@@ -214,10 +215,9 @@ stopsetup
startsetup
com:definieerkleurgroep:
-typ:val/val/vals/:
+typ:val/val/trips/:
val:*naam::
val:rgb,cmyk,grijs,s:rgb:
-val:trips/::
stopsetup
startsetup
@@ -260,7 +260,7 @@ stopsetup
startsetup
com:steltypein:
-typ:var/:
+typ:vars/:
var:spatie:aan,uit::
var:optie:schuin,normaal,geen::
var:letter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando::
@@ -405,6 +405,7 @@ var:variant:a,b,c::
var:lijndikte:*maat::
var:onderoffset:*maat::
var:bovenoffset:*maat::
+var:lijnkleur:*naam::
stopsetup
startsetup
@@ -993,7 +994,8 @@ stopsetup
startsetup
com:laho:
-typ:arg/arg/:
+typ:val/arg/arg/:
+val:laag::
val:*tekst::
val:*tekst::
stopsetup
@@ -1725,8 +1727,9 @@ var:wijze:pertekst,per*sectie::
var:tekst:*tekst::
var:nummerscheider:*tekst::
var:tekstscheider:*tekst::
-var:*sectie*getal:ja,nee::
+var:*sectienummer:ja,nee::
var:scheider:*tekst::
+var:strut:ja,nee::
var:status:start,stop::
var:commando:*\commando#1::
stopsetup
@@ -1753,6 +1756,7 @@ stopsetup
startsetup
com:definieerstartstop:
typ:val/vars/:
+val:*naam::
var:voor:*commando::
var:na:*commando::
var:letter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando::
@@ -1780,6 +1784,7 @@ var:tussen:*commando::
var:uitlijnen:links,midden,rechts,nee::
var:conversie:cijfers,letters,Letters,romeins,Romeins::
var:wijze:pertekst,per*sectie::
+var:scheider:*tekst::
stopsetup
startsetup
@@ -1881,9 +1886,9 @@ stopsetup
startsetup
com:stelrefererenin:
-typ:var/:
+typ:vars/:
var:status:start,stop::
-var:*sectie*getal:ja,nee::
+var:*sectienummer:ja,nee::
var:prefix:+,-,*tekst::
var:interactie:label,tekst,alles,symbool::
var:breedte:*maat::
@@ -1980,7 +1985,7 @@ val:*naam::
var:status:start,stop::
var:variant:a,b,c,...,geen,commando::
var:koppeling:aan,uit::
-var:criterium:*sectie,lokaal,vorige,alles::
+var:criterium:*sectie,lokaal,vorige,huidige,alles::
var:paginaovergangen:*lijst::
var:letter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando::
var:nummerletter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando::
@@ -1998,9 +2003,9 @@ var:tussen:*commando::
var:links:*tekst::
var:rechts:*tekst::
var:label:ja,nee::
-var:prefix:ja,nee::
+var:prefix:ja,nee,geen::
var:paginanummer:ja,nee::
-var:*sectie*getal:ja,nee::
+var:*sectienummer:ja,nee::
var:titeluitlijnen:ja,nee::
var:marge:*maat::
var:breedte:*maat,passend::
@@ -2008,6 +2013,7 @@ var:hoogte:*maat,passend,ruim::
var:diepte:*maat,passend,ruim::
var:afstand:*maat::
var:scheider:*tekst::
+var:afsluiter:*tekst::
var:symbool:geen,1,2,3,...::
var:expansie:ja,nee,commando::
var:maxbreedte:*maat::
@@ -2067,6 +2073,7 @@ var:springvolgendein:ja,nee::
var:variant:*naam::
var:voorwit:*maat::
var:na:*maat::
+var:scheider:*tekst::
stopsetup
startsetup
@@ -2291,6 +2298,7 @@ var:variant:normaal,inmarge,midden,tekst::
var:commando:*\commando#1#2::
var:nummercommando:*\commando#1::
var:tekstcommando:*\commando#1::
+var:scheider:*tekst::
var:prefix:+,-,*tekst::
var:plaatskop:ja,nee::
var:verhoognummer:ja,nee,*file::
@@ -2437,7 +2445,7 @@ var:paginaletter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando::
var:tekstletter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando::
var:aanduiding:ja,nee::
var:koppeling:ja,nee::
-var:*sectie*getal:ja,nee::
+var:*sectienummer:ja,nee::
var:criterium:*sectie,lokaal,alles::
var:afstand:*maat::
var:symbool:1,2,...,n,a,...,geen::
@@ -2625,6 +2633,7 @@ var:voetstatus:normaal,stop,start,leeg,geen,geenmarkering::
var:tekststatus:normaal,stop,start,leeg,geen,geenmarkering::
var:bovenstatus:stop,start::
var:onderstatus:stop,start::
+var:paginastatus:stop,start::
var:kleur:*naam::
stopsetup
@@ -2642,7 +2651,7 @@ stopsetup
startsetup
com:huidigedatum:
typ:vals/:
-val:dag,maand,weekdag,jaar, dd,mm,jj,yy,d,m,j,y,kenmerk:dag,maand,jaar:
+ivl:datum::
stopsetup
startsetup
@@ -2651,7 +2660,7 @@ typ:vars/vals/:
var:d:*getal::
var:m:*getal::
var:y:*getal::
-ivl:huidigedatum::
+val:dag,maand,weekdag,jaar, dd,mm,jj,yy,d,m,j,y,kenmerk:dag,maand,jaar:
stopsetup
startsetup
@@ -3054,6 +3063,8 @@ typ:vars/:
var:voor:*commando::
var:na:*commando::
var:letter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando::
+var:kleur:*naam::
+var:plaats:tekst,marge::
stopsetup
startsetup
@@ -3729,9 +3740,7 @@ stopsetup
startsetup
com:toelichting:
-typ:poss/poss/vars/arg/:
-val:*getal::
-val:*getal::
+typ:pos/pos/vars/arg/:
val:*getal::
val:*getal::
ivr:stelomlijndin::
@@ -3873,7 +3882,6 @@ com:stelveldin:
typ:val/vals/vars/vars/vars/:
val:*naam::
val:label,horizontaal,vertikaal,kader::
-ivr:omlijnd::
ivr:stelveldenin::
stopsetup
@@ -3882,7 +3890,6 @@ com:stelveldenin:
typ:vals/val/vars/vars/vars/:
val:*naam::
val:reset,label,horizontaal,vertikaal,kader::
-ivr:omlijnd::
var:n:*getal::
var:afstand:*maat::
var:voor:*commando::
@@ -3903,6 +3910,7 @@ var:bereken:*verwijzing::
var:veldoffset:*maat::
var:veldkaderkleur:*naam::
var:veldachtergrondkleur:*naam::
+ivr:omlijnd::
stopsetup
startsetup
diff --git a/context/data/cont-ro.tws b/context/data/cont-ro.tws
index cbd4162a7..3d73f5ca5 100644
--- a/context/data/cont-ro.tws
+++ b/context/data/cont-ro.tws
@@ -20,6 +20,7 @@ stopsetup
startsetup
com:setarelimba:
typ:val/vars/:
+val:nl,fr,en,uk,de,es,cz,..:nl:
ivr:instalarelimba::
stopsetup
@@ -214,10 +215,9 @@ stopsetup
startsetup
com:definestegrupculori:
-typ:val/val/vals/:
+typ:val/val/trips/:
val:*nume::
val:rgb,cmyk,gri,s:rgb:
-val:trips/::
stopsetup
startsetup
@@ -260,7 +260,7 @@ stopsetup
startsetup
com:seteazatype:
-typ:var/:
+typ:vars/:
var:spatiu:on,dezactivat::
var:optiune:inclinat,normal,niciunul::
var:stil:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda::
@@ -405,6 +405,7 @@ var:alternativ:a,b,c::
var:grosimerigla:*dimensiune::
var:offsetjos:*dimensiune::
var:offsetsus:*dimensiune::
+var:culoarerigla:*nume::
stopsetup
startsetup
@@ -993,7 +994,8 @@ stopsetup
startsetup
com:jossus:
-typ:arg/arg/:
+typ:val/arg/arg/:
+val:jos::
val:*text::
val:*text::
stopsetup
@@ -1725,8 +1727,9 @@ var:mod:detext,de*sectiune::
var:text:*text::
var:separatornumar:*text::
var:separatortext:*text::
-var:*sectiune*numar:da,nu::
+var:*sectiunenumar singular: nume singular:da,nu::
var:separator:*text::
+var:strut:da,nu::
var:stare:start,stop::
var:comanda:*\comanda#1::
stopsetup
@@ -1753,6 +1756,7 @@ stopsetup
startsetup
com:definestestartstop:
typ:val/vars/:
+val:*nume::
var:inainte:*comanda::
var:dupa:*comanda::
var:stil:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda::
@@ -1780,6 +1784,7 @@ var:intre:*comanda::
var:aliniere:stanga,centru,dreapta,nu::
var:conversie:numere,caractere,Caractere,numereromane,Numereromane::
var:mod:detext,de*sectiune::
+var:separator:*text::
stopsetup
startsetup
@@ -1881,9 +1886,9 @@ stopsetup
startsetup
com:seteazareferinte:
-typ:var/:
+typ:vars/:
var:stare:start,stop::
-var:*sectiune*numar:da,nu::
+var:*sectiunenumar singular: nume singular:da,nu::
var:prefix:+,-,*text::
var:interactiune:eticheta,text,tot,simbol::
var:latime:*dimensiune::
@@ -1980,7 +1985,7 @@ val:*nume::
var:stare:start,stop::
var:alternativ:a,b,c,...,niciunul,comanda::
var:cuplare:on,dezactivat::
-var:criteriu:*sectiune,local,precedent,tot::
+var:criteriu:*sectiune,local,precedent,curent,tot::
var:marginipagina:*lista::
var:stil:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda::
var:stilnumar:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda::
@@ -1998,9 +2003,9 @@ var:intre:*comanda::
var:stanga:*text::
var:dreapta:*text::
var:eticheta:da,nu::
-var:prefix:da,nu::
+var:prefix:da,nu,niciunul::
var:numarpagina:da,nu::
-var:*sectiune*numar:da,nu::
+var:*sectiunenumar singular: nume singular:da,nu::
var:alinieretitlu:da,nu::
var:margine:*dimensiune::
var:latime:*dimensiune,ajustat::
@@ -2008,6 +2013,7 @@ var:inaltime:*dimensiune,ajustat,broad::
var:inaltime:*dimensiune,ajustat,broad::
var:distanta:*dimensiune::
var:separator:*text::
+var:stopper:*text::
var:simbol:niciunul,1,2,3,...::
var:expansiune:da,nu,comanda::
var:latimemaxima:*dimensiune::
@@ -2067,6 +2073,7 @@ var:aliniaturmator:da,nu::
var:alternativ:*nume::
var:spatiuinainte:*dimensiune::
var:dupa:*dimensiune::
+var:separator:*text::
stopsetup
startsetup
@@ -2291,6 +2298,7 @@ var:alternativ:normal,inmargine,centru,text::
var:comanda:*\comanda#1#2::
var:comandanumar:*\comanda#1::
var:comandatext:*\comanda#1::
+var:separator:*text::
var:prefix:+,-,*text::
var:punetitlu:da,nu::
var:numarincrement:da,nu,*fisier::
@@ -2420,14 +2428,14 @@ stopsetup
startsetup
com:definesteregistru:
typ:val/val/:
-val:*nume singular::
+val:*\@@mssetupsingular ::
val:*nume pluram::
stopsetup
startsetup
com:seteazaregistru:
typ:val/val/vars/:
-val:*nume singular::
+val:*\@@mssetupsingular ::
val:*nume::
var:n:*numar::
var:balanta:da,nu::
@@ -2437,7 +2445,7 @@ var:stilpagina:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda::
var:stiltext:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda::
var:indicator:da,nu::
var:cuplare:da,nu::
-var:*sectiune*numar:da,nu::
+var:*sectiunenumar singular: nume singular:da,nu::
var:criteriu:*sectiune,local,tot::
var:distanta:*dimensiune::
var:simbol:1,2,...,n,a,...,niciunul::
@@ -2467,7 +2475,7 @@ stopsetup
startsetup
com:scrieinregistru:
typ:val/val/idxs/:
-val:*nume singular::
+val:*\@@mssetupsingular ::
val:*text::
val:*text::
stopsetup
@@ -2508,7 +2516,7 @@ stopsetup
startsetup
com:definestesinonim:
typ:val/val/val/val/:
-val:*nume singular::
+val:*\@@mssetupsingular ::
val:*nume pluram::
val:*comanda::
val:*comanda::
@@ -2555,7 +2563,7 @@ stopsetup
startsetup
com:definestesortare:
typ:val/val/val/:
-val:*nume singular::
+val:*\@@mssetupsingular ::
val:*nume pluram::
val:*comanda::
stopsetup
@@ -2625,6 +2633,7 @@ var:staresubsol:normal,stop,start,gol,niciunul,faramarcare::
var:staretext:normal,stop,start,gol,niciunul,faramarcare::
var:staresus:stop,start::
var:starejos:stop,start::
+var:pagestate:stop,start::
var:culoare:*nume::
stopsetup
@@ -2642,7 +2651,7 @@ stopsetup
startsetup
com:datacurenta:
typ:vals/:
-val:zi,luna,zisaptamana,an, dd,mm,jj,yy,d,m,j,y,referinta:zi,luna,an:
+ivl:data::
stopsetup
startsetup
@@ -2651,7 +2660,7 @@ typ:vars/vals/:
var:d:*numar::
var:m:*numar::
var:y:*numar::
-ivl:datacurenta::
+val:zi,luna,zisaptamana,an, dd,mm,jj,yy,d,m,j,y,referinta:zi,luna,an:
stopsetup
startsetup
@@ -2928,7 +2937,7 @@ stopsetup
startsetup
com:definestefloat:
typ:val/val/:
-val:*nume singular::
+val:*\@@mssetupsingular ::
val:*nume pluram::
stopsetup
@@ -3054,6 +3063,8 @@ typ:vars/:
var:inainte:*comanda::
var:dupa:*comanda::
var:stil:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda::
+var:culoare:*nume::
+var:locatie:text,margine::
stopsetup
startsetup
@@ -3729,9 +3740,7 @@ stopsetup
startsetup
com:remarca:
-typ:poss/poss/vars/arg/:
-val:*numar::
-val:*numar::
+typ:pos/pos/vars/arg/:
val:*numar::
val:*numar::
ivr:seteazainconjurat::
@@ -3873,7 +3882,6 @@ com:seteazacamp:
typ:val/vals/vars/vars/vars/:
val:*nume::
val:eticheta,orizontal,vertical,incadrat::
-ivr:framed::
ivr:seteazacampuri::
stopsetup
@@ -3882,7 +3890,6 @@ com:seteazacampuri:
typ:vals/val/vars/vars/vars/:
val:*nume::
val:reset,eticheta,orizontal,vertical,incadrat::
-ivr:framed::
var:n:*numar::
var:distanta:*dimensiune::
var:inainte:*comanda::
@@ -3903,6 +3910,7 @@ var:calculeaza:*referinta::
var:offsetcamp:*dimensiune::
var:culoareframecamp:*nume::
var:culoarefundalcamp:*nume::
+ivr:framed::
stopsetup
startsetup
diff --git a/context/data/type-buy.dat b/context/data/type-buy.dat
index a63991016..2835f0338 100644
--- a/context/data/type-buy.dat
+++ b/context/data/type-buy.dat
@@ -30,17 +30,22 @@
--en=? --ve=lucas --co=sun --re
--en=? --ve=lucas --co=sun --so=lucas/sun --ma --in
-# creative aliance arcadia
+# lucas antiqua
+
+--en=? --ve=lucas --co=antiqua --re
+--en=? --ve=lucas --co=antiqua --so=lucas/antiqua --ma --in
+
+# creative arcadia
--en=? --ve=creative --co=arcadia --re
--en=? --ve=creative --co=arcadia --so=creative/arcadia --ma --in
-# creative aliance industria
+# creative industria
--en=? --ve=creative --co=industria --re
--en=? --ve=creative --co=industria --so=creative/industria --ma --in
-# creative aliance insigna
+# creative insignia
--en=? --ve=creative --co=insignia --re
--en=? --ve=creative --co=insignia --so=creative/insignia --ma --in
diff --git a/context/data/type-tmf.dat b/context/data/type-tmf.dat
index f4ecaf613..2c32895e3 100644
--- a/context/data/type-tmf.dat
+++ b/context/data/type-tmf.dat
@@ -43,10 +43,10 @@
# bit charter
---en=? --ve=bit --co=charter --so=auto
---en=? --ve=bit --co=charter --so=auto --ca=* bchr8a
---en=? --ve=bit --co=charter --so=auto --sl=* bchr8a
---en=? --ve=bit --co=charter --so=auto --sl=* bchb8a
+--en=? --ve=bitstrea --co=charter --so=auto
+--en=? --ve=bitstrea --co=charter --so=auto --ca=* bchr8a
+--en=? --ve=bitstrea --co=charter --so=auto --sl=* bchr8a
+--en=? --ve=bitstrea --co=charter --so=auto --sl=* bchb8a
# uwr bookman
diff --git a/context/perltk/fdf2tan.pl b/context/perltk/fdf2tan.pl
index 0e505d054..c612f9886 100644
--- a/context/perltk/fdf2tan.pl
+++ b/context/perltk/fdf2tan.pl
@@ -1,3 +1,6 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
+ if 0;
+
#D \module
#D [ file=fdf2tan.pl,
#D version=2000.02.06,
diff --git a/context/perltk/fdf2tex.pl b/context/perltk/fdf2tex.pl
new file mode 100644
index 000000000..f9684cd9f
--- /dev/null
+++ b/context/perltk/fdf2tex.pl
@@ -0,0 +1,213 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+# not yet public
+
+# We're dealing with:
+
+$InpFile = $ARGV[0] ; $OutFile = $ARGV[1] ; $Field = $ARGV[2] ;
+
+# beware: fields are funny sorted
+
+$Program = "fdf2tex 1.02 - ConTeXt / PRAGMA 1997-2000" ;
+
+if ($Field eq "")
+ { print "\n$Program\n\n" }
+
+# filter \type{filename.fdf} into \type{filename.fdt}
+
+unless ($OutFile)
+ { $OutFile = $InpFile ;
+ $OutFile =~ s/\..*// }
+
+unless ($InpFile=~/\./)
+ { if (-e "$InpFile.fdf")
+ { $InpFile .= ".fdf" }
+ elsif (-e "$InpFile.xml")
+ { $InpFile .= ".xml" } }
+
+unless ($OutFile=~/\./)
+ { $OutFile .= ".fdt" }
+
+if (open (FDF, "<$InpFile"))
+ { binmode FDF ;
+ open (FDT, ">$OutFile") ;
+ if ($Field eq "")
+ { print " input file : $InpFile\n" ;
+ print " output file : $OutFile\n" } }
+else
+ { if ($Field eq "")
+ { print " error : $InpFile not found\n" }
+ exit }
+
+# load the whole file in the buffer
+
+$_ = "" ; while ($Line=) { chomp $Line; $_ .= $Line }
+
+# or faster: dan ///s gebruiken (ipv m)
+
+# $/ = "\0777" ; $_ = ;
+
+# zoom in on the objects and remove the header and trialer
+
+if ($InpFile =~ /\.xml$/)
+
+{ # begin kind of xml alternative
+
+s/\>\s*\\>\/\\FDFfield\[$1\]\n/goms ;
+s/(name|value)\=\"(.*?)\"/$1=\{$2\}/goms ;
+s/\} (name|value)/\}\,$1/goms ;
+s/\(.*?)\<\/fdfobject\>/\\beginFDFobject\n$1\\endFDFobject\n/goms ;
+s/\(.*?)\<\/fdfdata\>/\\beginFDFdata\n$1\\endFDFdata\n/goms ;
+s/\(.*?)\<\/fdffields\>/\\beginFDFfields\n$1\\endFDFfields\n/goms ;
+
+} # end kind of xml alternative
+
+else
+
+{ # begin fdf alternative
+
+s/.*?obj\s*?<<(.*?)>>\s*?endobj/\n\\beginFDFobject$1\n\\endFDFobject/go;
+s/trailer.*//;
+
+# zoom in on the FDF data
+
+s/\/FDF.*?<<(.*)>>/\n\\beginFDFdata$1\n\\endFDFdata/go;
+
+# zoom in on the Field collection and remove whatever else
+
+s/\/Fields.*?\[.*?<<.*?(.*).*?>>.*?\]/\n\\beginFDFfields<<$1>>\n\\endFDFfields/go;
+s/\\endFDFfields.*\n\\endFDFdata/\\endFDFfields\n\\endFDFdata/go;
+
+# tag each field
+
+$N = s/\<<(.*?)>>/\n\\FDFfield[$1]/go;
+
+# remove non relevant entries, but keep \type{/T} and \type{/V}
+
+s/\s*?\/[Kids|Opt]\s*?<<.*?>>//go;
+s/\s*?\/[Ff|setFf|ClrFf|F|SetF|ClrF]\s*?\d*?//go;
+s/\s*?\/[AP|A|AS]\s*?\[.*?\]//go;
+s/\s*?\/AS\s*?\/.*?\s//go;
+
+# format the field identifier
+
+s/(.*?)\/T.*?\((.*?)\)/$1 name=$2,/go;
+
+# format the value, which can be a name or string
+
+s/\/V\s?\((.*?)\)/value=\{$1\},/go;
+s/\/V\s?\/(.*?)[\s|\/]/value=\{$1\},/go;
+
+# sanitize some special \TeX\ tokens
+
+s/(\#|\$|\&|\^|\_|\|)/\\$1/go;
+
+# remove spaces and commas
+
+#s/\s?([name|value])/$1/go;
+s/\[\s*/\[/go;
+s/,\]/\]/go;
+
+# convert PDFDocEncoding
+
+s/\\225/\\\/L/ ;
+s/\\226/\\OE/ ;
+s/\\227/\\vS/ ;
+s/\\230/\\"Y/ ;
+s/\\231/\\vZ/ ;
+s/\\233/\\\/l/ ;
+s/\\234/\\oe/ ;
+s/\\235/\\vs/ ;
+s/\\236/\\vz/ ;
+s/\\253/\\< ;
+s/\\273/\\>>/ ;
+s/\\300/\\`A/ ;
+s/\\301/\\'A/ ;
+s/\\302/\\^A/ ;
+s/\\303/\\~A/ ;
+s/\\304/\\"A/ ;
+s/\\305/\\oA/ ;
+s/\\306/\\AE/ ;
+s/\\307/\\,C/ ;
+s/\\310/\\`E/ ;
+s/\\311/\\'E/ ;
+s/\\312/\\^E/ ;
+s/\\313/\\"E/ ;
+s/\\314/\\`I/ ;
+s/\\315/\\'I/ ;
+s/\\316/\\^I/ ;
+s/\\317/\\"I/ ;
+s/\\321/\\~N/ ;
+s/\\322/\\`O/ ;
+s/\\323/\\'O/ ;
+s/\\324/\\^O/ ;
+s/\\325/\\~O/ ;
+s/\\326/\\"O/ ;
+s/\\330/\\\/O/ ;
+s/\\331/\\`U/ ;
+s/\\332/\\'U/ ;
+s/\\333/\\^U/ ;
+s/\\334/\\"U/ ;
+s/\\335/\\'Y/ ;
+s/\\337/\\ss/ ;
+s/\\340/\\`a/ ;
+s/\\341/\\'a/ ;
+s/\\342/\\^a/ ;
+s/\\343/\\~a/ ;
+s/\\344/\\"a/ ;
+s/\\345/\\oa/ ;
+s/\\346/\\ae/ ;
+s/\\347/\\,c/ ;
+s/\\350/\\`e/ ;
+s/\\351/\\'e/ ;
+s/\\352/\\^e/ ;
+s/\\353/\\"e/ ;
+s/\\354/\\`i/ ;
+s/\\355/\\'i/ ;
+s/\\356/\\^i/ ;
+s/\\357/\\"i/ ;
+s/\\361/\\~n/ ;
+s/\\362/\\`o/ ;
+s/\\363/\\'o/ ;
+s/\\364/\\^o/ ;
+s/\\365/\\~o/ ;
+s/\\366/\\"o/ ;
+s/\\370/\\\/o/ ;
+s/\\371/\\`u/ ;
+s/\\372/\\'u/ ;
+s/\\373/\\^u/ ;
+s/\\374/\\"u/ ;
+s/\\375/\\'y/ ;
+s/\\377/\\"y/ ;
+
+s/\\\\ ;
+s/\\\>/\>/ ;
+s/\\\(/\(/ ;
+s/\\\)/\)/ ;
+s/\#/\\#/ ;
+
+# convert newline and return commands
+
+s/\\n/ /go;
+s/\\r/\\par /go;
+
+} # end fdf alternative
+
+# flush buffer
+
+print FDT $_ ;
+
+close FDT ;
+close FDF ;
+
+# report some characteristics
+
+if ($Field eq "")
+ { print " number of fields : $N\n" }
+else
+ { if (/\\FDFfield\[value\=\{(.*)\}\,\s*name=$Field/mos)
+ { print "$1" }
+ elsif (/\\FDFfield\[name=$Field\,\s*value\=\{(.*)\}/mos)
+ { print "$1" } }
diff --git a/context/perltk/mptopdf.pl b/context/perltk/mptopdf.pl
index 1ff0c56c0..e55fb74b2 100644
--- a/context/perltk/mptopdf.pl
+++ b/context/perltk/mptopdf.pl
@@ -20,15 +20,32 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
# use File::Copy ; # not in every perl
use Config ;
+use Getopt::Long ;
+use strict ;
-$program = "MPtoPDF 1.1" ;
-$pattern = $ARGV[0] ;
-$done = 0 ;
-$report = '' ;
+$Getopt::Long::passthrough = 1 ; # no error message
+$Getopt::Long::autoabbrev = 1 ; # partial switch accepted
+
+my $Help = my $Latex = 0 ;
+
+&GetOptions
+ ( "help" => \$Help ,
+ "latex" => \$Latex ) ;
+
+my $program = "MPtoPDF 1.2" ;
+my $pattern = $ARGV[0] ;
+my $done = 0 ;
+my $report = '' ;
+my $latexswitch = " --tex=latex --format=latex " ;
+
+## $dosish = ($Config{'osname'} =~ /dos|mswin/i) ;
+my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ;
-my $dosish = ($Config{'osname'} =~ /dos|mswin/io) ;
my $miktex = ($ENV{"TEXSYSTEM"} =~ /miktex/io);
+my @files ;
+my $command = "" ;
+
sub CopyFile # agressive copy, works for open files like in gs
{ my ($From,$To) = @_ ;
return unless open(INP,"<$From") ; binmode INP ;
@@ -37,13 +54,21 @@ sub CopyFile # agressive copy, works for open files like in gs
close (INP) ;
close (OUT) }
-if (($pattern eq '')||($pattern =~ /^\-+(h|help)$/io))
- { print "\n$program: provide MP output file (or pattern)\n" ;
+if (($pattern eq '')||($Help))
+ { print "\n$program : provide MP output file (or pattern)\n" ;
exit }
elsif ($pattern =~ /\.mp$/io)
- { $error = system ("texexec --mptex $pattern") ;
+ { shift @ARGV ; my $rest = join(" ", @ARGV) ;
+ if (open(INP,$pattern))
+ { while ()
+ { if (/(documentstyle|documentclass|begin\{document\})/io)
+ { $Latex = 1 ; last } }
+ close (INP) }
+ if ($Latex)
+ { $rest .= " $latexswitch" }
+ my $error = system ("texexec --mptex $rest $pattern") ;
if ($error)
- { print "\n$program: error while processing mp file\n" ; exit }
+ { print "\n$program : error while processing mp file\n" ; exit }
else
{ $pattern =~ s/\.mp$//io ;
@files = glob "$pattern.*" } }
@@ -55,7 +80,7 @@ else
{ $pattern .= '.*' ;
@files = glob "$pattern" }
-foreach $file (@files)
+foreach my $file (@files)
{ $_ = $file ;
if (s/\.(\d+|mps)$// && -e $file)
{ if ($miktex)
@@ -64,7 +89,8 @@ foreach $file (@files)
else
{ $command = "pdfetex \\&mptopdf" } }
else
- { $command = "pdfetex -progname=pdfetex -efmt=mptopdf" }
+# { $command = "pdfetex -progname=pdfetex -efmt=mptopdf" }
+ { $command = "pdfetex -progname=context -efmt=mptopdf" }
if ($dosish)
{ system ("$command \\relax $file") }
else
@@ -76,6 +102,6 @@ foreach $file (@files)
++$done } }
if ($done)
- { print "\n$program: $pattern is converted to$report\n" }
+ { print "\n$program : $pattern is converted to$report\n" }
else
- { print "\n$program: no filename matches $pattern\n" }
+ { print "\n$program : no filename matches $pattern\n" }
diff --git a/context/perltk/path_tre.pm b/context/perltk/path_tre.pm
new file mode 100644
index 000000000..546afcd27
--- /dev/null
+++ b/context/perltk/path_tre.pm
@@ -0,0 +1,36 @@
+#D \module
+#D [ file=path\_tre.pm,
+#D version=1999.05.05,
+#D title=Path modules,
+#D subtitle=selecting a path,
+#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 licen-en.pdf for
+#C details.
+
+#D Not yet documented, source will be cleaned up.
+
+package Tk::path_tre ;
+
+use Tk;
+require Tk::DirTree ;
+
+use base qw(Tk::DirTree);
+use strict;
+
+Construct Tk::Widget 'PathTree';
+
+sub ClassInit
+ { my ($class,$mw) = @_ ;
+ return $class -> SUPER::ClassInit ($mw) }
+
+sub dirnames
+ { my ( $w, $dir ) = @_ ;
+ unless ($dir=~/\//) { $dir .= '/' }
+ my @names = $w->Callback("-dircmd", $dir, $w->cget("-showhidden"));
+ return( @names ) }
+
+__END__
diff --git a/context/perltk/runperl.zip b/context/perltk/runperl.zip
index 4855544f0..2db7d8033 100644
Binary files a/context/perltk/runperl.zip and b/context/perltk/runperl.zip differ
diff --git a/context/perltk/texexec.pl b/context/perltk/texexec.pl
index 94205ca64..ca9eb8abc 100644
--- a/context/perltk/texexec.pl
+++ b/context/perltk/texexec.pl
@@ -2,8 +2,7 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
if 0;
# todo: second run of checksum of mp file with --nomprun changes
-
-# todo: merge wybo's enhanced help function
+# todo: merge wybo's enhanced help function [along with updating manual]
#D \module
#D [ file=texexec.pl,
@@ -49,7 +48,10 @@ my %Help ;
$ENV{"MPXCOMMAND"} = "0" ; # otherwise loop
-my $dosish = ($Config{'osname'} =~ /dos|mswin/i) ;
+my $TotalTime = time ;
+
+## $dosish = ($Config{'osname'} =~ /dos|mswin/i) ;
+my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ;
my $TeXUtil = 'texutil' ;
my $TeXExec = 'texexec' ;
@@ -128,7 +130,7 @@ my $MpyForce = 0 ;
my $RunPath = "" ;
my $Arguments = "" ;
my $Pretty = 0 ;
-my $SetFile = "" ;
+my $SetFile = "" ;
&GetOptions
( "arrange" => \$Arrange ,
@@ -198,6 +200,13 @@ my $SetFile = "" ;
"pretty" => \$Pretty ,
"setfile=s" => \$SetFile ) ;
+# a set file (like blabla.bat) can set paths now
+
+if ($SetFile ne "")
+ { load_set_file ($SetFile,$Verbose) ; $SetFile = "" }
+
+# later we will do a second attempt.
+
$SIG{INT} = "IGNORE" ;
if ($ARGV[0] =~ /\.mpx$/io) # catch -tex=.... bug in mpost
@@ -222,7 +231,7 @@ if (($LogFile ne '')&&($LogFile =~ /\w+\.log$/io))
*STDOUT = *LOGFILE ;
*STDERR = *LOGFILE }
-my $Program = " TeXExec 2.5 - ConTeXt / PRAGMA ADE 1997-2001" ;
+my $Program = " TeXExec 2.6 - ConTeXt / PRAGMA ADE 1997-2001" ;
print "\n$Program\n\n";
@@ -472,6 +481,11 @@ my $TcXPath = IniValue('TcXPath' , '' ) ;
$SetFile = IniValue('SetFile' , $SetFile ) ;
+if (($Verbose)&&($kpsewhich ne ''))
+ { print "\n" ;
+ my $CnfFile = `$kpsewhich -progname=context texmf.cnf` ;
+ chomp $CnfFile ;
+ print " applications will use : $CnfFile\n" }
if (($FmtLanguage)&&($MainLanguage eq 'standard'))
{ $MainLanguage = $FmtLanguage }
@@ -480,8 +494,6 @@ if (($FmtBodyFont)&&($MainBodyFont eq 'standard'))
if (($FmtResponse)&&($MainResponse eq 'standard'))
{ $MainResponse = $FmtResponse }
-if ($Verbose) { print "\n" }
-
if ($TeXFormatFlag eq "" )
{ $TeXFormatFlag = "&" }
@@ -497,21 +509,24 @@ if ($TeXProgram)
my $fmtutil = '' ;
-if ($Alone)
- { if ($Verbose)
- { print " generating format : not using fmtutil\n" } }
-elsif ($TeXShell =~ /tetex|fptex/i)
- { foreach (@paths)
- { my $p = checked_path($_) . 'fmtutil' ;
- if (-e $p)
- { $fmtutil = $p ; last }
- elsif (-e $p . '.exe')
- { $fmtutil = $p . '.exe' ; last } }
- if ($Verbose)
- { if ($fmtutil eq '')
- { print " locating fmtutil : not found in path\n" }
- else
- { print " locating fmtutil : found\n" } } }
+if ($MakeFormats||$Verbose)
+ { if ($Alone)
+ { if ($Verbose)
+ { print " generating format : not using fmtutil\n" } }
+ elsif ($TeXShell =~ /tetex|fptex/i)
+ { foreach (@paths)
+ { my $p = checked_path($_) . 'fmtutil' ;
+ if (-e $p)
+ { $fmtutil = $p ; last }
+ elsif (-e $p . '.exe')
+ { $fmtutil = $p . '.exe' ; last } }
+ if ($Verbose)
+ { if ($fmtutil eq '')
+ { print " locating fmtutil : not found in path\n" }
+ else
+ { print " locating fmtutil : $fmtutil\n" } } } }
+
+if ($Verbose) { print "\n" }
unless ($TeXScriptsPath)
{ $TeXScriptsPath = $own_path }
@@ -814,7 +829,7 @@ sub CheckOutputFormat
{ $FullFormat = $OutputFormat } } # 'standard' to terminal
sub MakeOptionFile
- { my ($FinalRun, $FastDisabled, $JobName) = @_ ;
+ { my ($FinalRun, $FastDisabled, $JobName, $JobSuffix) = @_ ;
open (OPT, ">$JobName.top") ;
print OPT "\\unprotect\n" ;
if ($Result) # no '' test
@@ -853,7 +868,7 @@ sub MakeOptionFile
elsif (/.5.4/goi)
{ print OPT "\\setuppapersize[A5][A4]\n" }
elsif (!/standard/)
- { $_ = uc $_ ; my ($from,$to) = split (/\*/) ;
+ { s/x/\*/io ; $_ = uc $_ ; my ($from,$to) = split (/\*/) ;
if ($to eq "") { $to = $from }
print OPT "\\setuppapersize[$from][$to]\n" } }
if (($PdfSelect||$PdfCombine||$PdfCopy||$PdfArrange)&&($Background ne ''))
@@ -881,6 +896,8 @@ sub MakeOptionFile
{ print OPT "\\setupenv[$Arguments]\n" }
if ($Input)
{ print OPT "\\setupsystem[inputfile=$Input]\n" }
+ else
+ { print OPT "\\setupsystem[inputfile=$JobName.$JobSuffix]\n" }
if ($Mode)
{ print OPT "\\enablemode[$Mode]\n" }
if ($Pages)
@@ -1184,44 +1201,44 @@ sub CheckChanges # also tub
if (open(MP, $MPJobName))
{ while ()
{ unless (/random/oi)
- { $checksum += do { unpack("%32C*",) % 65535 } } }
+ { $checksum += do { unpack("%32C*",) % 65535 } } }
close (MP) }
$MPJobName = MPJobName($JobName,"mprun") ;
if (open(MP, $MPJobName))
{ while ()
{ unless (/random/oi)
- { $checksum += do { unpack("%32C*",) % 65535 } } }
+ { $checksum += do { unpack("%32C*",) % 65535 } } }
close(MP) }
return $checksum }
+my $DummyFile = 0 ;
+
sub RunConTeXtFile
{ my ($JobName, $JobSuffix) = @_ ;
$JobName =~ s/\\/\//goi ;
$RunPath =~ s/\\/\//goi ;
- my $DummyFile = 0 ;
+ my $OriSuffix = $JobSuffix ;
if (-e "$JobName.$JobSuffix")
- { $DummyFile = ($JobSuffix =~ /xml/io) }
+ { $DummyFile = ($JobSuffix =~ /(xml|xsd)/io) }
elsif (($RunPath)&&(-e "$RunPath/$JobName.$JobSuffix"))
{ $DummyFile = 1 }
if ($DummyFile)
- { open (TMP,">$JobName.tex") ;
- if ($JobSuffix =~ /xml/io)
+ { open (TMP,">$JobName.run") ;
+ if ($JobSuffix =~ /(xml|xsd)/io)
{ if ($Filters ne "")
{ print " using xml filters : $Filters\n" }
- print TMP "\\ifx\\processXMLfile\\undefined\n" ;
- print TMP " \\let\\processXMLfile\\processfile\n" ;
- print TMP "\\fi\n" ;
print TMP "\\starttext\n" ;
- print TMP "\\processXMLfilegrouped{$JobName.xml}\n" ;
+ print TMP "\\processXMLfilegrouped{$JobName.$JobSuffix}\n" ;
print TMP "\\stoptext\n" }
else
{ print TMP "\\processfile{$JobName}\n" }
close (TMP) ;
- $JobSuffix = "tex" }
+ $JobSuffix = "run" }
if (-e "$JobName.$JobSuffix")
- { ScanPreamble ("$JobName.$JobSuffix") ;
- if ($ConTeXtInterface eq "unknown")
- { ScanContent ("$JobName.$JobSuffix") }
+ { unless ($Dummy) # we don't need this for xml
+ { ScanPreamble ("$JobName.$JobSuffix") ;
+ if ($ConTeXtInterface eq "unknown")
+ { ScanContent ("$JobName.$JobSuffix") } }
if ($ConTeXtInterface eq "unknown")
{ $ConTeXtInterface = $UserInterface }
if ($ConTeXtInterface eq "unknown")
@@ -1286,7 +1303,7 @@ sub RunConTeXtFile
$Problems = 0 ;
my $TeXRuns = 0 ;
if (($PdfArrange)||($PdfSelect)||($RunOnce))
- { MakeOptionFile (1, 1, $JobName) ;
+ { MakeOptionFile (1, 1, $JobName, $OriSuffix) ;
print "\n" ;
$Problems = RunTeX($JobName, $JobSuffix) ;
if ($ForceTeXutil)
@@ -1296,7 +1313,7 @@ sub RunConTeXtFile
PopResult($JobName) }
else
{ while (!$StopRunning&&($TeXRuns<$NOfRuns)&&(!$Problems))
- { MakeOptionFile (0, 0, $JobName) ;
+ { MakeOptionFile (0, 0, $JobName, $OriSuffix) ;
++$TeXRuns ;
print " TeX run : $TeXRuns\n\n" ;
my $mpchecksumbefore = $mpchecksumafter = 0 ;
@@ -1315,14 +1332,14 @@ sub RunConTeXtFile
if (($NOfRuns==1)&&$ForceTeXutil)
{ $Ok = RunTeXutil ($JobName) }
if ((!$Problems)&&(($FinalMode||$FinalRunNeeded))&&($NOfRuns>1))
- { MakeOptionFile (1, $FinalMode, $JobName) ;
+ { MakeOptionFile (1, $FinalMode, $JobName, $OriSuffix) ;
print " final TeX run : $TeXRuns\n\n" ;
$Problems = RunTeX($JobName, $JobSuffix) }
CopyFile("$JobName.top","$JobName.tmp") ;
unlink "$JobName.tup" ; # previous tuo file
unlink "$JobName.top" ; # runtime option file
PopResult($JobName) }
- if ($DummyFile)
+ if ($DummyFile) # $JobSuffix == run
{ unlink "$JobName.$JobSuffix" } } }
sub RunSomeTeXFile
@@ -1354,19 +1371,27 @@ sub RunModule
next unless $Suffix =~ /(tex|mp|pl|pm)/io ;
DoRunModule($Name, $Suffix) } }
-sub DoRunModule
+# the next one can be more efficient: directly process ted
+# file a la --use=abr-01,mod-01
+
+sub DoRunModule
{ my ($FileName,$FileSuffix) = @_ ;
RunPerlScript ($TeXUtil, "--documents $FileName.$FileSuffix" ) ;
print " module : $FileName\n\n" ;
open (MOD, ">$ModuleFile.tex") ;
- # print MOD "% format=dutch\n" ;
- print MOD "\\gebruikmodule[abr-01,mod-01]\n" ;
+ # we need to signal to texexec what interface to use
+ open(TED, "$FileName.ted") ; my $firstline = ; close (TED) ;
+ if ($firstline =~ /interface=en/)
+ { print MOD $firstline }
+ else
+ { print MOD "% interface=nl\n" }
+ # so far
+ print MOD "\\usemodule[abr-01,mod-01]\n" ;
print MOD "\\def\\ModuleNumber{1}\n" ;
print MOD "\\starttekst\n" ;
- print MOD "\\input $FileName.ted\n" ;
+ print MOD "\\readlocfile{$FileName.ted}{}{}\n" ;
print MOD "\\stoptekst\n" ;
close (MOD) ;
- # $ConTeXtInterface = "nl" ;
RunConTeXtFile($ModuleFile, "tex") ;
if ($FileName ne $ModuleFile)
{ foreach my $FileSuffix ("dvi", "pdf", "tui", "tuo", "log")
@@ -1526,8 +1551,8 @@ sub RunSelect
# { print " papersize : $PaperFormat\n" ;
# print SEL "\\setuppapersize[$PaperFormat][$PaperFormat]\n" }
#
- { $_ = $PaperFormat ; # NO UPPERCASE !
- my ($from,$to) = split (/\*/) ;
+ { $_ = $PaperFormat ; # NO UPPERCASE !
+ s/x/\*/io ; my ($from,$to) = split (/\*/) ;
if ($to eq "") { $to = $from }
print " papersize : $PaperFormat\n" ;
print SEL "\\setuppapersize[$from][$to]\n" }
@@ -1599,7 +1624,7 @@ sub RunCopy
sub RunCombine
{ my $FileName = shift ;
print " pdffile : $FileName\n" ;
- my ($nx,$ny) = split (/\*/,$Combination,2) ;
+ $Combination =~ s/x/\*/io ; my ($nx,$ny) = split (/\*/,$Combination,2) ;
return unless ($nx&&$ny) ;
print " combination : $Combination\n" ;
open (COM, ">$CombineFile.tex") ;
@@ -1608,9 +1633,9 @@ sub RunCombine
# { print " papersize : $PaperFormat\n" ;
# print COM "\\setuppapersize\n" ;
# print COM " [$PaperFormat][$PaperFormat]\n" }
-# see RunSelect
- { $_ = $PaperFormat ; # NO UPPERCASE !
- my ($from,$to) = split (/\*/) ;
+# see RunSelect
+ { $_ = $PaperFormat ; # NO UPPERCASE !
+ s/x/\*/io ; my ($from,$to) = split (/\*/) ;
if ($to eq "") { $to = $from }
print " papersize : $PaperFormat\n" ;
print COM "\\setuppapersize[$from][$to]\n" }
@@ -1853,6 +1878,8 @@ $TexFound = $MergeBE || /btex .*? etex/o ;
if ($MergeBE)
{ s/beginfig\s*\((\d+)\)\s*\;/beginfig($1)\;\n$mpbetex{$1}\n/goims }
# flush
+ unless (/beginfig\s*\(\s*0\s*\)/gmois)
+ { print MP $mpbetex{0} }
print MP $_ ;
print MP "end .\n" ;
close(MP) }
@@ -1861,7 +1888,7 @@ $TexFound = $MergeBE || /btex .*? etex/o ;
$Problems = system ("$MpToTeXExecutable $MpFile > $MpTex" ) ;
if (-e $MpTex && !$Problems)
{ open (TMP,">>$MpTex") ;
- print TMP "\\end\n" ; # to be sure
+ print TMP "\\end\{document\}\n" ; # to be sure
close (TMP) ;
if (($Format eq '')||($Format =~ /^cont.*/io))
{ $OutputFormat = "dvips" ;
@@ -1871,8 +1898,8 @@ $TexFound = $MergeBE || /btex .*? etex/o ;
if (-e $MpDvi && !$Problems)
{ print " dvi to metapost : $MpName\n" ;
$Problems = system ("$DviToMpExecutable $MpDvi $MpName.mpx") }
-# $Problems = system ("dvicopy $MpDvi texexec.dvi") ;
-# $Problems = system ("$DviToMpExecutable texexec.dvi $MpName.mpx") }
+ # $Problems = system ("dvicopy $MpDvi texexec.dvi") ;
+ # $Problems = system ("$DviToMpExecutable texexec.dvi $MpName.mpx") }
unlink $MpTex ;
unlink $MpDvi } }
print " metapost : $MpName\n" ;
@@ -1923,7 +1950,7 @@ sub load_set_file
my ($file, $trace) = @_ ;
if (open(BAT,$file))
{ while ()
- { chomp ;
+ { chomp ;
if (/\s*SET\s+(.+?)\=(.+)\s*/io)
{ my ($var,$val) = ($1, $2) ;
$val =~ s/\%(.+?)\%/$ENV{$1}/goi ;
@@ -1967,4 +1994,8 @@ else
{ print $Help{HELP} ;
unless ($Verbose) { print $Help{VERBOSE} } }
+$TotalTime = time - $TotalTime ;
+
+print "\n total run time : $TotalTime seconds\n" ;
+
if ($Problems) { exit 1 }
diff --git a/context/perltk/texexec.rme b/context/perltk/texexec.rme
index 91a0adc92..30ecfedf0 100644
--- a/context/perltk/texexec.rme
+++ b/context/perltk/texexec.rme
@@ -51,7 +51,7 @@ set TeXShell to tetex
%
% Here are some general defaults. They can be overruled later.
-set UsedInterfaces to en nl de uk
+set UsedInterfaces to en nl metafun mptopdf
set UserInterface to en
set TeXExecutable to tex
@@ -89,7 +89,7 @@ for fptex set TeXPassString to -progname=context
for fptex set TeXBatchFlag to -int=batchmode
for fptex set MpToTeXExecutable to mpto
for fptex set MpVirginFlag to -ini
-for fptex set MpPassString to -progname=mpost
+for fptex set MpPassString to -progname=mpost
for fptex set MpBatchFlag to -int=batchmode
% MikTeX users probably have to set up some paths too.
@@ -100,7 +100,7 @@ for miktex set TeXPassString to --alias=context
for miktex set TeXBatchFlag to --interaction=batchmode
for miktex set MpToTeXExecutable to mptotex
for miktex set MpVirginFlag to --initialize
-for miktex set MpPassString to --alias=mpost
+for miktex set MpPassString to --alias=mpost
for miktex set MpBatchFlag to --interaction=batchmode
for miktex set TeXFormatFlag to --undump=
diff --git a/context/perltk/texfind.pl b/context/perltk/texfind.pl
new file mode 100644
index 000000000..53a560c79
--- /dev/null
+++ b/context/perltk/texfind.pl
@@ -0,0 +1,270 @@
+eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
+ if 0;
+
+#D \module
+#D [ file=texfind.pl,
+#D version=1998.05.10,
+#D title=\TEXFIND,
+#D subtitle=searching files,
+#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 licen-en.pdf for
+#C details.
+
+# test with "doif(un|)defined"
+
+use strict ;
+use Getopt::Long ;
+use File::Find ;
+use Cwd ;
+use Tk ;
+use Tk::widgets ;
+use Tk::ROText ;
+
+use FindBin ;
+use lib $FindBin::Bin ;
+use path_tre ;
+
+my $FileSuffix = 'tex' ;
+my $SearchString = '' ;
+my $Recurse = 0 ;
+my $NumberOfHits = 0 ;
+my $QuitSearch = 0 ;
+my $Location = '' ;
+my $currentpath = '.' ;
+
+my @FileList ;
+
+my ($dw, $mw, $log, $sea, $fil, $num, $but, $dir, $loc) ;
+
+$mw = MainWindow -> new () ;
+$dw = MainWindow -> new () ;
+
+$mw -> protocol( 'WM_DELETE_WINDOW' => sub { exit } ) ;
+$dw -> protocol( 'WM_DELETE_WINDOW' => sub { exit } ) ;
+
+$log = $mw -> Scrolled ( 'ROText' ,
+ -scrollbars => 'se' ,
+ -font => 'courier' ,
+ -wrap => 'none' ,
+ -width => 65 ,
+ -height => 22 )
+ -> pack ( -side => 'bottom' ,
+ -padx => 2 ,
+ -pady => 2 ,
+ -expand => 1 ,
+ -fill => 'both' ) ;
+
+$sea = $mw -> Entry ( -textvariable => \$SearchString ,
+ -font => 'courier' ,
+ -width => 20 )
+ -> pack ( -side => 'left' ,
+ -padx => 2 ,
+ -pady => 2 ) ;
+
+$fil = $mw -> Entry ( -textvariable => \$FileSuffix ,
+ -font => 'courier' ,
+ -width => 5 )
+ -> pack ( -side => 'left' ,
+ -padx => 2 ,
+ -pady => 2 ) ;
+
+$but = $mw -> Checkbutton ( -variable => \$Recurse ,
+ -text => 'recurse' )
+ -> pack ( -side => 'left' ) ;
+
+$num = $mw -> Entry ( -textvariable => \$NumberOfHits ,
+ -font => 'courier' ,
+ -justify => 'right' ,
+ -width => 5 )
+ -> pack ( -side => 'right' ,
+ -padx => 2 ,
+ -pady => 2 ) ;
+
+$loc = $mw -> Entry ( -textvariable => \$Location ,
+ -font => 'courier' ,
+ -width => 8 )
+ -> pack ( -side => 'right' ,
+ -padx => 2 ,
+ -pady => 2 ) ;
+
+sub BuildDir
+ { if (Exists($dir)) { $dir -> destroy } ;
+ $dir = $dw -> Scrolled ( 'PathTree' ,
+ -scrollbars => 'se' )
+ -> pack ( -expand => 1 ,
+ -fill => 'both' ,
+ -padx => 2 ,
+ -pady => 2 ) ;
+ $dir -> configure ( -font => 'courier' ,
+ -height => 24 ,
+ -width => 65 ,
+ -selectbackground => 'blue3' ,
+ -browsecmd => \&ChangePath ) ;
+ $dir -> bind ('' , \&ShowFile ) ;
+ $dir -> bind ('' , \&ShowFile ) }
+
+BuildDir ;
+
+sub ShowFile { $mw -> raise ; $sea -> focusForce }
+sub ShowPath { $dw -> raise ; $dir -> focusForce }
+
+$log -> tagConfigure ( 'found', -foreground => 'green3' ) ;
+$log -> tagConfigure ( 'title', -foreground => 'blue3' ) ;
+
+$sea -> bind ('' , \&LocateStrings ) ;
+$fil -> bind ('' , \&LocateStrings ) ;
+$loc -> bind ('' , \&ChangeLocation ) ;
+$log -> bind ('' , \&ShowPath ) ;
+
+$sea -> bind ('' , \&QuitSearch ) ;
+$fil -> bind ('' , \&QuitSearch ) ;
+$loc -> bind ('' , \&QuitSearch ) ;
+
+$sea -> bind ('' , \&QuitSearch ) ;
+$fil -> bind ('' , \&QuitSearch ) ;
+$loc -> bind ('' , \&QuitSearch ) ;
+$log -> bind ('' , \&QuitSearch ) ;
+
+$sea -> bind ('' , \&LocateStrings ) ;
+$fil -> bind ('' , \&LocateStrings ) ;
+$loc -> bind ('' , \&ChangeLocation ) ;
+$log -> bind ('' , \&ShowPath ) ;
+
+sub ChangePath
+ { my $currentpath = shift ;
+chdir($currentpath) ;
+ $QuitSearch = 1 ;
+ $log -> delete ('1.0', 'end') ;
+ $log -> insert ('end', "$currentpath\n\n", 'title') }
+
+sub ChangeLocation
+ { $QuitSearch = 1 ;
+ $log -> delete ('1.0', 'end') ;
+ $Location =~ s/^\s*//o ;
+ $Location =~ s/\s*$//o ;
+ $Location =~ s/(\\|\/\/)/\//go ;
+ unless (-d $Location)
+ { unless ($Location =~ /\//) { $Location .= '/' } }
+ if (-d $Location)
+ { $log -> insert ('end', "changed to location '$Location'\n\n", 'title') ;
+ $currentpath = $Location ;
+ chdir ($currentpath) ;
+ $dir -> destroy ;
+ BuildDir ;
+ $dw -> raise ;
+ $dw -> focusForce }
+ else
+ { $log -> insert ('end', "unknown location '$Location'\n\n", 'title') ;
+ $Location = '' } }
+
+sub QuitSearch
+ { $QuitSearch = 1 }
+
+sub SearchFile
+ { my ($FileName, $SearchString) = @_ ;
+ my $Ok = 0 ; my $len ;
+ open (TEX, $FileName) ;
+ my $LineNumber = 0 ;
+ while ()
+ { ++$LineNumber ;
+ if ($QuitSearch)
+ { if ($Ok) { $log -> see ('end') }
+ last }
+ if (/$SearchString/i)
+ { ++$NumberOfHits ; $num -> update ;
+ unless ($Ok)
+ { $Ok = 1 ;
+ $log -> insert ('end', "$FileName\n\n",'title') }
+ $log -> insert ('end', sprintf("%5i : ",$LineNumber), 'title') ;
+ s/^\s*//o ;
+#
+ $len = 0 ;
+ while (/(.*?)($SearchString)/gi)
+ { $len += length($1) + length($2) ;
+ $log -> insert ('end', "$1") ;
+ $log -> insert ('end', "$2", 'found' ) }
+ $_ = substr($_,$len) ;
+ $log -> insert ('end', "$_") ;
+#
+ $log -> update ;
+ $log -> see ('end') } }
+ if ($Ok) { $log -> insert ('end', "\n") }
+ close (TEX) }
+
+sub DoLocateFiles
+ { @FileList = () ;
+ $NumberOfHits = 0 ;
+ if ($FileSuffix ne "")
+ { $log -> delete ('1.0', 'end') ;
+ if ($Recurse)
+ { $log -> insert ('end', "recursively identifying files\n", 'title') ;
+ $log -> see ('end') ;
+ find (\&wanted, $currentpath) ;
+ sub wanted
+ { if ($QuitSearch) { last ; return }
+ if (/.*\.$FileSuffix/i)
+ { ++$NumberOfHits ; $num -> update ;
+ push @FileList, $File::Find::name } } }
+ else
+ { $log -> insert ('end', "identifying files\n", 'title') ;
+ $log -> see ('end') ;
+ opendir(DIR, $currentpath) ; my @TEMPLIST = readdir(DIR) ; closedir(DIR) ;
+ foreach my $FileName (@TEMPLIST)
+ { if ($FileName =~ /.*\.$FileSuffix/i)
+ { ++$NumberOfHits ; $num -> update ;
+ if ($QuitSearch)
+ { last }
+ push @FileList, $FileName } } }
+ @FileList = sort @FileList } }
+
+sub DoLocateStrings
+ { $log -> delete ('1.0', 'end') ;
+ $log -> update ;
+ $log -> see ('end') ;
+ $NumberOfHits = 0 ;
+ if ($SearchString ne "")
+ { foreach my $FileName (@FileList)
+ { if ($QuitSearch)
+ { $log -> insert ('end', "search aborted\n", 'title') ;
+ $log -> see ('end') ;
+ last }
+ SearchFile($FileName,$SearchString) } }
+ unless ($QuitSearch)
+ { $log -> insert ('end', "done\n", 'title') ;
+ $log -> see ('end') } }
+
+sub LocateStrings
+ { $QuitSearch = 0 ;
+ DoLocateFiles() ;
+ DoLocateStrings() }
+
+$log -> insert ('end',
+
+ "data fields\n\n" , '' ,
+
+
+ "string :", 'title', " regular expression to search for\n" , '' ,
+ "suffix :", 'title', " type of file to search in\n" , '' ,
+ "recurse :", 'title', " enable searching subpaths\n" , '' ,
+ "location :", 'title', " drive of root path\n" , '' ,
+ "counter :", 'title', " file/hit counter\n\n" , '' ,
+
+ "key bindings\n\n" , '' ,
+
+ "double 1 :", 'title', " directory window <-> search window\n" , '' ,
+ "enter :", 'title', " start searching\n" , '' ,
+ "escape :", 'title', " quit searching\n\n" , '' ,
+
+ "current path\n\n" , '' ,
+
+ cwd(), 'title', "\n\n" , 'title' ) ;
+
+$log -> update ;
+
+ShowPath ;
+
+MainLoop() ;
diff --git a/context/perltk/texfont.pl b/context/perltk/texfont.pl
index 3eae039ba..3b86e9cd0 100644
--- a/context/perltk/texfont.pl
+++ b/context/perltk/texfont.pl
@@ -1,6 +1,9 @@
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $argv:q'
if 0;
+# This is an example of a crappy unstructured file but once
+# I know what should happen exactly, I will clean it up.
+
#D \module
#D [ file=texfont.pl,
#D version=2000.12.14,
@@ -20,10 +23,13 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
#D Todo : Wybo's help system
#D Todo : list of encodings [texnansi, ec, textext]
+#D Thanks to George N. White III for solving a couple of bugs.
+
use strict ;
my $savedoptions = join (" ",@ARGV) ;
+use Config ;
use File::Copy ;
use Getopt::Long ;
@@ -33,11 +39,15 @@ $Getopt::Long::autoabbrev = 1 ; # partial switch accepted
# Unless a user has specified an installation path, we take
# the dedicated font path or the local path.
+## $dosish = ($Config{'osname'} =~ /dos|mswin/i) ;
+my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ;
+
my $installpath = "" ; my @searchpaths = () ;
if (defined($ENV{TEXMFLOCAL})) { $installpath = "TEXMFLOCAL" }
if (defined($ENV{TEXMFFONTS})) { $installpath = "TEXMFFONTS" }
+if ($installpath eq "") { $installpath = "TEXMFFONTS" } # redundant
if ($installpath eq "") { $installpath = "TEXMFLOCAL" } # redundant
@searchpaths = ('TEXMFFONTS','TEXMFLOCAL','TEXMFMAIN') ;
@@ -45,7 +55,7 @@ if ($installpath eq "") { $installpath = "TEXMFLOCAL" } # redundant
my $encoding = "texnansi" ;
my $vendor = "" ;
my $collection = "" ;
-my $fontroot = "" ;
+my $fontroot = "" ; #/usr/people/gwhite/texmf-fonts" ;
my $help = 0 ;
my $makepath = 0 ;
my $show = 0 ;
@@ -59,6 +69,7 @@ my $caps = "" ;
my $noligs = 0 ;
my $test = 0 ;
my $virtual = 0 ;
+my $novirtual = 0 ;
my $listing = 0 ;
my $remove = 0 ;
@@ -96,11 +107,16 @@ my $width = "" ;
"remove" => \$remove,
"test" => \$test,
"virtual" => \$virtual,
+ "novirtual" => \$novirtual,
"caps=s" => \$caps,
"batch" => \$batch,
"weight=s" => \$weight,
"width=s" => \$width) ;
+# so we can use both combined
+
+if (!$novirtual) { $virtual = 1 }
+
# A couple of routines.
sub report
@@ -119,7 +135,7 @@ sub error
# The banner.
print "\n" ;
-report ("TeXFont 1.3 - ConTeXt / PRAGMA ADE 2000-2001 (STILL BETA)") ;
+report ("TeXFont 1.5 - ConTeXt / PRAGMA ADE 2000-2001 (STILL BETA)") ;
print "\n" ;
# Handy for scripts: one can provide a preferred path, if it
@@ -163,8 +179,11 @@ if (($weight ne "")||($width ne ""))
if (($listing||$remove)&&($sourcepath eq "."))
{ $sourcepath = "auto" }
-if ($fontroot eq "")
- { $fontroot = `kpsewhich -expand-path=\$$installpath` ;
+if ($fontroot eq "")
+ { if ($dosish)
+ { $fontroot = `kpsewhich --expand-path=\$$installpath` }
+ else
+ { $fontroot = `kpsewhich --expand-path=\\\$$installpath` }
chomp $fontroot }
if ($test)
@@ -237,9 +256,9 @@ if (($batch)||($ARGV[0] =~ /.+\.dat$/io))
{ $selecting = 1 ; next }
else
{ next } }
- else
- { next if (/^\s*[\#\%]/io) ;
- next unless (/\-\-/oi) }
+ else
+ { next if (/^\s*[\#\%]/io) ;
+ next unless (/\-\-/oi) }
s/\s+/ /gio ;
s/(--en.*\=)\?/$1$encoding/io ;
report ("batch line : $_") ;
@@ -253,11 +272,14 @@ error ("unknown tex root $lcfontroot") unless -d $fontroot ;
my $identifier = "$encoding-$vendor-$collection" ;
-my $outlinepath = $sourcepath ;
+my $outlinepath = $sourcepath ; my $path = "" ;
if ($sourcepath eq "auto")
{ foreach my $root (@searchpaths)
- { my $path = `kpsewhich -expand-path=\$$root` ;
+ { if ($dosish)
+ { $path = `kpsewhich -expand-path=\$$root` }
+ else
+ { $path = `kpsewhich -expand-path=\\\$$root` }
chomp $path ;
$sourcepath = "$path/fonts/afm/$vendor/$collection" ;
unless (-d $sourcepath)
@@ -321,7 +343,7 @@ my $pfbpath = "$fontroot/fonts/type1/$vendor/$collection" ;
my $pdfpath = "$fontroot/pdftex/config" ;
sub do_make_path
- { my $str = shift ; mkdir $str, 755 unless -d $str }
+ { my $str = shift ; mkdir $str, 0755 unless -d $str }
sub make_path
{ my $str = shift ;
@@ -391,6 +413,7 @@ sub copy_files
if ($install)
{ copy_files("afm",$sourcepath,$afmpath) ;
+# copy_files("tfm",$sourcepath,$tfmpath) ; # raw supplied names
copy_files("pfb",$outlinepath,$pfbpath) }
error ("no afm files found") unless @files ;
@@ -400,8 +423,11 @@ my $map = my $tex = 0 ; my $mapdata = my $texdata = "" ;
copy ("$pdfpath/$mapfile","$pdfpath/$bakfile") ;
if (open (MAP,"<$pdfpath/$mapfile"))
- { while (
+%D \stopbuffer
+%D
+%D \showelements [context] [p]
+
+\defineXMLenvironment [context:p] {} \endgraf
+\defineXMLsingular [context:p] \endgraf
+
+%D \elements {pageref,textref,lineref}
+%D
+%D \startbuffer
+%D You can ask for a page (the last pagenumber
+%D is aka page ), text or line reference
+%D with the following three elements. The label may be any valid &context;
+%D reference label.
+%D \stopbuffer
+%D
+%D \showelements [context] [references]
+
+\defineXMLpickup [context:pageref] [label=] {\op} {[\XMLop{label}]}
+\defineXMLpickup [context:textref] [label=] {\in} {[\XMLop{label}]}
+\defineXMLpickup [context:lineref] [label=] {\inline} {[\XMLop{label}]}
+
+%D \elements{text}
+%D
+%D \startbuffer
+%D If you have a self contained &xml; file, you need to signal &context; the
+%D begin and end of the document. The following elements can be used for
+%D that purpose:
+%D
+%D
+%D
+%D ...
+%D
+%D
+%D \stopbuffer
+%D
+%D \showelements [context] [text]
+
+\defineXMLenvironment [context:text] \starttext \stoptext
+
+%D \elements {em}
+%D
+%D \startbuffer
+%D Authors often want some control over the way a text is typeset, which is
+%D why we provide the em element. We may only hope that
+%D the author is consistent in his decisions on what to emphasize.
+%D \stopbuffer
+%D
+%D \showelements [context] [em]
+
+\defineXMLgrouped [context:em] \em
+
+%D \elements {b}
+%D
+%D \startbuffer
+%D Bold is not always beautiful but if you really want it, you can
+%D get it by using this element.
+%D \stopbuffer
+%D
+%D \showelements [context] [b]
+
+\defineXMLgrouped [context:b] \bf
+
+%D \elements {verbatim,typing,line,verb,type}
+%D
+%D \startbuffer
+%D Although the following method can be used to typeset a piece of code
+%D verbatim
+%D
+%D verbatim !
+%D ]]>
+%D
+%D we prefer the more structured:
+%D
+%D
+%D Dit \is nogal verbatim !
+%D Dit is {nogal} verbatim !
+%D Dit is verbatim !
+%D
+%D \stopbuffer
+%D
+%D The element to tag inline verbatim is .
+%D
+%D \showelements [context] [verbatim]
+
+\defineXMLenvironment [context:verbatim]
+ {\startopelkaar
+ \defineXMLargument[context:line]{\endgraf\type}}
+ {\stopopelkaar}
+
+\defineXMLenvironment [context:typing]
+ {\startpacked\defineXMLargument[context:line]{\endgraf\type}}
+ {\stoppacked}
+
+\defineXMLargument [context:verb] \type
+\defineXMLargument [context:type] \type
+
+%D \elements {itemize,item}
+%D
+%D \startbuffer
+%D Itemized lists are quite common in documents, al least in the ones that
+%D we produce. For the moment we only provide a few options, later we will
+%D hook it into the &context; attribute handler.
+%D
+%D
+%D - test
+%D - test
+%D
+%D
+%D
+%D - test
+%D - test what?
+%D
+%D \stopbuffer
+%D
+%D \showelements [context] [itemize]
+
+\defineXMLenvironment [context:itemize] [type=,packed=]
+ {\let\XMLoptions\empty
+ \doifsomethingXMLop{type}
+ {\addtocommalist{\XMLop{type}}\XMLoptions}
+ \doifXMLop{packed}{yes}
+ {\addtocommalist{packed}\XMLoptions}
+ \expanded{\startitemize[\XMLoptions]}}
+ {\stopitemize}
+
+\defineXMLenvironment [context:item] [label=]
+ {\expanded{\item[\XMLop{label}]}}
+ {\endgraf}
+
+%D \elements {fixed}
+%D
+%D \startbuffer
+%D Something fixed will end up at the place where it defined in the input
+%D stream. The main idea behind this element is that it gives you control
+%D over the placement.
+%D
+%D
+%D -
+%D
+%D
+%D
+%D
+%D
+%D
+%D
+%D \stopbuffer
+%D
+%D \showelements [context] [fixed]
+
+\defineXMLenvironment [context:fixed] [type=figure,location=,label=]
+ {\bgroup
+ \defineXMLsave[context:caption]
+ \defineXMLsave[context:content]}
+ {\expanded{\startfixed[\XMLop{location}]}
+ \doifXMLdataelse{context:caption}
+ {\startcombination[1*1]
+ {\XMLflush{context:content}} {\XMLflush{context:caption}}
+ \stopcombination}
+ {\XMLflush{context:content}}
+ \stopfixed
+ \egroup}
+
+%D \elements {float}
+%D
+%D \startbuffer
+%D A floating body will be placed at the first location available, unless
+%D a location is specified. As with the fixed element,
+%D you can prvide a caption.
+%D
+%D
+%D
+%D
+%D
+%D This is a cow!
+%D
+%D \stopbuffer
+%D
+%D \showelements [context] [float]
+
+\defineXMLenvironment [context:float] [type=figure,location=here,label=]
+ {\bgroup
+ \defineXMLsave[context:caption]
+ \defineXMLsave[context:content]}
+ {\expanded
+ {\placefloat
+ [\XMLop{type}] [\XMLop{location}] [\XMLop{label}]
+ {\XMLflush{context:caption}} {\XMLflush{context:content}}}
+ \egroup}
+
+%D \elements {externalfigure}
+%D
+%D \startbuffer
+%D The previous examples already demonstrated how we can include a graphic:
+%D
+%D
+%D
+%D
+%D \stopbuffer
+%D
+%D \showelements [context] [externalfigure]
+
+\defineXMLsingular [context:externalfigure] [\??ef] [base=,label=,file=]
+ {\bgroup % \getXMLta \expandXMLta \expandXMLtp{file}%
+ \expandXMLta \getXMLta % expand entities first
+ \doifelsenothing{\XMLtp{label}}
+ {\expanded{\externalfigure[\XMLtp{file}][\XMLta]}}
+ {\doifsomething{\XMLtp{base}}{\usefigurebase[\XMLtp{base}]}%
+ \expanded{\externalfigure[\XMLtp{label}][\XMLta]}}
+ \egroup}
+
+%D \elements {quotation,quote}
+%D
+%D \startbuffer
+%D There is a (not so) subtle difference between a display
+%D quotation and an inline
+%D one.
+%D \stopbuffer
+%D
+%D \showelements [context] [table]
+
+\defineXMLgrouped [context:quote] \quote
+\defineXMLgrouped [context:quotation] \quotation
+
+%D \elements {table,tr,td}
+%D
+%D \startbuffer
+%D There are (currently) three table mechanisms in &context;. One of them
+%D resembles the well known &html; tables.
+%D
+%D
+%D
+%D one | a | first |
+%D two | b | second |
+%D
+%D
+%D
+%D As you can see here, we use a similar syntax but stick to the &context;
+%D attributes (which provide quite advanced control over the layout).
+%D
+%D
+%D
+%D
+%D \stopbuffer
+%D
+%D \showelements [context] [table]
+
+\defineXMLenvironment [context:table] [\@@tbl\@@tbl]
+ {\bgroup
+ \defineXMLnested [context:tr] [\@@tbl] {\expanded{\bTR[\theXMLarguments{\@@tbl}}]} \eTR
+ \defineXMLnested [context:td] [\@@tbl] {\expanded{\bTD[\theXMLarguments{\@@tbl}}]} \eTD
+ \expanded{\bTABLE[\theXMLarguments{\@@tbl\@@tbl}]}}
+ {\eTABLE
+ \egroup}
+
+%D \elements {tabulate,tspec,thead,tbody,ttail,trule,tr,td}
+%D
+%D \startbuffer
+%D The second mechanism that we support is tabulation. The advantage of this
+%D mechanism is that it it well tuned for tables that hav emuch text in the
+%D cells and cross page boundaires.
+%D
+%D
+%D
+%D
+%D
+%D
+%D
+%D bagger | bagger | bagger |
+%D
+%D
+%D
+%D
+%D
+%D
+%D bagger | bagger | bagger |
+%D bagg | ger | gr |
+%D bag | er | gger |
+%D
+%D
+%D \stopbuffer
+%D
+%D \showelements [context] [tabulate]
+
+\newtoks\XMLtabtoks
+
+\defineXMLgrouped [context:tabulate] {\XMLtabtoks{|l|p|}}
+
+\defineXMLpickup [context:tbody]
+ {\expanded{\definetabulate[dummy][\the\XMLtabtoks]}
+ \startdummy\XMLflush{context:thead}}
+ {\XMLflush{context:ttail}\stopdummy}
+
+\defineXMLsave [context:thead]
+\defineXMLsave [context:ttail]
+
+\defineXMLenvironment[context:tspec]
+ {\XMLtabtoks\emptytoks}
+ {\appendtoks|\to\XMLtabtoks}
+
+\defineXMLsingular [context:trule] % verrrry ugly
+ {\crcr\noalign{\kern-\lineheight}\HL}
+
+\defineXMLsingular [context:tcell] [align=]
+ {\appendtoks|\to\XMLtabtoks
+ \processaction
+ [\XMLop{align}]
+ [ left=>\appendtoks l\to\XMLtabtoks,
+ right=>\appendtoks r\to\XMLtabtoks,
+ center=>\appendtoks c\to\XMLtabtoks,
+ middle=>\appendtoks c\to\XMLtabtoks]}
+
+\defineXMLenvironment [context:tr] {\ignorespaces} {\NC\NR}
+\defineXMLenvironment [context:td] {\NC} {\ignorespaces}
+
+%D \elements {hide}
+%D
+%D \startbuffer
+%D This is the way to [this is gone] something for the
+%D typesetting engine. Normally this element is only used for testing
+%D purposes.
+%D \stopbuffer
+%D
+%D \showelements [context] [tabulate]
+
+\defineXMLignore[context:hide]
+
+%D \elements {unknown}
+%D
+%D \startbuffer
+%D We can go on and on and with defining elements that map onto
+%D &context; commands, but why not just use &tex; input syntax then?
+%D \stopbuffer
+%D
+%D \showelements [context] [unknown]
+
+\defineXMLsingular [context:unknown] \unknown
+
+%D A (for the moment) private one.
+
+\defineXMLargument [context:element] \type
+
+%D The following common schema definitions apply:
+%D
+%D {\setupcolors[state=stop]\showXSDcomponent[context][definitions]}
+
+\defineXMLargument [context:chapter] [label=] {\chapter[\XMLop{label}]}
+\defineXMLargument [context:section] [label=] {\section[\XMLop{label}]}
+\defineXMLargument [context:subsection] [label=] {\subsection[\XMLop{label}]}
+\defineXMLargument [context:subsubsection] [label=] {\subsubsection[\XMLop{label}]}
+\defineXMLargument [context:subsubsubsection] [label=] {\subsubsubsection[\XMLop{label}]}
+
+\defineXMLargument [context:title] [label=] {\title[\XMLop{label}]}
+\defineXMLargument [context:subject] [label=] {\subject[\XMLop{label}]}
+\defineXMLargument [context:subsubject] [label=] {\subsubject[\XMLop{label}]}
+\defineXMLargument [context:subsubsubject] [label=] {\subsubsubject[\XMLop{label}]}
+\defineXMLargument [context:subsubsubsubject] [label=] {\subsubsubsubject[\XMLop{label}]}
+
+\defineXMLenvironment [context:frontmatter] \startfrontmatter \stopfrontmatter
+\defineXMLenvironment [context:bodymatter] \startbodymatter \stopbodymatter
+\defineXMLenvironment [context:backmatter] \startbackmatter \stopbackmatter
+\defineXMLenvironment [context:appendices] \startappendices \stopappendices
+
+\defineXMLargument [context:index] [key=]
+ {\doifelsenothingXMLop{key}{\index}{\expanded{\index[\XMLop{key}]}}}
+
+% \enableXMLfiledata
+
+\protect \endinput
diff --git a/tex/context/base/x-fdf-00.tex b/tex/context/base/x-fdf-00.tex
new file mode 100644
index 000000000..921757f56
--- /dev/null
+++ b/tex/context/base/x-fdf-00.tex
@@ -0,0 +1,40 @@
+%
+%
+%
+% first
+%
+%
+% second
+%
+%
+%
+%
+% previous method:
+%
+% object
+% data
+% fields
+% field
+
+\defineXMLprocess[fdf:xfdf]
+\defineXMLprocess[fdf:fields]
+\defineXMLignore [fdf:f]
+\defineXMLpush [fdf:value]
+
+\defineXMLenvironment [fdf:field] [name=,value=]
+ {\XMLerase{fdf:value}}
+ {\doglobal\saveXMLdata{fdf:\XMLop{name}}{fdf:value}}
+
+\defineXMLsingular [fdf:field] [name=,value=]
+ {\doglobal\saveasXMLdata{fdf:\XMLop{name}}{\XMLop{value}}}
+
+\def\flushFDFfield #1{\flushXMLelement {fdf:#1}}
+\def\processFDFfield#1{\processXMLelement{fdf:#1}}
+
+\def\loadFDFfile#1%
+ {\bgroup
+ \autoXMLnamespace[fdf]%
+ \processXMLfilegrouped{#1}%
+ \egroup}
+
+\endinput
diff --git a/tex/context/base/x-fig-00.tex b/tex/context/base/x-fig-00.tex
index 657cb56fa..e83584392 100644
--- a/tex/context/base/x-fig-00.tex
+++ b/tex/context/base/x-fig-00.tex
@@ -47,7 +47,6 @@
%D When will we talk about European cows?
%D
%D
-%D
%D
%D \stoptypen
%D
@@ -87,7 +86,7 @@
\unprotect
-\startXMLnamespace [-] [figbase]
+\startXMLmapping [-] [figbase]
\defineXMLprocess [figurelibrary]
\defineXMLignore [description]
@@ -99,7 +98,7 @@
\defineXMLpush [dummy]
\defineXMLenvironment [figure] \figbase@StartFigure \figbase@StopFigure
-\stopXMLnamespace
+\stopXMLmapping
\newcounter\figurefilepage
@@ -114,7 +113,8 @@
\def\getfigurefilename#1#2%
{\startnointerference
- \startXMLnamespace[-][figbase]
+ \traceXMLelementsfalse
+ \startXMLmapping[-][figbase]
\resetfigurefilebase
\XMLerase{file}
\XMLerase{dummy}
@@ -123,7 +123,7 @@
\doglobal\newcounter\figurefilepage
\def\askedlabel{#2}
\processXMLfilegrouped{#1.xml} % grouped ?
- \stopXMLnamespace
+ \stopXMLmapping
\stopnointerference}
\def\resetfigurefilebase%
@@ -156,7 +156,7 @@
\def\usefigurebase[#1]%
{\doifelse{#1}{\v!reset}
{\let\figurebaselist\empty}
- {\appendtocommalist{#1}\figurebaselist}}
+ {\addtocommalist{#1}\figurebaselist}}
\let\figurebaselist\empty
diff --git a/tex/context/base/x-fig-01.tex b/tex/context/base/x-fig-01.tex
index ece20f7b1..f4900fc4e 100644
--- a/tex/context/base/x-fig-01.tex
+++ b/tex/context/base/x-fig-01.tex
@@ -13,7 +13,7 @@
%D See \type {x-fig-00.tex} for more information on how to use
%D and generate figure databases. This file loads the file
-%D named \type {\inputfilename} (\TEXEXEC\ will set this
+%D named \type {\jobfilename} (\TEXEXEC\ will set this
%D variable). You can apply this style to a database by
%D saying:
%D
@@ -51,19 +51,20 @@
\usemodule[fig-00]
-\overcomePDFspacefalse
+\setupoutput[pdftex] \overcomePDFspacefalse
-\doifnothing {\inputfilename} {\end}
-\doiffileelse {\inputfilename.xml} {} {\end}
+\doifnothing {\jobfilename} {\end}
+\doiffileelse {\jobfilename.xml} {} {\end}
-\def\StartDescription%
+
+\def\StartDescription
{\bgroup
\defineXMLpush[organization]
\defineXMLpush[project]
\defineXMLpush[product]
\defineXMLpush[comment]}
-\def\StopDescription%
+\def\StopDescription
{\subject [begin] {Figure collection}
\starttabulate[|lBe|p|]
\doifXMLdataelse{organization}
@@ -78,10 +79,10 @@
\blank[2*big]
\egroup}
-\def\StartFigureA%
+\def\StartFigureA
{\bgroup
- \XMLassign{file}{buffer}
\defineXMLpush[file]
+ \XMLassign{file}{buffer}
\defineXMLpush[dummy]
\defineXMLpush[label]
\defineXMLpush[copyright]
@@ -101,7 +102,7 @@
{\bf \XMLpop{dummy}}
\stopbuffer
-\def\StopFigureA%
+\def\StopFigureA
{\doglobal\increment\CurrentPage
\setupbackgrounds[page][background=page]
\doifelsenothing{\XMLpop{label}}
@@ -113,7 +114,7 @@
\setupbackgrounds[page][background=]
\egroup}
-\def\StartFigureB%
+\def\StartFigureB
{\StartFigureA}
\defineregister
@@ -167,7 +168,7 @@
rulethickness=1pt,
framecolor=darkred]
-\def\StopFigureB%
+\def\StopFigureB
{\par
\doglobal\increment\CurrentPage
\doifelsenothing{\XMLpop{label}}
@@ -244,10 +245,10 @@
\vskip10pt
\egroup}
-\def\StartFigureC%
+\def\StartFigureC
{\StartFigureA}
-\def\StopFigureC%
+\def\StopFigureC
{\doglobal\increment\NumberOfFigures
\egroup}
@@ -319,7 +320,7 @@
\doglobal\newcounter\CurrentPage
-\processXMLfilegrouped{\inputfilename.xml}
+\processXMLfilegrouped{\jobfilename.xml}
\increment\NumberOfFigures
@@ -333,7 +334,7 @@
\doglobal\newcounter\CurrentPage
-\processXMLfilegrouped{\inputfilename.xml}
+\processXMLfilegrouped{\jobfilename.xml}
\setuppapersize
[S6][S6]
@@ -350,7 +351,7 @@
\doglobal\newcounter\CurrentPage
-\processXMLfilegrouped{\inputfilename.xml} \page
+\processXMLfilegrouped{\jobfilename.xml} \page
\subject [list] {List of figures}
diff --git a/tex/context/base/x-fig-02.tex b/tex/context/base/x-fig-02.tex
index 13e601819..1bdfc2f11 100644
--- a/tex/context/base/x-fig-02.tex
+++ b/tex/context/base/x-fig-02.tex
@@ -34,15 +34,15 @@
\usemodule[fig-00]
-\doifnothing {\inputfilename} {\end}
-\doiffileelse {\inputfilename.xml} {} {\end}
+\doifnothing {\jobfilename} {\end}
+\doiffileelse {\jobfilename.xml} {} {\end}
\defineXMLenvironment [figurelibrary] \StartLibrary \StopLibrary
\defineXMLignore [description]
\defineXMLenvironment [figure] \StartFigure \StopFigure
\def\StartLibrary
- {\immediate\openout \scratchwrite=\inputfilename.fig
+ {\immediate\openout \scratchwrite=\jobfilename.fig
\immediate\write\scratchwrite{\string\input\space x-fig-03.tex \string\relax}
\immediate\write\scratchwrite{}}
@@ -64,13 +64,13 @@
\immediate\write\scratchwrite
{\string\setfiguredata\space
{\XMLpop{label}}
- {\inputfilename}
+ {\jobfilename}
{\CurrentPage}}}
\doglobal\newcounter\CurrentPage
\starttext
-\processXMLfilegrouped{\inputfilename.xml}
+\processXMLfilegrouped{\jobfilename.xml}
\stoptext
diff --git a/tex/context/base/x-mathml.tex b/tex/context/base/x-mathml.tex
new file mode 100644
index 000000000..5c36c35fb
--- /dev/null
+++ b/tex/context/base/x-mathml.tex
@@ -0,0 +1,48 @@
+%D \module
+%D [ file=m-mathml,
+%D version=1999.12.20,
+%D title=\CONTEXT\ XML Modules,
+%D subtitle=Loading \MATHML\ Filters,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE / 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.
+
+%D We have to make sure that some basic entities are
+%D loaded:
+
+\useXMLfilter[ent]
+
+%D Then we load the math:
+
+\useXMLfilter[mml,mmp,mmc]
+
+%D And we also load the whole bunch of entities:
+
+% \useXMLfilter[mea,meb,mec,meh,men,meo,mer]
+% \useXMLfilter[mxa,mxb,mxc,mxh,mxn,mxo,mxr]
+
+%D For simple inline math, we first provide:
+
+\newcount\xmlmathlevel % todo : nesting ! ! ! !
+
+\defineXMLenvironment [m] \startXMLinlinemath \stopXMLinlinemath
+
+\def\startXMLinlinemath
+ {\ifmmode
+ \advance\xmlmathlevel1\relax
+ \else
+ \xmlmathlevel1$%
+ \fi}
+
+\def\stopXMLinlinemath
+ {\ifcase\xmlmathlevel\or
+ $\xmlmathlevel0\relax
+ \else
+ \advance\xmlmathlevel-1\relax
+ \fi}
+
+\endinput
diff --git a/tex/context/base/x-physml.tex b/tex/context/base/x-physml.tex
new file mode 100644
index 000000000..0b9799a34
--- /dev/null
+++ b/tex/context/base/x-physml.tex
@@ -0,0 +1,16 @@
+%D \module
+%D [ file=m-physml,
+%D version=2001.09.04,
+%D title=\CONTEXT\ XML Modules,
+%D subtitle=Loading \PHYSML\ Filters,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE / 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.
+
+\usemodule[units] \useXMLfilter[pml,pmu]
+
+\endinput
diff --git a/tex/context/base/x-sch-00.tex b/tex/context/base/x-sch-00.tex
new file mode 100644
index 000000000..97b266d5e
--- /dev/null
+++ b/tex/context/base/x-sch-00.tex
@@ -0,0 +1,382 @@
+%D \module
+%D [ file=x-sch-00,
+%D version=2001.10.02,
+%D title=\CONTEXT\ Style File,
+%D subtitle=XML Schema Basics,
+%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.
+
+%D Schema support was implemented right after euro\TeX\ 2001,
+%D when Tobias Burnus send me a schema for the XML figure
+%D base. Since it happened that I needed schemata for other
+%D projects too, I wrote this mapper. Thanks to Tobias for
+%D testing it.
+
+\newcounter\XSDprefix
+\newif\ifXDScomposite
+
+\definelist [xsd:names]
+\defineregister [xsd:index] [xsd:indices]
+
+\setuplist [xsd:names] [expansion=yes]
+\setupregister [xsd:index] [expansion=yes]
+
+\def\dodoXSDkeyval#1#2#3%
+ {\framed
+ [width=\hsize,background=color,backgroundcolor=xsd:0,
+ framecolor=xsd:0,frame=off,align=right]
+ {\hbox to 5em % %to 8em % .2\hsize
+ {\bf
+ %\doifsomething{#1}{#1 }
+ \ignorespaces#2\unskip\hss}
+ %\ignorespaces#2\unskip:}%
+ \space
+ \ignorespaces#3\unskip}}
+
+\def\doXSDkeyval#1#2#3#4%
+ {\bgroup
+ \edef\XSDtemp{\XMLpar{#3}{#4}{}}%
+ \doifsomething{\XSDtemp}
+ {\def\doXSDtemp{\dodoXSDkeyval{#1}{#2}{\XSDtemp}}%
+ \def\doXSDtype{\dodoXSDkeyval{#1}{#2}{\XMLtyp{#3}{#4}{}}}%
+ \setupinteraction[color=,contrastcolor=,style=]%
+ \processaction
+ [#4]
+ [ value=>\doXSDtype,
+ name=>{\writetolist[xsd:names]{}{\XSDtemp}%
+ \writetoregister[xsd:index]{\XSDtemp}%
+ \ifXDScomposite \else
+ \pagereference[xsd:\XSDprefix:\XSDtemp]%
+ \fi
+ \doXSDtemp},
+ type=>{\doifinstringelse{xsd:}{\XSDtemp}
+ {\doXSDtemp}
+ {\gotobox{\doXSDtemp}[xsd:\XSDprefix:\XSDtemp]}},
+ ref=>{\doifinstringelse{xsd:}{\XSDtemp}
+ {\doXSDtemp}
+ {\gotobox{\doXSDtemp}[xsd:\XSDprefix:\XSDtemp]}},
+ unknown=>\doXSDtemp]}%
+ \endgraf
+ \egroup}
+
+\def\doXSDkeyvals#1#2#3%
+ {\def\docommando##1{\doXSDkeyval{#1}{##1}{#2}{##1}}%
+ \processcommalist[#3]\docommando}
+
+\def\dodoXSDbanner#1%
+ {\framed
+ [width=\hsize,framecolor=xsd:0,frame=off,
+ background=color,backgroundcolor=xsd:0]
+ {\ignorespaces#1\unskip}}
+
+\def\doXSDtitle#1#2#3%
+ {\edef\XSDtemp{\XMLpar{#2}{#3}{}}%
+ \dodoXSDbanner
+ {{\bf\ignorespaces#1\unskip}%
+ \doifsomething{\XSDtemp}
+ {:\space\ignorespaces\XSDtemp\unskip
+ \pagereference[xsd:\XSDprefix:\XSDtemp]}}}
+
+\def\doXSDbanner#1%
+ {\dodoXSDbanner{\bf#1}}
+
+%D We use colored backgrounds for meaningful blocks.
+
+\definecolor [xsd:0] [white]
+
+\definecolor [xsd:1] [s=.30]
+\definecolor [xsd:2] [s=.55]
+\definecolor [xsd:3] [s=.70]
+\definecolor [xsd:4] [s=.85]
+
+\definecolor [xsd:5] [r=.6,g=.7,b=.8]
+\definecolor [xsd:6] [r=.7,g=.8,b=.6]
+\definecolor [xsd:7] [r=1,g=1,b=.6]
+\definecolor [xsd:8] [r=.8,g=.7,b=.6]
+
+\defineframedtext [XSDannotation] [backgroundcolor=xsd:0]
+
+\defineframedtext [XSDelement] [backgroundcolor=xsd:5]
+\defineframedtext [XSDattribute] [backgroundcolor=xsd:6]
+\defineframedtext [XSDsimpleType] [backgroundcolor=xsd:7]
+\defineframedtext [XSDcomplexType] [backgroundcolor=xsd:8]
+
+\defineframedtext [XSDcomplexContent] [backgroundcolor=xsd:1]
+\defineframedtext [XSDsimpleContent] [backgroundcolor=xsd:1]
+\defineframedtext [XSDattributeGroup] [backgroundcolor=xsd:1]
+
+\defineframedtext [XSDcapsule] [backgroundcolor=xsd:2]
+\defineframedtext [XSDsequence] [backgroundcolor=xsd:3]
+
+\def\XDSstructures% handy for external settings
+ {XSDannotation,
+ XSDcomplexType,XSDsimpleType,XSDelement,XSDattribute,
+ XSDcomplexContent,XSDsimpleContent,XSDattributeGroup,
+ XSDcapsule,XSDsequence}
+
+\setupframedtexts
+ [\XDSstructures]
+ [width=\hsize,
+ offset=.5\bodyfontsize,
+ location=none,
+ background=color,
+ framecolor=xsd:0,
+ before=\ifinframed\else\blank\fi,
+ after=\ifinframed\else\blank\fi,
+ depthcorrection=off,
+ rulethickness=1pt,
+ strut=no]
+
+\definesymbol[xsd][{\blackrule[width=4em]}]
+
+\def\placeXSDlegenda
+ {\startbaselinecorrection
+ \starttabulate[|l|l|]
+ \HL
+ \NC \bf color \NC \bf meaning \NC \NR
+ \HL
+ \NC \color[xsd:1]{\symbol[xsd]} \NC complexContent \unskip\quad
+ simpleContent \unskip\quad
+ attributeGroup \NC \NR
+ \NC \color[xsd:2]{\symbol[xsd]} \NC capsule \NC \NR
+ \NC \color[xsd:3]{\symbol[xsd]} \NC sequence \NC \NR
+ \HL
+ \NC \color[xsd:5]{\symbol[xsd]} \NC element \NC \NR
+ \NC \color[xsd:6]{\symbol[xsd]} \NC attribute \NC \NR
+ \NC \color[xsd:7]{\symbol[xsd]} \NC simpleType \NC \NR
+ \NC \color[xsd:8]{\symbol[xsd]} \NC complexType \NC \NR
+ \HL
+ \stoptabulate
+ \stopbaselinecorrection}
+
+\defineXMLenvironment [xsd:all] [id=]
+ {\startXSDcapsule
+ \doXSDbanner{all}
+ \doXSDkeyvals{all}{xsd:all}{id}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:annotation]
+ {\startXSDcapsule
+ \doXSDbanner{annotation}
+ \startXSDannotation}
+ {\stopXSDannotation
+ \stopXSDcapsule}
+
+\defineXMLignore [xsd:appInfo]
+
+\defineXMLenvironment [xsd:attribute]
+ [id=,name=,ref=,type=,form=,use=,value=]
+ {\startXSDattribute
+ \doifelsenothing{\XMLpar{xsd:attribute}{ref}{}}
+ {\doXSDkeyvals{attribute}{xsd:attribute}{name,type}}
+ {\doXSDkeyvals{attribute}{xsd:attribute}{ref}}
+ \doXSDkeyvals{attribute}{xsd:attribute}{id,form,use,value}
+ \XDScompositetrue}
+ {\stopXSDattribute}
+
+\defineXMLenvironment [xsd:attributeGroup] [id=,name=,ref=]
+ {\startXSDattributeGroup
+ \doXSDtitle{attribute group}{xsd:attributeGroup}{name}
+ \doXSDkeyvals{attr group}{xsd:attributeGroup}{id,name,ref}
+ \XDScompositetrue}
+ {\stopXSDattributeGroup}
+
+\defineXMLenvironment [xsd:choice] [id=,minOccurs=,maxOccurs=]
+ {\startXSDcapsule
+ \doXSDbanner{choice}
+ \doXSDkeyvals{choice}{xsd:choice}{id,minOccurs,maxOccurs}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:complexContent] [id=,mixed=]
+ {\startXSDcomplexContent
+ \doXSDkeyvals{complex content}{xsd:complexContent}{id,mixed}
+ \XDScompositetrue}
+ {\stopXSDcomplexContent}
+
+\defineXMLenvironment [xsd:complexType]
+ [id=,abstract=,block=,final=,mixed=,name=]
+ {\startXSDcomplexType
+ \doXSDtitle{complex type}{xsd:complexType}{name}
+ \doXSDkeyvals{complex type}{xsd:complexType}{id,abstract,block,final,mixed}
+ \XDScompositetrue}
+ {\stopXSDcomplexType}
+
+\defineXMLenvironment [xsd:documentation] [source=,xml:lang=]
+ {\endgraf\bgroup\setupwhitespace[big]}
+ {\endgraf\egroup}
+
+\defineXMLenvironment [xsd:element]
+ [name=,type=,ref=,
+ abstract=,block=,default=,final=,fixed=,form=,id=,
+ minOccurs=,maxOccurs=,nullable=,substitutionGroup=]
+ {\startXSDelement
+ \doifelsenothing{\XMLpar{xsd:element}{ref}{}}
+ {\doXSDkeyvals{element}{xsd:element}{name,type}}
+ {\doXSDkeyvals{element}{xsd:element}{ref}}
+ \doXSDkeyvals{element}{xsd:element}
+ {id,abstract,block,default,final,fixed,form,
+ minOccurs,maxOccurs,nullable,substitutionGroup}
+ \XDScompositetrue}
+ {\stopXSDelement}
+
+\defineXMLenvironment [xsd:extension] [id=,base=]
+ {\startXSDcapsule
+ \doXSDbanner{extension}
+ \doXSDkeyvals{extension}{xsd:extension}{id,base}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:group]
+ [id=,name=,ref=,minOccurs=,maxOccurs=]
+ {\startXSDcapsule
+ \doXSDbanner{group}
+ \doXSDkeyvals{group}{xsd:group}{id,name,ref,minOccurs,maxOccurs}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:key] [id=,name=]
+ {\startXSDcapsule
+ \doXSDbanner{key}
+ \doXSDkeyvals{key}{xsd:key}{id,name}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:keyref] [id=,name=,refer=]
+ {\startXSDcapsule
+ \doXSDbanner{keyref}
+ \doXSDkeyvals{key ref}{xsd:keyref}{id,name,refer}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:list] [id=,itemType=]
+ {\startXSDcapsule
+ \doXSDbanner{list}
+ \doXSDkeyvals{list}{xsd:list}{id,itemType}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:redefine] [schemaLocation=]
+ {\startXSDcapsule
+ \doXSDbanner{redefine}
+ \doXSDkeyvals{redefine}{xsd:redefine}{schemaLocation}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:restriction] [id=,base=]
+ {\startXSDcapsule
+ \doXSDbanner{restriction}
+ \doXSDkeyvals{restriction}{xsd:restriction}{id,base}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:schema]
+ [attributeFormDefault=,blockDefault=,elementFormDefault=,
+ finalDefault=,id=,targetNamespace=,version=]
+ {\startXSDcapsule
+ \doglobal\increment\XSDprefix
+ \doXSDbanner{schema}
+ \doXSDkeyvals{schema}{xsd:schema}
+ {attributeFormDefault,blockDefault,elementFormDefault,
+ finalDefault,id,targetNamespace,version}
+ \stopXSDcapsule}
+ {}
+
+\defineXMLenvironment [xsd:sequence] [id=,minOccurs=,maxOccurs=]
+ {\startXSDsequence
+ \doXSDbanner{sequence}
+ \doXSDkeyvals{sequence}{xsd:sequence}{id,minOccurs,maxOccurs}
+ \XDScompositetrue}
+ {\stopXSDsequence}
+
+\defineXMLenvironment [xsd:simpleContent] [id=]
+ {\startXSDsimpleContent
+ \doXSDkeyvals{simple content}{xsd:simpleContent}{id}
+ \XDScompositetrue}
+ {\stopXSDsimpleContent}
+
+\defineXMLenvironment [xsd:simpleType] [id=,name=]
+ {\startXSDsimpleType
+ \doXSDtitle{simple type}{xsd:simpleType}{name}
+ \doXSDkeyvals{simple type}{xsd:simpleType}{id}
+ \XDScompositetrue}
+ {\stopXSDsimpleType}
+
+\defineXMLenvironment [xsd:union] [id=,memberTypes=]
+ {\startXSDcapsule
+ \doXSDbanner{union}
+ \doXSDkeyvals{union}{xsd:union}{id,memberTypes}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\defineXMLenvironment [xsd:unique] [id=,name=]
+ {\startXSDcapsule
+ \doXSDbanner{unique}
+ \doXSDkeyvals{unique}{xsd:unique}{id,name}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+
+\def\defineXSDfacet
+ {\dotripleempty\dodefineXSDfacet}
+
+\def\dodefineXSDfacet[#1][#2][#3]%
+ {\defineXMLenvironment[xsd:#1][#2]
+ {\startXSDcapsule
+ \doXSDkeyvals{#1}{xsd:#1}{#3}
+ \XDScompositetrue}
+ {\stopXSDcapsule}
+ \defineXMLsingular[xsd:#1][#2]
+ {\doXSDkeyvals{#1}{xsd:#1}{#3}}}
+
+\defineXSDfacet [duration] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [encoding] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [enumeration] [id=,value=,fixed=] [id,value,fixed]
+
+\defineXSDfacet [length] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [minLength] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [maxLength] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [minInclusive] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [maxInclusive] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [minExclusive] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [maxExclusive] [id=,value=,fixed=] [id,value,fixed]
+
+\defineXSDfacet [pattern] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [period] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [precision] [id=,value=,fixed=] [id,value,fixed]
+\defineXSDfacet [scale] [id=,value=,fixed=] [id,value,fixed]
+
+\defineXSDfacet [field] [id=,xpath=] [id,xpath]
+\defineXSDfacet [selector] [id=,xpath=] [id,xpath]
+
+\defineXSDfacet
+ [any]
+ [id=,namespace=,minOccurs=,maxOccurs=,processContents=]
+ [id,namespace,minOccurs,maxOccurs,processContent]
+
+\defineXSDfacet
+ [anyAttribute]
+ [id=,namespace=,processContents=]
+ [id,namespace,processContents]
+
+\defineXSDfacet
+ [import]
+ [id=,namespace=,schemaLocation=]
+ [id,namespace,schemaLocation]
+
+\defineXSDfacet
+ [include]
+ [id=,schemaLocation=]
+ [id,schemaLocation]
+
+\defineXSDfacet
+ [notation]
+ [id=,name=,public=,system=]
+ [id,name,public,system]
+
+\endinput
diff --git a/tex/context/base/x-sch-01.tex b/tex/context/base/x-sch-01.tex
new file mode 100644
index 000000000..f704f8e73
--- /dev/null
+++ b/tex/context/base/x-sch-01.tex
@@ -0,0 +1,122 @@
+%D \module
+%D [ file=x-sch-01,
+%D version=2001.10.04,
+%D title=\CONTEXT\ Style File,
+%D subtitle=XML Schema Presentation,
+%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.
+
+%D This style wraps around the core schema visualizer,
+%D implemented in \type {x-sch-00}. This is an experimental
+%D style, more will follow.
+%D
+%D \starttypen
+%D texexec --use=sch-01 x-fig-00.xsd --pdf
+%D \stoptypen
+
+\doifnothing {\jobfilename} {\end}
+\doiffileelse {\jobfilename.xsd} {} {\end}
+
+\usemodule[sch-00,con-01]
+
+\remapXMLnamespace [xs] [xsd]
+
+\setuplayout
+ [backspace=1.5cm,
+ topspace=1.5cm,
+ bottomspace=1cm,
+ width=middle,
+ height=middle,
+ header=1.5cm,
+ footer=1.5cm]
+
+\setupcolors
+ [state=start]
+
+\setupbackgrounds
+ [page]
+ [background=goback]
+
+\setupbackgrounds
+ [text]
+ [background=gonext]
+
+\defineoverlay
+ [goback]
+ [\overlaybutton{PreviousJump}]
+
+\defineoverlay
+ [gonext]
+ [\overlaybutton{nextpage}]
+
+\setuppagenumbering
+ [location=footer]
+
+\usetypescript
+ [palatino]
+ [texnansi]
+
+\setupbodyfont
+ [palatino,10pt]
+
+%\setupinteraction
+% [state=start,
+% color=,
+% contrastcolor=,
+% style=]
+
+\setuplist
+ [xsd:names]
+ [interaction=all,
+ width=0pt,
+ alternative=c]
+
+\setupregister
+ [xsd:index]
+ [interaction=text,
+ symbol=none]
+
+\setuphead
+ [chapter]
+ [style=\bfd,
+ header=high]
+
+\setuphead
+ [section]
+ [style=\bfb]
+
+\lowercasestring \jobfilename \to \lcjobfilename
+
+\setupheadertexts
+ [\lcjobfilename]
+
+\starttext
+
+\title{Schema \quote{\lcjobfilename.xsd}}
+
+\subject{Names in order of definition}
+
+\startcolumns[n=3]
+ \placelist[xsd:names][criterium=current]
+\stopcolumns
+
+\subject{Names in alphabetic order}
+
+\startcolumns[n=3]
+ \placeregister[xsd:index][criterium=current]
+\stopcolumns
+
+\subject{Meaning of background colors}
+
+\placeXSDlegenda
+
+\subject{Schema components}
+
+\processXMLfilegrouped{\jobfilename.xsd}
+
+\stoptext
diff --git a/tex/context/base/x-xml-01.tex b/tex/context/base/x-xml-01.tex
new file mode 100644
index 000000000..6a1601f27
--- /dev/null
+++ b/tex/context/base/x-xml-01.tex
@@ -0,0 +1,80 @@
+% output=pdftex modes=packed
+
+%D \module
+%D [ file=x-xml-01,
+%D version=2001.10.10,
+%D title=\CONTEXT\ XML Style File,
+%D subtitle=Formatting X?? files,
+%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-format yourfile.x** [--mode=packed,wide]
+%
+% pdftotext yourfile.pdf yournewfile.x**
+
+\doifnothing {\inputfilename} {\end}
+\doiffileelse {\inputfilename} {} {\end}
+
+% makes pdftotext to too slow
+%
+% \definepapersize
+% [mine]
+% [height=.99\maxdimen,
+% width=200cm]
+%
+% \setuppapersize
+% [mine]
+% [mine]
+%
+% \setupbodyfont
+% [0.4pt,tt]
+%
+% this is faster
+%
+% \setuppapersize
+% [A0][A0]
+%
+% but normal A4 combined with 1 pt font size is the best
+
+% too many messages
+%
+% \setupbodyfont
+% [1pt,tt]
+%
+% so:
+
+\definedfont [Mono at 1pt]
+
+\setuplayout
+ [backspace=0cm,
+ topspace=0cm,
+ width=40em,
+ height=middle,
+ header=0cm,
+ footer=0cm]
+
+\setupXMLfile
+ [level=2]
+
+\startmode[wide]
+
+ \setuplayout[width=250cm]
+
+\stopmode
+
+\startmode[packed]
+
+ \setupXMLfile[inbetween=]
+
+\stopmode
+
+\starttext
+
+\dontcomplain \showXMLfile{\inputfilename}
+
+\stoptext
diff --git a/tex/context/base/x-xml-02.tex b/tex/context/base/x-xml-02.tex
new file mode 100644
index 000000000..df56baa36
--- /dev/null
+++ b/tex/context/base/x-xml-02.tex
@@ -0,0 +1,67 @@
+% output=pdftex modes=letter
+
+%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]
+
+\setuptolerance
+ [verytolerant]
+
+\setupalign
+ [right]
+
+\lowercasestring \inputfilename \to \lcinputfilename
+
+\setupheadertexts
+ [\lcinputfilename]
+
+\setupfootertexts
+ [\currentdate\space\string| \currenttime\space \string| \pagenumber]
+
+\setupXMLfile
+ [level=2]
+
+\starttext
+
+\showXMLfile{\inputfilename}
+
+\stoptext
diff --git a/tex/context/base/xtag-cml.tex b/tex/context/base/xtag-cml.tex
new file mode 100644
index 000000000..01e137f8a
--- /dev/null
+++ b/tex/context/base/xtag-cml.tex
@@ -0,0 +1,222 @@
+% see mathml, == \defineXMLdirective [mathml] \setupMMLappearance
+
+\unprotect
+
+\def\setupCMLappearance[#1]{\dodoubleargument\getparameters[@@CML#1]}
+
+\defineXMLdirective [chemml] \setupCMLappearance
+
+\defineXMLargument [chem] \doXMLchem
+\defineXMLargument [ichem] \doXMLichem
+\defineXMLargument [dchem] \doXMLdchem
+
+\unexpanded\def\doXMLchem {\ifhmode\@EA\doXMLichem\else\@EA\doXMLdchem\fi}
+\unexpanded\def\doXMLichem{\XMLremapdata[cml]{$\rm}{$}}
+\unexpanded\def\doXMLdchem{\XMLremapdata[cml]{\dostartformula{}\rm}{\dostopformula}}
+
+\startXMLmapping [cml]
+
+\remapXMLsequence [molecule] [CPA] \doCMLmolecule
+\remapXMLsequence [ion] [CPA] \doCMLion
+\remapXMLsequence [atom] [CPA] \doCMLatom
+
+\setupCMLappearance [ion] [\c!variant=\v!a]
+
+\let\CMLtopcaption\empty
+\let\CMLbotcaption\empty
+
+\def\someCMLtext#1%
+ {\ifx\CMLtopcaption\empty
+ \setbox0\null
+ \else
+ \setbox0\hbox{\txx\setstrut\strut\ignorespaces\CMLtopcaption\unskip}%
+ \fi
+ \setbox2\hbox{\ignorespaces\strut#1\unskip}%
+ \ifx\CMLbotcaption\empty
+ \setbox4\null
+ \else
+ \setbox4\hbox{\txx\setstrut\strut\ignorespaces\CMLbotcaption\unskip}%
+ \fi
+ \scratchdimen=\wd2\advance\scratchdimen-.5em
+ \ifdim\wd0>\scratchdimen
+ \setbox0\hbox spread .5em{\hss\box0\hss}%
+ \fi
+ \ifdim\wd4>\scratchdimen
+ \setbox4\hbox spread .5em{\hss\box4\hss}%
+ \fi
+ \setbox6=\vbox
+ {\offinterlineskip\halign{\hss##\hss\cr\copy0\cr\copy2\cr\copy4\cr}}%
+ \hbox{\lower\ht4\hbox{\lower\dp2\box6}}}
+
+\def\CMLscript#1%
+ {$\scriptscriptstyle\ignorespaces#1\unskip$}
+
+\def\doifnotXMLzero#1#2#3%
+ {\ifcase\XMLpar{#1}{#2}{0}\else#3{\XMLpar{#1}{#2}{0}}\fi}
+
+\newcounter\currentCMLatom
+\newcounter\nofCMLatoms
+
+\def\doCMLmolecule#1#2%
+ {\resetCMLcaption
+ \processXMLRchild{caption}{#2}%
+ \someCMLtext
+ {\bgroup
+ \newcounter\currentCMLatom
+ \newcounter\nofCMLatoms
+ \getXMLarguments{cml-m}{n="0" #1}%
+ \doifnotXMLzero{cml-m}{n}\firstofoneargument
+ \ignorespaces\processXMLRchild{atom,ion,bond/,%
+ singlebond/,doublebond/,triplebond/}{#2}\unskip
+ \egroup}%
+ \ignorespaces}
+
+\def\doCMLion#1#2%
+ {\resetCMLcaption
+ \processXMLRchild{caption}{#2}%
+ \someCMLtext
+ {\bgroup
+ \newcounter\currentCMLatom
+ \newcounter\nofCMLatoms
+ \getXMLarguments{cml-i}{n="0" charge="0" #1}%
+ \doifnotXMLzero{cml-i}{n}\firstofoneargument
+ \doifelse{\@@CMLionvariant}{\v!b}
+ {[\ignorespaces\processXMLRchild{atom,bond/,%
+ singlebond/,doublebond/,triplebond/}{#2}\unskip]%
+ \high{\doifnotXMLzero{cml-i}{charge}\CMLscript}}
+ {\countXMLRchild{atom}{\ignorespaces#2\unskip}%
+ \let\nofCMLatoms\nofXMLRchildren
+ \ignorespaces\processXMLRchild{atom,bond/,%
+ singlebond/,doublebond/,triplebond/}{#2}\unskip}%
+ \egroup}%
+ \ignorespaces}
+
+\def\doCMLatom#1#2%
+ {\getXMLarguments{cml-a}{n="0" weight="0" protons="0" charge="0" #1}%
+ \increment\currentCMLatom
+ \resetCMLcaption
+ %\processXMLRchild{caption}{#2}% not here
+ \someCMLtext
+ {\bgroup
+ \lohi
+ {\doifnotXMLzero{cml-a}{protons}\CMLscript}
+ {\doifnotXMLzero{cml-a}{weight}\CMLscript}%
+ \ignorespaces#2\unskip
+ \lohi
+ {\doifnotXMLzero{cml-a}{n}\CMLscript}
+ {\ifnum\nofCMLatoms=\currentCMLatom\relax
+ \doifnotXMLzero{cml-i}{charge}\CMLscript
+ \else
+ \doifnotXMLzero{cml-a}{charge}\CMLscript
+ \fi}%
+ \egroup}%
+ \ignorespaces}
+
+\remapXMLsequence [reaction] [CPA] \doCMLreaction
+
+\let\someCMLsymbol\gobbleoneargument
+\let\someCMLarrow \gobblethreearguments
+
+\def\doCMLreaction#1#2%
+ {\begingroup
+ \let\someCMLsymbol\dosomeCMLsymbol
+ \let\someCMLarrow \dosomeCMLarrow
+ #2%
+ \endgroup}
+
+\remapXMLsequence [plus] [CPA] \doCMLplus
+\remapXMLsingular [plus] [CPA] \doCMLplus
+\remapXMLsequence [minus] [CPA] \doCMLminus
+\remapXMLsingular [minus] [CPA] \doCMLminus
+\remapXMLsequence [equal] [CPA] \doCMLequal
+\remapXMLsingular [equal] [CPA] \doCMLequal
+
+\def\doCMLplus #1#2{\someCMLsymbol{+}}
+\def\doCMLminus#1#2{\someCMLsymbol{-}}
+\def\doCMLequal#1#2{\someCMLsymbol{=}}
+
+\def\dosomeCMLsymbol#1%
+ {\quad\mathop{#1}\quad}
+
+\remapXMLsequence [gives] [CPA] \doCMLgives
+\remapXMLsingular [gives] [CPA] \doCMLgives
+\remapXMLsequence [equilibrium] [CPA] \doCMLequilibrium
+\remapXMLsingular [equilibrium] [CPA] \doCMLequilibrium
+\remapXMLsequence [mesomeric] [CPA] \doCMLmesomeric
+\remapXMLsingular [mesomeric] [CPA] \doCMLmesomeric
+
+\def\doCMLgives #1#2{\resetCMLcaption#2\someCMLgives }
+\def\doCMLequilibrium#1#2{\resetCMLcaption#2\someCMLequilibrium}
+\def\doCMLmesomeric #1#2{\resetCMLcaption#2\someCMLmesomeric }
+
+\def\dosomeCMLarrow#1%
+ {\quad
+ \someCMLtext
+ {$\vcenter{\offinterlineskip\halign{##\cr\hskip3em\cr#1\cr}}$}%
+ \quad}
+
+\def\someCMLgives
+ {\someCMLarrow{\rightarrowfill}}
+
+\def\someCMLequilibrium
+ {\someCMLarrow{\rightarrowfill\cr\noalign{\nointerlineskip}\leftarrowfill}}
+
+\def\someCMLmesomeric
+ {\someCMLarrow{$\leftarrow\hskip-1em$\rightarrowfill}}
+
+\remapXMLsequence [cml] [caption] [CPA] \doCMLcaption
+
+\let\CMLtopcaption\empty
+\let\CMLbotcaption\empty
+
+\def\dodoCMLcaption#1#2%
+ {\def\CMLbotcaption{#2}%
+ \def\doCMLcaption##1##2%
+ {\def\CMLtopcaption{##2}%
+ \let\doCMLcaption\gobbletwoarguments}}
+
+\def\resetCMLcaption%
+ {\let\CMLtopcaption\empty
+ \let\CMLbotcaption\empty
+ \let\doCMLcaption\dodoCMLcaption}
+
+\resetCMLcaption
+
+\remapXMLsingular [bond] [CPA] \doCMLbond
+\remapXMLsingular [singlebond] [CPA] \doCMLsinglebond
+\remapXMLsingular [doublebond] [CPA] \doCMLdoublebond
+\remapXMLsingular [triplebond] [CPA] \doCMLtriplebond
+
+\def\doCMLbond#1#2%
+ {\getXMLarguments{cml-b}{n="0" #1}%
+ \ifcase\XMLpar{cml-b}{n}{0}\relax
+ \doCMLsinglebond
+ \or
+ \doCMLdoublebond
+ \or
+ \doCMLtriplebond
+ \fi}
+
+\def\someCMLbond%
+ {\hrule \!!width \hsize \!!height .1ex} % .4pt
+
+\def\dosomeCMLbond#1#2#3%
+ {{\setbox\scratchbox=\hbox{$M$}%
+ \vbox to \ht\scratchbox
+ {\hsize\wd\scratchbox
+ \vskip.1\wd\scratchbox
+ #1\vfill#2\vfill#3%
+ \vskip.1\wd\scratchbox}}}
+
+\def\doCMLsinglebond%
+ {\dosomeCMLbond\relax\someCMLbond\relax}
+
+\def\doCMLdoublebond%
+ {\dosomeCMLbond\someCMLbond\relax\someCMLbond}
+
+\def\doCMLtriplebond%
+ {\dosomeCMLbond\someCMLbond\someCMLbond\someCMLbond}
+
+\stopXMLmapping
+
+\protect \endinput
diff --git a/tex/context/base/xtag-exp.tex b/tex/context/base/xtag-exp.tex
new file mode 100644
index 000000000..fc51675cb
--- /dev/null
+++ b/tex/context/base/xtag-exp.tex
@@ -0,0 +1,81 @@
+%D \module
+%D [ file=xtag-exp,
+%D version=2001.08.20,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=Expansion Related Things,
+%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.
+
+\beginTEX
+ \writestatus{XML}{sorry, XML is only supported in (pdf)etex}
+ \def\startXMLdefinitions{\gobbleuntil\stopXMLdefinitions}
+ \endinput
+\endTEX
+
+\writestatus{loading}{Context XML Macros (expansion)}
+
+\unprotect
+
+%D Files
+
+\newcounter\XMLfilenesting \let\restoreXMLelements\relax
+
+\def\startXMLreading
+ {\increment \XMLfilenesting \relax
+ \ifnum\XMLfilenesting=1
+ \ifprocessingXML
+ \let\restoreXMLelements\relax
+ \else
+ \let\restoreXMLelements\disableXMLelements
+ \enableXMLelements
+ \fi
+ \fi}
+
+\def\stopXMLreading
+ {\ifnum\XMLfilenesting=1
+ \restoreXMLelements
+ \let\restoreXMLelements\relax
+ \fi
+ \decrement \XMLfilenesting \relax}
+
+\def\enableXMLfiledata
+ {\prependtoks \enableXMLelements \to \mainoutput % brrr, will change
+ \appendtoks \startXMLreading \to \everybeforeutilityread
+ \appendtoks \stopXMLreading \to \everyafterutilityread
+ \appendtoks \forcefileexpansiontrue \to \everyenableXML
+ \let\enableXMLfiledata\relax}
+
+\setupXMLprocessing[\c!status=\v!start]
+
+\appendtoks \enableXMLfiledata \to \aftersetupXMLprocessing
+
+%D Here we overload the mark handler.
+
+\def\XMLexpanded#1%
+ {\bgroup
+ \honorunexpanded
+ \dontexpandencoding
+ \xdef\@@globalexpanded{\noexpand#1}%
+ \egroup
+ \@@globalexpanded}
+
+\let\normalsetnormalmark\setnormalmark
+
+\long\def\setnormalmark#1% overloaded
+ {\ifprocessingXML
+ \expandafter\setXMLexpandedmark
+ \else
+ \expandafter\normalsetnormalmark
+ \fi#1}
+
+\def\setXMLexpandedmark#1#2% using a tok prevents unwanted expansion in mark
+ {\XMLexpanded{\scratchtoks{\enableXMLelements#2}}%
+ \setxvalue{\@@crk\string#1}{\the\scratchtoks}%
+ \normalmarks#1{\the\scratchtoks}}
+
+\protect \endinput
diff --git a/tex/context/base/xtag-ext.tex b/tex/context/base/xtag-ext.tex
index 9bf9f89a9..0645cea38 100644
--- a/tex/context/base/xtag-ext.tex
+++ b/tex/context/base/xtag-ext.tex
@@ -21,54 +21,61 @@
\unprotect
%D \macros
-%D {startXMLnamespace}
+%D {startXMLmapping}
%D
%D You can define macros within a namespace, so that they
%D will not conflict (don't confuse this with \XML\
-%D namespaces.
+%D namespaces.)
%D
%D \starttypen
-%D \startXMLnamespace [tag] | [-] [tag] | [+] [tag]
+%D \startXMLmapping [tag] | [-] [tag] | [+] [tag]
%D definitions
-%D \stopXMLnamespace
+%D \stopXMLmapping
%D \stoptypen
%D
-%D When a \type {[+]} is specified, the namespaces will
+%D When a \type {[+]} is specified, the mappings will
%D nest.
\let\normal@@XMLelement\@@XMLelement
-\let\XMLnamespace\empty
-\def\startXMLnamespace%
- {\dodoubleempty\dostartXMLnamespace}
+\def\resetXMLmapping
+ {\let\@@XMLelement\normal@@XMLelement
+ \let\@@XMLmapping\empty}
-\def\dostartXMLnamespace[#1][#2]%
+\resetXMLmapping
+
+\def\startXMLmapping
+ {\dodoubleempty\dostartXMLmapping}
+
+\def\dostartXMLmapping[#1][#2]% sneller maken
{\pushmacro\@@XMLelement
- \pushmacro\@@XMLnamespace
+ \pushmacro\@@XMLmapping
\ifsecondargument
\doifelse{#1}{-}
- {\donostartXMLnamespace{#1}}
+ {\donostartXMLmapping{#2}}
{\doifelse{#1}{+}
- {\dodostartXMLnamespace{#1}{#2}}
- {\donostartXMLnamespace{#1}}}%
+ {\dodostartXMLmapping{#2}}
+ {\donostartXMLmapping{#2}}}%
\else
- \donostartXMLnamespace{#1}%
+ \donostartXMLmapping{#1}%
\fi
\unprotect}
-\def\donostartXMLnamespace#1%
- {\edef\XMLnamespace{#1}%
- \let\@@XMLelement\normal@@XMLelement}
+\def\donostartXMLmapping#1%
+ {\let\@@XMLprevelement\@@XMLelement
+ \edef\@@XMLmapping{#1}%
+ \edef\@@XMLelement{\normal@@XMLelement+#1}}
-\def\dodostartXMLnamespace#1#2%
- {\edef\XMLnamespace{\XMLnamespace:#2}%
- \edef\@@XMLelement{\@@XMLelement:#2}}
+\def\dodostartXMLmapping#1%
+ {\let\@@XMLprevelement\@@XMLelement
+ \edef\@@XMLmapping{\@@XMLmapping+#1}%
+ \edef\@@XMLelement{\@@XMLelement+#1}}
-\def\stopXMLnamespace%
+\def\stopXMLmapping%
{\protect
- \popmacro\@@XMLnamespace
+ \popmacro\@@XMLmapping
\popmacro\@@XMLelement}
-
+
%D Context Directives:
\def\@@CTXML{@@CTXML}
@@ -76,20 +83,22 @@
\def\defineXMLdirective%
{\dodoubleempty\dodefineXMLdirective}
-\def\dodefineXMLdirective[#1][#2]#3%
+\long\def\dodefineXMLdirective[#1][#2]#3%
{\defineXMLprocessor[context-#1-directive]{\dohandleXMLdirective{#1}{#3}}%
\ifsecondargument
- \setvalue{\@@CTXML-#1-#2}{#3}%
+ \long\setvalue{\@@CTXML-#1-#2}{#3}%
\fi}
\def\dohandleXMLdirective#1#2#3%
-% {\dodohandleXMLdirective#3 dummy dummy dummy\end{#1}{#2}}
{\dodohandleXMLdirective#3 @ @ @\end{#1}{#2}}
+%\def\dodohandleXMLdirective#1 #2 #3 #4\end#5#6%
+% {\doifdefinedelse{\@@CTXML-#5-#1}
+% {\getvalue{\@@CTXML-#5-#1}[#2=#3]}
+% {#6[#1][#2=#3]}}
+
\def\dodohandleXMLdirective#1 #2 #3 #4\end#5#6%
- {\doifdefinedelse{\@@CTXML-#5-#1}
- {\getvalue{\@@CTXML-#5-#1}[#2=#3]}
- {#6[#2=#3]}}
+ {\executeifdefined{\@@CTXML-#5-#1}{#6[#1]}[#2=#3]}
% \defineXMLdirective [mathml] \setupMMLappearance % [#1][#2=#3]
% \defineXMLdirective [flowchart] [shapes] \setupFLOWshapes % [#2=#3]
@@ -97,5 +106,53 @@
\defineXMLprocessor [context-begin-group] {\begingroup\gobbleoneargument}
\defineXMLprocessor [context-end-group] {\endgroup \gobbleoneargument}
+
+% \def\XMLnspart#1:#2\empty{#1} % call ...:\empty\empty
+% \def\XMLidpart#1:#2#3\empty{\ifx#2\empty#1\else\XMLidpart#2#3\empty\empty\fi}
+
+% trial macros (used in setupx), to be sped up !
+
+\bgroup \catcode`\<=\active
+
+\gdef\saveasXMLdata#1#2% name raw data
+ {\dodoglobal\setevalue{\@@XMLsave#1}{#2}} % \edef!
+
+\gdef\saveXMLdata#1#2% name data-name ; definitely no \edef
+ {\dodoglobal\copycsname\@@XMLsave#1\endcsname\csname\@@XMLdata:#2\endcsname}
+
+\gdef\saveXMLdatainelement#1#2#3% name element data
+ {\dodoglobal\setevalue{\@@XMLsave#1}% todo: one level expansion
+ {<#2 \currentXMLarguments>\XMLflush{#3}#2>}}
+
+\gdef\saveXMLdatastructure#1#2#3#4#5#6% name element args before data after
+ {\dodoglobal\setevalue{\@@XMLsave#1}% todo: one level expansion
+ {<#2 #3 \currentXMLarguments>#4\XMLflush{#5}#6#2>}}
+
+\gdef\doifelseXMLelement#1%
+ {\doifdefinedelse{\@@XMLsave#1}}
+
+\gdef\flushXMLelement#1%
+ {\csname\@@XMLsave#1\endcsname}
+
+\gdef\showXMLelement#1%
+ {\showvalue{\@@XMLsave#1}}
+
+\gdef\processXMLelement#1%
+ {\bgroup
+ \enableXMLelements
+ \getvalue{\@@XMLsave#1}%
+ \egroup}
+
+\gdef\texXMLelement#1%
+ {\begingroup
+ \setnormalcatcodes
+ \scantokens\@EA\@EA\@EA{\csname\@@XMLsave#1\endcsname}%
+ \endgroup}
+
+
+\egroup
+\def\potentialXMLentity#1%
+ {\doifXMLentityelse{#1}{\getXMLentity{#1}}{#1}}
+
\protect \endinput
diff --git a/tex/context/base/xtag-ini.tex b/tex/context/base/xtag-ini.tex
index 970f065df..97853ed45 100644
--- a/tex/context/base/xtag-ini.tex
+++ b/tex/context/base/xtag-ini.tex
@@ -11,20 +11,32 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\beginTEX
+% csnames
+
+\beginTEX
\writestatus{XML}{sorry, XML is only supported in (pdf)etex}
\def\startXMLdefinitions{\gobbleuntil\stopXMLdefinitions}
- \endinput
-\endTEX
+ \endinput
+\endTEX
+
+\writestatus{loading}{Context XML Macros (initialization)}
+
+% XMLelse -> elseXML
+
+%D This module is highly optimized for speed, which sometimes
+%D reads to rather unreadable code. Sorry for this.
+
+\def\gobblespacetokens % will go to syst-ext.tex + speed up
+ {\doifnextcharelse\empty\donothing\donothing} % no {}\do\do !
\beginETEX XML
\bgroup \obeylines
- \gdef\startXMLdefinitions%
- {\bgroup\obeylines\dostartXMLdefinitions}
+ \gdef\startXMLdefinitions%
+ {\bgroup\obeylines\dostartXMLdefinitions}
- \gdef\dostartXMLdefinitions #1
+ \gdef\dostartXMLdefinitions #1
{\egroup\doifsomething{#1}{\writestatus{XML}{loading #1 support}}}
\global\let\stopXMLdefinitions\relax
@@ -42,16 +54,17 @@
%D Like it or not, this module deals with angle bracketed
%D input. Processing \XML\ alike input in \CONTEXT\ has been
-%D possible since 1994, but several methods ran in parallel
-%D and were implemented in modules like \type {m-sgml}.
+%D possible since 1995, and till 2000 several methods ran in
+%D parallel. These were implemented in modules like the semi
+%D public \type {m-sgml}.
%D
-%D There is no one optimal solution for processing \XML\ data.
+%D There is not one optimal solution for processing \XML\ data.
%D The oldest method was based on a very simple preprocessor
-%D written in \PERL: \type {} was converted into
-%D \type {\begSGML[command]} and optional parameters were
-%D passed.
+%D written in \MODULA\ and later \PERL: \type {} was
+%D converted into \type {\begSGML[command]} and optional
+%D parameters were passed.
%D
-%D A second method is to use a \PERL\ or \XSL\ transformation
+%D A second method uses a \PERL\ or \XSL\ transformation
%D script that produces \CONTEXT\ commands. This method is
%D much slower, mainly because the whole document is read into
%D memory and a document tree is to be build. The advantage is
@@ -60,34 +73,60 @@
%D The third method uses a basic parser written in the \TEX\
%D language, and apart from a few pitfalls, this method is
%D clean and efficient, but not always robust. Because errors
-%D in the input are not catched on forhand, processing in
+%D in the input are not catched on forehand, processing in
%D \TEX\ may fail due to errors. But, given that a document
%D can be validated on forehand, this is no big problem.
%D
-%D Each method has it's advantage, but especially the third
+%D Each method has its advantage, but especially the third
%D method puts some demands on \CONTEXT, since no interference
%D between the parser and the core commands may occur. What
%D method is used, depends on the situation.
%D
%D All three methods introduce some problems in interfacing to
%D core \CONTEXT\ functionality. This is due to the fact that
-%D sometimes we want to typeset content directly, while on
+%D sometimes we want to typeset content directly, while in
%D other cases we just want to pick up data for later usage,
%D either or not using delimited arguments. And, when moving
%D data around, there is always the expansion problem to deal
%D with.
-%D
+%D
+%D As can be expected, we have to map begin and end tags onto
+%D \CONTEXT's start- and stopcommands. This is the easy part.
+%D When we have to pass the content of an element to a macro
+%D as argument, we need to do a delimited grab. Such mappings
+%D are not that hard to implement and were part of \type
+%D {m-sgml.tex} already. New in this core module is nested
+%D grabbing. Also new here is the support for namespaces and
+%D extensive attribute handling. On the other hand, recursive
+%D traceback of attributes is no longer supported. Because
+%D this feature was not really used, we can hereby safely we
+%D declare the \type {m-sgml.tex} module obsolete.
+%D
%D In order to be able to incorporate \XML\ style definitions
%D into basic \TEX\ styles, we will provide some basic
-%D functionality in the core itself.
+%D functionality in the core itself. Some of the functionality
+%D can be set up with this general command. We use a token
+%D list register to handle post||setup actions. This permits
+%D us to extend this command.
+
+\unprotect
+
+\newtoks\aftersetupXMLprocessing
+
+\def\setupXMLprocessing
+ {\dosingleargument\dosetupXMLprocessing}
+
+\def\dosetupXMLprocessing[#1]%
+ {\getparameters[\??xp][#1]\the\aftersetupXMLprocessing}
+
+\protect
%D We will be dealing with elements, which means that we have
%D to take care of \type {} and \type {}, but
-%D also with \type {} and \type {}. In due time
-%D this module will deal with all these animals in a
-%D convenient way. In some cases the upper and lowercase
-%D alternatives need to be dealt with, although this is not
-%D realy needed since XML is case sensitive.
+%D also with \type {} and \type {}. In some cases
+%D the upper and lowercase alternatives need to be dealt with,
+%D although this is not realy needed since XML is case
+%D sensitive.
%D
%D We also have to handle entities, like \type {&you;} and
%D \type {&me;}. These are quite easy to deal with and need to
@@ -100,47 +139,47 @@
%D Since we have to handlers for each element and entity, we
%D will create a few namespaces. Special care has to be
%D given to preformated code.
+%D
+%D There are two namespace mechanisms in place: one for
+%D \TEX, and one for \XML. The later mechanism permits
+%D remapping and ignoring.
\unprotect
\def\@@XML {XML:}
-\def\@@XMLentity {\@@XML ent}
-\def\@@XMLelement {\@@XML ele}
-\def\@@XMLvariable {\@@XML var}
-\def\@@XMLvalue {\@@XML val}
-\def\@@XMLpars {\@@XML par}
-\def\@@XMLdata {\@@XML dat}
-\def\@@XMLcode {\@@XML cod}
-\def\@@XMLinstruction {\@@XML ins}
-\def\@@XMLmap {\@@XML map}
-\def\@@XMLlist {\@@XML lst}
+\def\@@XMLentity {\@@XML ent} % &crap;
+\def\@@XMLelement {\@@XML ele} %
+\def\@@XMLvariable {\@@XML var} % key="val"
+\def\@@XMLvalue {\@@XML val} % key="val"
+\def\@@XMLpars {\@@XML par} %
+\def\@@XMLdata {\@@XML dat} % mem buffer
+\def\@@XMLcode {\@@XML cod} % named mem buffers
+\def\@@XMLinstruction {\@@XML ins} %
+\def\@@XMLmap {\@@XML map} % mapping on context attr
+\def\@@XMLlist {\@@XML lst} %
+\def\@@XMLnamespace {\@@XML nam} % namespace:element
+\def\@@XMLurlspace {\@@XML url} %
+\def\@@XMLescape {\@@XML esc} % E
+.catcode`.#=.@@active * .gdef.letterhash B.string#E
+.catcode`.$=.@@active * .gdef.letterdollar B.string$E
+.catcode`.%=.@@active * .gdef.letterpercent B.string%E
+.catcode`.\=.@@active * .gdef.letterbackslash B.string\E
+.catcode`.^=.@@active * .gdef.letterhat B.string^E
+.catcode`._=.@@active * .gdef.letterunderscore B.string_E
+.catcode`.{=.@@active * .gdef.letterbgroup B.string{E
+.catcode`.}=.@@active * .gdef.letteregroup B.string}E
+.catcode`.|=.@@active * .gdef.letterbar B.string|E
+.catcode`.~=.@@active * .gdef.lettertilde B.string~E
+
+.gdef.enableXMLexpansion
B.def=.@@other*
- .catcode`.#=.@@active .def#B&tex-hash;E*
+ .catcode`.>=.@@other .catcode`."=.@@other*
+ .catcode`./=.@@other .catcode`.'=.@@other*
+ *catcode`.#=.@@active .def#PP1B&tex-hash;E* gobbles its own dup
+ .catcode`.#=.@@active .def#B&tex-hash;E*
.catcode`.$=.@@active .def$B&tex-dollar;E*
.catcode`.%=.@@active .def%B&tex-percent;E*
.catcode`.\=.@@active .def\B&tex-backslash;E*
@@ -192,18 +243,35 @@
.catcode`.{=.@@active .def{B&tex-leftbrace;E*
.catcode`.}=.@@active .def}B&tex-rightbrace;E*
.catcode`.|=.@@active .def|B&tex-bar;E*
- .catcode`.~=.@@other* active .def~B&tex-tilde;E*
- .relax* needed for successive .if's
+ .catcode`.~=.@@other *def~B&tex-tilde;E*
+ .processingXMLtrue
+ .the.everyenableXML
E
-.gdef.enableXMLelements*
- B.catcode`.<=.@@active .unexpanded.def=.@@other*
- .relax* needed for successive .if's
+* The following macro can be invokes when reading from
+* an auxiliary file.
+
+.unexpanded.gdef.enableXMLelements*
+ B.catcode60=.@@active * .catcode`.<=.@@active
+ .catcode62=.@@other * .catcode`.>=.@@other
+ .unexpanded.def=.@@other
+ .let<.relax * new
+ .processingXMLfalse
E
+.global.let<.relax * new
+.global.let&.relax * new
+
.egroup
+\def\disableXML{\setnormalcatcodes\processingXMLfalse}
+
%D An element can be singular or paired. A singular element is
%D called an empty element. The following definitions are
%D equivalent:
@@ -265,45 +333,83 @@
%D to determine if we're dealing with a comment or processing
%D instruction. We need a bit of grouping because we have to
%D mess up with catcodes. We probably have to treat a few
-%D more catcode and first character cases. We need to use
-%D \type {\begingroup} here, otherwise we get funny spaces in
-%D math.
+%D more catcode and first character cases. We need to use
+%D \type {\begingroup} here, otherwise we get funny spaces in
+%D math.
-\protect
+%D Maybe I will remove grouping here and introduce \type
+%D {\obeyXMLlines}.
-\long\def\doXMLelement#1%
- {\begingroup % maybe tab and space needs some treatment too: \catcode`\ =10 % \@@space
- \catcode`\^^M=10
- \if#1!\let\next \xdoXMLelement \else
- \if#1?\let\next \ydoXMLelement \else
- \let\next \zdoXMLelement \fi\fi
- \next#1}
-
-%D By using a few {\expandafter}'s we can us a \type {\next}
+%D By using a few {\expandafter}'s we can avoid a \type {\next}
%D construction. We could speed the first char test up a bit
%D by using an installer and something \typ {\getvalue
-%D {#1doXMLelement}} (todo).
+%D {#1doXMLelement}} (todo).
+
+\protect % we need an normal ! ?
+
+% \long\def\doXMLelement#1%
+% {\if#1!\expandafter \xparseXMLescape \else
+% \if#1?\expandafter\expandafter\expandafter \xparseXMLprocess \else
+% \expandafter\expandafter\expandafter \xparseXMLelement \fi\fi
+% #1}
+
+\def\expandthree{\expandafter\expandafter\expandafter}
\long\def\doXMLelement#1%
- {\begingroup % maybe tab and space needs some treatment too: \catcode`\ =10 % \@@space
- \catcode`\^^M=10\relax
- \if#1!\expandafter \xdoXMLelement \else
- \if#1?\expandafter\expandafter\expandafter \ydoXMLelement \else
- \expandafter\expandafter\expandafter \zdoXMLelement \fi\fi
+ {\if#1!\expandafter \xparseXMLescape \else
+ \if#1?\expandthree \xparseXMLprocess \else
+ \expandthree \xparseXMLelement \fi\fi
#1}
-%D The (yet experimental) \type {CDATA} parser is implemented
-%D on top of the verbatim environment.
+% does it end with ? or ?>
+
+\long\def\xparseXMLescape !#1 {\parseXMLescape{#1}}
+\long\def\xparseXMLprocess ?#1 #2>{\parseXMLprocess{#1}{#2}}
+\long\def\xparseXMLelement #1>{\parseXMLelement #1 >}
+
+% this kind of optimizations are only faster in a more
+% extensive if tree combined with equally spread occurance of
+% #1 (also tested for arguments)
+%
+% \long\def\doXMLelement#1%
+% {\csname<\if#1!!\else\if#1??\else.\fi\fi>\endcsname#1}
+%
+% \long\setvalue{}!#1 {\parseXMLescape{#1}}
+% \long\setvalue{>}?#1 {\parseXMLprocess{#1}}
+% \long\setvalue{<.>}#1>{\parseXMLelement#1 >}
+
+%D The escape handler takes care of the fuzzy \type { or !xyz >
- {\endgroup
- \doifelse{#1}{--}
- {\long\def\nextelement{\gobbleuntil{-->}}}
- {\doifelse{#1}{[CDATA[}
- {\long\def\nextelement{\skipfirstverbatimlinefalse
- \processtaggeddisplayverbatim{]]>}}}
- {\long\def\nextelement{\gobbleuntil{>}}}}%
- \nextelement}
+\def\defineXMLescape[#1]#2%
+ {\unspaceargument#1\to\ascii % get rid of {}, like in {CDATA[}
+ \long\setvalue{\@@XMLescape:\ascii}{#2}}
+
+\def\parseXMLescape#1% #2> parsing takes place in macros
+ {\executeifdefined{\@@XMLescape:#1}{\csname\@@XMLescape:\s!default\endcsname}}
+
+\let\normalparseXMLescape \parseXMLescape
+\let\normalparseXMLelement\parseXMLelement
+\let\normalparseXMLprocess\parseXMLprocess
%D In our case, processing instructions are only needed if
%D we want specific \CONTEXT\ support. This may be useful in
@@ -311,183 +417,620 @@
%D application. We will implement a \CONTEXT\ code handler
%D later.
-\long\def\ydoXMLelement#1 #2?>% ?target ?>
- {\endgroup\dodoXMLprocessor{#1}{#2}}
+%D The processing instructions handler is implemented as
+%D follows.
-%D The normal elements are handled by \type {\dodoXMLelement}.
+\long\def\defineXMLprocessor[#1]#2%
+ {\long\setvalue{\@@XMLinstruction:#1}{#2}}
-\long\def\zdoXMLelement#1>%
- {\endgroup\dodoXMLelement#1 >}
+% \def\parseXMLprocess#1#2%
+% {\executeifdefined{\@@XMLinstruction:#1}\gobbleoneargument{#2}}
-%D Now we switch to unprotected mode again.
+%D Because we support \type {.. ?>} as well as \type {.. >}
+%D end||of||pi situations, we need to clean up the ending
+%D \type {?}.
-\unprotect
+\protect
-%D The processing instructions handler is implemented as
-%D follows.
+\long\def\cleanupXMLprocess#1%
+ {\docleanupXMLprocess#1 ? \relax}
+
+\long\def\docleanupXMLprocess#1? #2\relax
+ {\def\currentXMLprocess{#1}}
+
+\unprotect
+
+\def\parseXMLprocess#1#2%
+ {\cleanupXMLprocess{#2}%
+ %\convertcommand\currentXMLprocess\to\ascii
+ %\writestatus{xml-process}{\ascii}
+ \expanded
+ {\executeifdefined
+ {\@@XMLinstruction:#1}
+ \noexpand\gobbleoneargument
+ {\expandafter\noexpand\currentXMLprocess}}}
+
+%D Next we will implement the normal element handler. This
+%D piece of code is complicated by the fact that we need to
+%D handle namespaces.
+
+\let\currentXMLarguments \empty
+\let\currentXMLelement \empty % name
+\let\currentXMLidentifier\empty % name or name/
+\let\currentXMLnamespace \empty % the (remapped) namespace
+\let\originalXMLnamespace\empty % the unremapped namespace
+\let\rawXMLidentifier \empty
-\long\def\dodoXMLprocessor#1%
- {\ifundefined{\@@XMLinstruction:#1}%
- \let\next\gobbleoneargument
+\def\rawXMLnamespace
+ {\ifx\currentXMLnamespace\empty\else\currentXMLnamespace:\fi}
+
+\def\rawXMLelement{\rawXMLnamespace\rawXMLidentifier}
+
+%D The following token list register provided the user a hook
+%D for extensions.
+
+\newtoks\everyXMLelement
+
+%D We try to keep track of the nature of an element. This
+%D flag can be used for special purposes (as in the pretty
+%D printing macros).
+
+\chardef\kindofXMLelement=0
+
+\chardef\beginXMLtag=1
+\chardef\endXMLtag =2
+\chardef\emptyXMLtag=3
+
+%D We do a rather hard coded scan for the namespace attribute. This
+%D is needed because its value determines further namespace related
+%D actions.
+
+\def\openXMLargument{ /}
+
+\long\def\parseXMLelement#1#2 #3>%
+ {\def\currentXMLarguments{#3}% including end /
+ \if#1/%
+ \chardef\kindofXMLelement\endXMLtag
+ \def\currentXMLelement{#2}%
\else
- \def\next{\getvalue{\@@XMLinstruction:#1}}%
+ \docleanupXMLelement#1#2/\empty\relax
+ \fi
+ \ifx\currentXMLarguments\openXMLargument
+ \chardef\kindofXMLelement\emptyXMLtag
\fi
- \next}
+ \@EA\splitoffXMLnamespace\currentXMLelement::\relax
+ \ifcase\kindofXMLelement
+ % can't happen
+ \or
+ % begintag or emptytag with arguments or space before /
+ \the\everyXMLelement % only for begin/empty tag !
+ \ifx\currentXMLarguments\empty \else
+ \dogetXMLarguments\rawXMLelement#3>%
+ \fi
+ \or
+ % no arguments
+ \or
+ % empty element without arguments (but possible presets)
+ \the\everyXMLelement
+ \fi
+ \ifcase\kindofXMLelement\or
+ \let\currentXMLidentifier \rawXMLidentifier
+ \edef\currentXMLfullidentifier {\rawXMLelement }%
+ \or
+ \edef\currentXMLidentifier {/\rawXMLidentifier }%
+ \edef\currentXMLfullidentifier{/\rawXMLelement }%
+ \or
+ \edef\currentXMLidentifier {\rawXMLidentifier/}%
+ \edef\currentXMLfullidentifier {\rawXMLelement /}%
+ \fi
+ \iftraceXMLelements\traceXMLelement\fi
+ \executeXMLelement}
+
+\long\def\docleanupXMLelement#1/#2#3\relax
+ {\def\currentXMLelement{#1}% watch out: \empty == begin or empty tag
+ \chardef\kindofXMLelement\ifx#2\empty\beginXMLtag\else\emptyXMLtag\fi}
+
+\def\@@traceXMLelement%
+ {\originalXMLfullidentifier
+ \ifx\originalXMLfullidentifier\currentXMLfullidentifier\else
+ \space=>\space\currentXMLfullidentifier
+ \fi
+ \ifx\currentXMLarguments\empty\else
+ \space\string|\space\currentXMLarguments
+ \fi}
+
+\long\def\traceXMLelement%
+ {\edef\originalXMLfullidentifier{\someXMLelement\currentXMLelement}%
+ \cleanupXMLarguments\writestatus{xml-element}{\@@traceXMLelement}}
+
+%D We split off the namespace part, construct the
+%D identifier, and remap the namespace if needed.
+
+\def\splitoffXMLnamespace#1:#2:#3\relax
+ {\def\rawXMLidentifier{#2}%
+ \ifx\rawXMLidentifier\empty
+ \let\currentXMLnamespace\empty
+ \edef\rawXMLidentifier{#1}%
+ \else
+ \edef\currentXMLnamespace{#1}%
+ \fi
+ \let\originalXMLnamespace\currentXMLnamespace
+ \checkXMLnamespace\rawXMLidentifier}
+
+\def\xsplitoffXMLnamespace% fast resplit
+ {\ifcsname\@@XMLnamespace:\currentXMLnamespace\endcsname
+ \csname\@@XMLnamespace:\currentXMLnamespace\endcsname
+ \fi}
+
+%D We will implement this macro later.
+
+\let\checkXMLnamespace\gobbleoneargument % see below
+
+%D The namespace attribute checking is part of the element
+%D parser, since the value of \type {xmlns} may influence other
+%D namespace mapping.
+
+\def\@@XMLns{xmlns}
+
+\def\checkXMLnamespaceattr#1% xmlns:\@@XMLname="\XMLns"
+ {\edef\XMLns{#1}%
+ \ifx\XMLns\empty \else
+ \ifcsname\@@XMLurlspace:\XMLns\endcsname
+ % get remapped namespace (from url)
+ % \edef\XMLns{\csname\@@XMLurlspace:\XMLns\endcsname}%
+ \@EA\let\@EA\XMLns\csname\@@XMLurlspace:\XMLns\endcsname
+ % remap this one
+ \ifx\@@XMLname\empty
+ % not watertight since no implicit grouping
+ \xautoXMLnamespace\XMLns
+ \else
+ \xremapXMLnamespace\@@XMLname\XMLns
+ % redo namespace remapping of self if needed
+ \ifx\XMLns\currentXMLnamespace
+ % i'm still not sure if this is ok
+ \else
+ \xsplitoffXMLnamespace
+ \fi
+ \fi
+ \fi
+ \fi}
-\long\def\defineXMLprocessor[#1]#2% watch the ?
- {\long\setvalue{\@@XMLinstruction:?#1}{#2}}
+%D Although not really needed, we clean up the arguments.
-%D As an example, we implement a \CONTEXT\ code handler:
+% \long\def\cleanupXMLarguments
+% {\ifnum\kindofXMLelement=\emptyXMLtag
+% \ifx\currentXMLarguments\empty \else
+% \@EA\docleanupXMLarguments\currentXMLarguments/\empty
+% \fi
+% \fi}
+%
+% \long\def\docleanupXMLarguments#1/#2\empty
+% {\edef\currentXMLarguments{#1}}
+%
+% we need to be ...="/" .... /> safe
-\defineXMLprocessor[context] {\contextXMLcommand}
-\defineXMLprocessor[context-command]{\contextXMLcommand}
+\long\def\cleanupXMLarguments
+ {\ifnum\kindofXMLelement=\emptyXMLtag
+ \ifx\currentXMLarguments\empty \else
+ \@EA\docleanupXMLarguments\currentXMLarguments/ \relax
+ \fi
+ \fi}
-\def\contextXMLcommand#1%
- {\pushmacro\disableXML
- \def\disableXML{\global\let\afterXMLprocessor\empty}%
- \global\let\afterXMLprocessor\enableXML
- \setnormalcatcodes\scantokens{#1}\afterXMLprocessor
- \popmacro\disableXML}
+\long\def\docleanupXMLarguments#1/ #2\relax % space added earlier
+ {\edef\currentXMLarguments{#1}}
-\defineXMLprocessor[context-directive]{\contextXMLdirective}
+\def\executeXMLelementA% no fallback
+ {\ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname
+ \csname\@@XMLelement:\currentXMLfullidentifier\endcsname
+ \fi}
-\def\contextXMLdirective#1%
- {\docontextXMLdirective#1 dummy dummy dummy\end}
+\def\executeXMLelementB% default fallback
+ {\csname \@@XMLelement:%
+ \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname
+ \currentXMLfullidentifier
+ \else
+ \defaultXMLelement
+ \fi
+ \endcsname}
+
+\def\executeXMLelementC% no namespace of default fallback
+ {\csname \@@XMLelement:%
+ \ifcsname\@@XMLelement:\currentXMLfullidentifier\endcsname
+ \currentXMLfullidentifier
+ \else\ifcsname\@@XMLelement:\currentXMLidentifier\endcsname
+ \currentXMLidentifier
+ \else
+ \defaultXMLelement
+ \fi\fi
+ \endcsname}
+
+\def\setXMLfallbackmode#1%
+ {\ifcase#1\relax
+ \let\executeXMLelement\executeXMLelementA
+ \or
+ \let\executeXMLelement\executeXMLelementB
+ \or
+ \let\executeXMLelement\executeXMLelementC
+ \fi}
+
+\setXMLfallbackmode2
+
+%D An example of fall back modes is given below.
-\def\docontextXMLdirective#1 #2 #3 #4\end% class var value
- {\setvalue{\@@XMLvariable:#1:#2}{#3}}
+%D Later we will implement the error handler, here we handle
+%D the default case.
-\defineXMLprocessor[context-message]{\contextXMLmessage}
+\def\someXMLelement#1%
+ {\ifnum\kindofXMLelement=\endXMLtag /\fi
+ #1%
+ \ifnum\kindofXMLelement=\emptyXMLtag/\fi}
+
+\def\defaultXMLelement%
+ {\someXMLelement\s!default}
-\def\contextXMLmessage#1%
- {\writestatus{xml}{#1}}
+%D It is possible to keep track of nesting automatically,
+%D but this would kind of prohibit things like \type
+%D {\ignorespaces}. In the future we may provide an
+%D automatic depth tracking as an alternative (exclusive)
+%D mode of operation combined with space grabbing.
-\def\setnormalcatcodes%
- {\catcode`\!=\@@other \catcode`\?=\@@other
- \catcode`\&=\@@alignment \catcode`\<=\@@other
- \catcode`\#=\@@parameter \catcode`\$=\@@mathshift
- \catcode`\%=\@@comment \catcode`\\=\@@escape
- \catcode`\^=\@@superscript \catcode`\_=\@@subscript
- %\catcode`\|=\@@active \catcode`\~=\@@active
- \catcode`\{=\@@begingroup \catcode`\}=\@@endgroup}
+\def\beginXMLelement
+ {\global\advance\XMLdepth \plusone % 1
+ \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\currentXMLelement}
-\let\disableXML\setnormalcatcodes
+\def\endXMLelement
+ {\global\advance\XMLdepth \minusone } % -1 }
-%D Given the previous definition, and given that \ETEX\ is
-%D used, we can now say:
+\def\XMLancestor#1%
+ {\ifnum\numexpr(\XMLdepth-#1)>0
+ \csname\@@XMLdepth:\the\numexpr(\XMLdepth-#1)\endcsname
+ \else
+ \currentXMLelement
+ \fi}
+
+\def\XMLparent%
+ {\XMLancestor1}
+
+% todo: split #1 into raws en reconstruct, set current etc, push and pop
+%
+% \def\beginXMLelement
+% {\dosingleempty\dobeginXMLelement}
+%
+% \def\dobeginXMLelement[#1]%
+% {\global\advance\XMLdepth 1
+% \global\@EA\let\csname\@@XMLdepth:\the\XMLdepth\endcsname\currentXMLelement
+% \global\@EA\edef\csname\@@XMLdopth:\the\XMLdepth\endcsname{\ownXMLelement}%
+% \iffirstargument\edef\ownXMLelement{#1}\fi}
+%
+% \def\endXMLelement
+% {\@EA\let\@EA\ownXMLelement\csname\@@XMLdopth:\the\XMLdepth\endcsname
+% \global\advance\XMLdepth -1 }
+
+%D \defineXMLenvironment[one]
+%D {\beginXMLelement}
+%D {\endXMLelement}
+%D
+%D \defineXMLenvironment[two]
+%D {\beginXMLelement
+%D \starttabulate
+%D \NC parent 1 \NC \XMLparent{1} \NC \NR
+%D \NC parent 2 \NC \XMLparent{2} \NC \NR
+%D \NC parent 3 \NC \XMLparent{3} \NC \NR
+%D \NC parent 4 \NC \XMLparent{4} \NC \NR
+%D \stoptabulate}
+%D {\endXMLelement}
+%D
+%D \startbuffer
+%D
+%D \stopbuffer
+%D
+%D fallback A: \setXMLfallbacklevel0 \processXMLbuffer
+%D fallback B: \setXMLfallbacklevel1 \processXMLbuffer
+%D fallback C: \setXMLfallbacklevel2 \processXMLbuffer
+
+%D Here we do the namespace (re)mapping. More examples are
+%D provided in the manual.
%D
%D \starttypen
-%D
+%D \supportXMLnamespace [test] % needed to get a namespace working
+%D \skipXMLnamespace [test] % slow
+%D \ignoreXMLnamespace [test] % faster
+%D \defineXMLenvironment [rubish:itemize] {[} {]}
+%D \defineXMLenvironment [rubish:item] {(} {)}
+%D \remapXMLnamespace [crap] [rubish]
+%D \remapXMLnamespace [con] [context]
+%D \remapXMLurlspace [http://www.pragma-ade.com/dtd/context] [context]
+%D \autoXMLnamespace [context] % fallback
+%D \autoXMLnamespace [whatever] % second fall back
%D \stoptypen
-%D
-%D A non||\ETEX\ solution is also possible, using buffers,
-%D but for the moment we assume that \ETEX\ is used.
-%D Next we will implement the normal element handler.
+\newtoks\autoXMLnamespaces
-\let\currentXMLarguments\empty
-\let\currentXMLelement \empty
+%D The automatically mapped namespaces (the fallbacks so to
+%D day) are collected in a token list.
-\newtoks\everyXMLelement
+\let\checkedXMLnamespace\empty
-\long\def\dodoXMLelement#1 #2>%
- {\def\!!stringa{#2}%
- \def\!!stringb{/ }%
- \ifx\!!stringa\empty
- \let\currentXMLarguments\empty
- \def\currentXMLelement{#1}%
- \the\everyXMLelement
- \else\ifx\!!stringa\!!stringb
- \let\currentXMLarguments\empty
- \def\currentXMLelement{#1/}%
- \the\everyXMLelement
+\def\checkXMLnamespace#1%
+ {\edef\checkedXMLnamespace{#1}%
+ \ifcsname\@@XMLnamespace:\currentXMLnamespace\endcsname
+ \csname\@@XMLnamespace:\currentXMLnamespace\endcsname
+ % forced namespace
+ \else\ifcsname\@@XMLelement:\currentXMLelement\endcsname
+ % natural element
+ \else\ifcsname\@@XMLelement:\currentXMLelement/\endcsname
+ % natural element
\else
- \def\currentXMLelement{#1}%
- \def\currentXMLarguments{#2}%
- \the\everyXMLelement
- %\getXMLarguments\currentXMLelement{#2}%
- \dogetXMLarguments\currentXMLelement#2>%
- \fi \fi
- \executeXMLelement\currentXMLelement}
-
-\def\executeXMLelement#1%
- {\getvalue{\@@XMLelement:#1}}
-
-\newif\ifXMLrawentities
+ % locate fallback
+ \donefalse\the\autoXMLnamespaces
+ \fi\fi\fi}
-% \bgroup
-%
-% \catcode`<=\@@active
-%
-% \gdef\defineXMLentity[#1]#2%
-% {\unspaceargument#1\to\ascii
-% \long\setvalue{\@@XMLelement:ent:\@EA\firstofoneargument\ascii/}{#2}}
-%
-% \gdef\doXMLentity#1;%
-% {\ifXMLrawentities#1\else\executeXMLentity{#1}\fi}
-%
-% \gdef\executeXMLentity#1%
-% {}
-%
-% \gdef\getXMLentity#1%
-% {\getvalue{\@@XMLelement:ent:#1/}}
-%
-% \gdef\doifXMLentityelse#1#2#3%
-% {\ifundefined{\@@XMLelement:ent:#1/}#3\else#2\fi}
-%
-% \egroup
+\def\skipXMLnamespace[#1]%
+ {\letvalue{\@@XMLnamespace:#1}\doXMLskipnamespace}
-\gdef\defineXMLentity[#1]#2%
- {\unspaceargument#1\to\ascii
- \long\setvalue{\@@XMLentity:\@EA\firstofoneargument\ascii}{#2}}
+\def\doXMLskipnamespace
+ {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname
+ {\getXMLgroupedignore\checkedXMLnamespace}}
+
+\def\hideXMLnamespace[#1]%
+ {\letvalue{\@@XMLnamespace:#1}\doXMLhidenamespace}
+
+\def\doXMLhidenamespace
+ {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname
+ {\redoXMLignore\checkedXMLnamespace}}
+
+\def\ignoreXMLnamespace[#1]%
+ {\letvalue{\@@XMLnamespace:#1}\doXMLignorenamespace}
+
+\def\doXMLignorenamespace % \let binnen def
+ {\long\@EA\def\csname\@@XMLelement:\checkedXMLnamespace\endcsname
+ {\@EA\redoXMLignore\@EA{\checkedXMLnamespace}}} % EA ?
+
+\def\remapXMLnamespace
+ {\dodoubleargument\doremapXMLnamespace}
+
+\def\doremapXMLnamespace[#1][#2]%
+ {\ifsecondargument
+ \setvalue{\@@XMLnamespace:#1}{\def\currentXMLnamespace{#2}}%
+ \else
+ \letvalue{\@@XMLnamespace:#1}\relax
+ \fi}
+
+\def\supportXMLnamespace%
+ {\dosingleargument\dosupportXMLnamespace}
+
+\def\dosupportXMLnamespace[#1]%
+ {\setvalue{\@@XMLnamespace:#1}{\def\currentXMLnamespace{#1}}}
+
+\def\xremapXMLnamespace#1#2% fast internal one
+ {\@EA\edef\csname\@@XMLnamespace:#1\endcsname
+ {\def\noexpand\currentXMLnamespace{#2}}}
+
+\def\autoXMLnamespace[#1]%
+ {\xautoXMLnamespace{#1}}
+
+\def\xautoXMLnamespace#1% fast internal one
+ {\ifcsname\@@XMLnamespace-#1\endcsname\else
+ \@EA\appendtoks\csname\@@XMLnamespace-#1\endcsname\to\autoXMLnamespaces
+ \fi
+ \@EA\edef\csname\@@XMLnamespace-#1\endcsname
+ {\noexpand\doautoXMLnamespace{#1}}}
+
+\def\doautoXMLnamespace#1% \done is set before list
+ {\ifdone\else
+ \ifcsname\@@XMLelement:#1:\checkedXMLnamespace\endcsname
+ \def\currentXMLnamespace{#1}%
+ \else\ifcsname\@@XMLelement:#1:\checkedXMLnamespace/\endcsname
+ \def\currentXMLnamespace{#1}%
+ \fi\fi
+ \fi}
+
+\def\resetXMLnamespace[#1]%
+ {\letvalue{\@@XMLnamespace-#1}\gobbleoneargument
+ \letvalue{\@@XMLnamespace:#1}\gobbleoneargument}
+
+\def\remapXMLurlspace
+ {\dodoubleargument\doremapXMLurlspace}
-% we need to be able to do:
+\def\doremapXMLurlspace[#1][#2]%
+ {\setvalue{\@@XMLurlspace:#1}{#2}}
+
+%D Entities needs a bit more work, as well as a connection
+%D with the encoding handlers.
+
+% we need to be able to do:
%
% \defineXMLentity[amp] {\FunnyAmp} \def\FunnyAmp#1;{\getXMLentity{#1}}
%
% \defineXMLentity [pound] {(why not use euro's?)}
-%
+%
% \startXMLdata
% test £ test
% \stopXMLdata
%
-% so we need an ifless implementation of:
+% so we need an ifless implementation
-\gdef\doXMLentity#1;%
- {\ifXMLrawentities
- \expandafter\firstofoneargument
+% \eacute -> simplified -> e (via raw encoding)
+% -> raw -> eacute (via handler)
+%
+% naming sucks
+
+\newif\ifXMLrawentities % proper fallback
+\newif\ifXMLsimpleentities % last resort
+
+\def\simpleXMLencoding{raw}
+
+\def\simplifyXMLentities%
+ {\fastenableencoding\simpleXMLencoding
+ \XMLsimpleentitiestrue}
+
+\gdef\defineXMLentity%
+ {\dodoubleempty\dodefineXMLentity}
+
+\gdef\dodefineXMLentity[#1][#2]#3%
+ {\ifsecondargument
+ \defineXMLentities[#1]{#2}{#3}%
+ \else
+ \dododefineXMLentity{#1}{#3}%
+ \fi}
+
+\def\defineXMLentities[#1]#2#3%
+ {\dododefineXMLentity{#1}{\ifXMLsimpleentities#2\else#3\fi}}
+
+\gdef\dododefineXMLentity#1#2%
+ {\unspaceargument#1\to\ascii % #1 can be {[} or so
+ \long\setvalue{\@@XMLentity:\@EA\firstofoneargument\ascii}{#2}}
+
+%D May this wile become dodo (more in tune with rest);
+%D beware: also remapped in xtag-map.
+
+\gdef\doXMLentity#1#2;% interesting: # is now ##
+ {\if\string#1\letterhash
+ \@EA\parseXMLcharacter
+ \else\ifXMLrawentities
+ \@EAEAEA\firstofoneargument
+ \else
+ \@EAEAEA\executeXMLentity
+ \fi\fi{#1#2}}
+
+%D Here we need to get rid of the double hash and act upon the
+%D number. Proper hex/oct number support can be implemented by
+%D redefining \type {\executeXMLcharacter}.
+
+% \def\parseXMLcharacter#1% gobble the ##x
+% {\@EA\executeXMLcharacter\@EA{\gobblethreearguments#1}}
+%
+% single hash now
+%
+% \def\parseXMLcharacter#1%
+% {\@EA\executeXMLcharacter\@EA{\gobbleoneargument#1}}
+%
+% \def\executeXMLcharacter#1% can be overloaded
+% {\ifnum"#1<256
+% \@EA\getXMLcharacter
+% \else\ifXMLrawentities
+% \@EAEAEA\firstofoneargument
+% \else
+% \@EAEAEA\unknownXMLcharacter
+% \fi\fi{\number"#1}}
+%
+% \unexpanded\def\getXMLcharacter#1{\rawcharacter{#1}}
+
+\def\parseXMLcharacter#1%
+ {\@EA\executeXMLcharacter\gobbleoneargument#1\empty\relax}
+
+\def\executeXMLcharacter#1#2\relax
+ {\if#1x%
+ \@EA\executeXMLhexcharacter
+ \else
+ \@EA\executeXMLdeccharacter
+ \fi#1#2\relax}
+
+% \def\executeXMLhexcharacter x#1\relax % can be overloaded
+% {\ifnum"#1<256
+% \@EA\getXMLcharacter
+% \else\ifXMLrawentities
+% \@EAEAEA\firstofoneargument
+% \else
+% \@EAEAEA\unknownXMLcharacter
+% \fi\fi{\number"#1}}
+
+\def\executeXMLhexcharacter x#1\relax % can be overloaded
+ {\uppercase{\doexecuteXMLhexcharacter#1\relax}}
+
+\def\doexecuteXMLhexcharacter#1\relax
+ {\ifnum"#1<256
+ \@EA\getXMLcharacter
+ \else\ifXMLrawentities
+ \@EAEAEA\firstofoneargument
+ \else
+ \@EAEAEA\unknownXMLcharacter
+ \fi\fi{\number"#1}}
+
+% ==
+%
+% \def\executeXMLhexcharacter x#1\relax
+% {\uppercase{\ifnum"#1}<256
+% \@EA\getXMLcharacter
+% \else\ifXMLrawentities
+% \@EAEAEA\firstofoneargument
+% \else
+% \@EAEAEA\unknownXMLcharacter
+% \fi\fi{\uppercase{\number"#1}}}
+
+\def\executeXMLdeccharacter#1\relax % can be overloaded
+ {\ifnum#1<256
+ \@EA\getXMLcharacter
+ \else\ifXMLrawentities
+ \@EAEAEA\firstofoneargument
+ \else
+ \@EAEAEA\unknownXMLcharacter
+ \fi\fi{\number#1}}
+
+\unexpanded\def\getXMLcharacter#1%
+ {\ifcsname\@@XMLentity:#1\endcsname
+ \@EA\getXMLentity
\else
- \expandafter\executeXMLentity
+ \@EA\rawcharacter
\fi{#1}}
-\def\executeXMLentity#1% internal ! ! !
+\def\unknownXMLcharacter#1{[#1]}
+
+% \useXMLfilter[ent]
+%
+% \defineXMLsingular[test]{{\simplifyXMLentities\XMLpar{test}{bla}{}}}
+%
+% \startXMLdata
+%
+% \stopXMLdata
+%
+% \defineXMLentity[45]{|it works|} % {|-|}
+%
+% \startXMLdata
+% text-.text
+% textEFtext
+% \stopXMLdata
+
+%D May be this will change a bit ...
+
+\def\executeXMLentity#1% named one
{\getXMLentity{#1}}
-\def\expandedXMLentity#1%
- {\getvalue{\@@XMLentity:#1}}
+%\def\expandedXMLentity#1%
+% {\ifcsname\@@XMLentity:#1\endcsname\csname\@@XMLentity:#1\endcsname\fi}
+%
+%\unexpanded\def\getXMLentity#1%
+% {\ifcsname\@@XMLentity:#1\endcsname\csname\@@XMLentity:#1\endcsname\fi}
+%
+%\def\expandedXMLentity#1%
+% {\csname\@@XMLentity:#1\endcsname}
+%
+%\unexpanded\def\getXMLentity#1%
+% {\csname\@@XMLentity:#1\endcsname}
+
+\newif\ifautoXMLentities % fall back on context commands
+
+\def\expandedXMLentity#1%
+ {\ifcsname\@@XMLentity:#1\endcsname \@EA \execXMLentity
+ \else\ifautoXMLentities \@EAEAEA \autoXMLentity
+ \else \@EAEAEA \crapXMLentity
+ \fi\fi{#1}}
+
+\def\execXMLentity#1%
+ {\csname\@@XMLentity:#1\endcsname}
+
+\def\crapXMLentity#1%
+ {\inframed[\c!offset=.1ex]{\tttf#1}}
+
+\def\autoXMLentity#1%
+ {\ifcsname#1\endcsname\csname#1\endcsname\fi}
-\unexpanded\def\getXMLentity#1%
- {\getvalue{\@@XMLentity:#1}}
+\unexpanded\def\getXMLentity{\expandedXMLentity}
\gdef\doifXMLentityelse#1#2#3%
- {\ifundefined{\@@XMLentity:#1}#3\else#2\fi}
+ {\ifcsname\@@XMLentity:#1\endcsname#2\else#3\fi}
-% \long\def\getXMLarguments#1#2%
-% {\dogetXMLarguments{#1}#2>}
-%
-% \long\def\dogetXMLarguments#1%
-% {\XMLtoks\emptytoks
-% \def\@@XMLclass{#1}%
-% \let\dodoparseXMLarguments\doparseXMLarguments
-% \doparseXMLarguments}
-%
-% \def\dosetXMLargument#1%
-% {\setvalue{\@@XMLvariable:\@@XMLclass:\@@XMLname}{#1}%
-% %\message{[\@@XMLname=#1]}%
-% \let\dodoparseXMLarguments\doparseXMLarguments
-% \dodoparseXMLarguments}
-
-% see \defineXML... commands:
+% see \defineXML... commands:
%
% [key=val] => \presetXMLarguments{element} => default key/vals
% [blabla] => \theXMLarguments{blabla} => user key/vals
@@ -496,78 +1039,217 @@
%
% stored in case of [blabla] else set as \XMLpar
%
-% see m-steps for an example of usage
+% see m-steps for an example of usage
+
+\let\@@XMLmapmap\empty
+\newif\ifXMLnamespace
\long\def\getXMLarguments#1#2%
- {\dogetXMLarguments{#1}#2>}
+ {\XMLnamespacefalse
+ \dogetXMLarguments{#1}#2>}
+
+\let\dosetXMLattributeA\gobbleoneargument
+
+\def\dosetXMLattributeB#1%
+ {\ifx\@@XMLspac\originalXMLnamespace
+ \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname{#1}%
+ \fi}
+
+% \def\dosetXMLattributeC#1%
+% {\ifx\@@XMLspac\originalXMLnamespace
+% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname{#1}%
+% \else
+% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLspac:\@@XMLname\endcsname{#1}%
+% \fi}
+
+\def\dosetXMLattributeC%
+ {\@EA\def\csname\@@XMLvariable:\@@XMLclass\ifx\@@XMLspac
+ \originalXMLnamespace\else:\@@XMLspac\fi:\@@XMLname\endcsname}
+
+% \def\dosetXMLattributeD#1%
+% {\ifx\@@XMLspac\originalXMLnamespace
+% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\currentXMLnamespace:\@@XMLname\endcsname{#1}%
+% \else
+% \@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLspac:\@@XMLname\endcsname{#1}%
+% \fi}
+
+\def\dosetXMLattributeD%
+ {\@EA\def\csname\@@XMLvariable:\@@XMLclass:\ifx\@@XMLspac
+ \originalXMLnamespace\currentXMLnamespace\else\@@XMLspac\fi
+ :\@@XMLname\endcsname}
+
+\def\setXMLattributemode#1%
+ {\ifcase#1\relax
+ \let\dosetXMLattribute\dosetXMLattributeA
+ \or
+ \let\dosetXMLattribute\dosetXMLattributeB
+ \or
+ \let\dosetXMLattribute\dosetXMLattributeC
+ \or
+ \let\dosetXMLattribute\dosetXMLattributeD
+ \fi}
+
+\setXMLattributemode{2} % a reasonable default
+
+\let\@@XMLspac\empty % argumentnamespace
\long\def\dogetXMLarguments#1%
{\XMLtoks\emptytoks
\ifcsname\@@XMLmap:#1\endcsname
- \let\dosetXMLargument\dosetXMLargumentB
+ \let\dodosetXMLargument\dodosetXMLargumentB
\else
\def\@@XMLclass{#1}%
- \let\dosetXMLargument\dosetXMLargumentA
+ \let\dodosetXMLargument\dodosetXMLargumentA
\fi
\let\dodoparseXMLarguments\doparseXMLarguments
\doparseXMLarguments}
-\def\dosetXMLargumentA#1%
- {\setvalue{\@@XMLvariable:\@@XMLclass:\@@XMLname}{#1}%
+\long\def\doparseXMLarguments#1% space goes ok
+ {\if#1>%
+ \let\dodoparseXMLarguments\empty
+ \else\if#1=%
+ \edef\@@XMLname{\the\XMLtoks}%
+ \XMLtoks\emptytoks
+ \else\if#1"%
+ \let\dodoparseXMLarguments\dodoparseXMLargumentsD
+ \else\if#1'%
+ \let\dodoparseXMLarguments\dodoparseXMLargumentsS
+ \else\if#1:%
+ \XMLnamespacetrue
+ \edef\@@XMLspac{\the\XMLtoks}%
+ \XMLtoks\emptytoks
+ \else\if#1/%
+ \chardef\kindofXMLelement\emptyXMLtag
+ \else
+ \XMLtoks\@EA{\the\XMLtoks#1}%
+ \fi\fi\fi\fi\fi\fi
+ \dodoparseXMLarguments}
+
+\def\dodoparseXMLargumentsD#1"{\dosetXMLargument{#1}}
+\def\dodoparseXMLargumentsS#1'{\dosetXMLargument{#1}}
+
+\def\dosetXMLargument#1%
+ {\ifXMLnamespace
+ \ifx\@@XMLspac\@@XMLns
+ \checkXMLnamespaceattr{#1}% xmlns:\@@XMLname="#1"
+ \else
+ \dosetXMLattribute{#1}% some:\@@XMLname="#1"
+ \fi
+ \XMLnamespacefalse
+ \else\ifx\@@XMLname\@@XMLns
+ \checkXMLnamespaceattr{#1}% xmlns="#1"
+ \else
+ \dodosetXMLargument{#1}%
+ \fi\fi
\let\dodoparseXMLarguments\doparseXMLarguments
- %\message{[\@@XMLclass][\@@XMLname=#1]}\wait
\dodoparseXMLarguments}
-\def\dosetXMLargumentB#1%
- {\setevalue{\@@XMLmap:\@@XMLmapmap}%
- {\@EA\ifx\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty\else
- \csname\@@XMLmap:\@@XMLmapmap\endcsname,%
- \fi
- \@@XMLname=#1}%
+\def\dosetXMLargument#1% ugly alternative
+ {\ifXMLnamespace
+ \XMLnamespacefalse
+ \ifx\@@XMLspac\@@XMLns
+ \@EAEAEA\checkXMLnamespaceattr % xmlns:\@@XMLname="#1"
+ \else
+ \@EAEAEA\dosetXMLattribute % some:\@@XMLname="#1"
+ \fi
+ \else\ifx\@@XMLname\@@XMLns
+ \@EAEAEA\checkXMLnamespaceattr % xmlns="#1"
+ \else
+ \@EAEAEA\dodosetXMLargument
+ \fi\fi{#1}%
\let\dodoparseXMLarguments\doparseXMLarguments
- %\message{[\@@XMLprefix][\@@XMLname=#1]}\wait
\dodoparseXMLarguments}
+\def\dodosetXMLargumentA%
+ {\@EA\def\csname\@@XMLvariable:\@@XMLclass:\@@XMLname\endcsname}
+
+\def\dodosetXMLargumentB#1%
+ {\@EA\edef\csname\@@XMLmap:\@@XMLmapmap\endcsname
+ {\@EA\ifx\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty\else
+ \csname\@@XMLmap:\@@XMLmapmap\endcsname,%
+ \fi
+ \@@XMLname=#1}}
+
\appendtoks
- \resetXMLarguments\currentXMLelement
+ \resetXMLarguments{\rawXMLnamespace\rawXMLidentifier}%
\to \everyXMLelement
\def\resetXMLarguments#1%
{\ifcsname\@@XMLmap:#1\endcsname
- \@EA\let\@EA\@@XMLmapmap\csname\@@XMLmap:#1\endcsname
- \@EA\let\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty
- \fi}
+ \@EA\let\@EA\@@XMLmapmap\csname\@@XMLmap:#1\endcsname
+ \@EA\let\csname\@@XMLmap:\@@XMLmapmap\endcsname\empty
+ \fi}
\def\theXMLarguments#1%
{\ifcsname\@@XMLmap:#1\endcsname\csname\@@XMLmap:#1\endcsname\fi}
-\long\def\doparseXMLarguments#1% space goes ok
- {\if#1>%
- \let\dodoparseXMLarguments\empty
- \else\if#1=%
- \edef\@@XMLname{\the\XMLtoks}%
- \XMLtoks\emptytoks
- \else\if#1"%
- \let\dodoparseXMLarguments\dodoparseXMLargumentsD
- \else\if#1'%
- \let\dodoparseXMLarguments\dodoparseXMLargumentsS
- \else\if#1/%
- \edef\currentXMLelement{\currentXMLelement/}%
- \else
- \@EA\XMLtoks\@EA{\the\XMLtoks#1}%
- \fi\fi\fi\fi\fi
- \dodoparseXMLarguments}
+\newtoks\globalscratchtoks
+
+\def\expandXMLvalue#1%
+ {\ifcsname#1\endcsname
+ \bgroup
+\enableXMLexpansion
+ \let\getXMLentity\expandedXMLentity
+ \expanded{\global\globalscratchtoks{\csname#1\endcsname}}%
+ \egroup
+ \@EA\edef\csname#1\endcsname{\the\globalscratchtoks}%
+ \fi}
+
+\def\expandTEXpar #1#2{\expandXMLvalue{#1\interfaced{#2}}}
+\def\expandXMLpar #1#2{\expandXMLvalue{\@@XMLvariable:#1:#2}}
+\def\expandXMLarguments#1{\expandXMLvalue{\@@XMLmap:#1}}
+
+%D \startbuffer[tex]
+%D \defineXMLsingular [fx:root]
+%D {\XMLNSpar{fx:root}{xml}{lang}{}
+%D \XMLpar{fx:root}{xml:lang}{}
+%D \starttabulate[||||]
+%D \HL
+%D \NC \bf mode \NC \bf call \NC \bf result \NC\NR
+%D \HL
+%D \NC 0\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR
+%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC \NC\NR
+%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR
+%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC \NC\NR
+%D \HL
+%D \NC 1\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR
+%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR
+%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR
+%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC \NC\NR
+%D \HL
+%D \NC 2\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR
+%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR
+%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC \NC\NR
+%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC en \NC\NR
+%D \HL
+%D \NC 3\NC\asciistr{\XMLpar {fx:root} {crap} {}} \NC dirt \NC\NR
+%D \NC \NC\asciistr{\XMLpar {fx:root} {junk} {}} \NC junk \NC\NR
+%D \NC \NC\asciistr{\XMLNSpar {fx:root} {fx} {crap} {}}\NC rubish\NC\NR
+%D \NC \NC\asciistr{\XMLNSpar {fx:root} {xml} {lang} {}}\NC en \NC\NR
+%D \HL
+%D \stoptabulate}
+%D
+%D \remapXMLurlspace [http://www.w3.org/1999/XSL/Format] [fx]
+%D \stopbuffer
+%D
+%D \startbuffer[xml]
+%D
+%D \stopbuffer
+%D
+%D \typebuffer[tex] \processTEXbuffer[tex]
+%D \typebuffer[xml] \processXMLbuffer[xml]
-\def\dodoparseXMLargumentsD#1"{\dosetXMLargument{#1}}
-\def\dodoparseXMLargumentsS#1'{\dosetXMLargument{#1}}
-
%D The previous macros were the basic parser and their working
%D is left to the imagination of the reader. These macros
-%D will be improved.
+%D will be improved over time. We use rather low level
+%D definitions so that the mappings will run as fast as
+%D possible.
-\bgroup
-
-\catcode`<=\@@active
+\bgroup \catcode`<=\@@active
\long\gdef\dododefineXMLsingular#1#2%
{\long\setvalue{\@@XMLelement:#1/}{#2}}
@@ -580,30 +1262,76 @@
{\long\setvalue{\@@XMLelement:#1}{\groupedcommand{#2}{}\bgroup}%
\long\setvalue{\@@XMLelement:/#1}{\egroup}}
+%\long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
+% {\long\setvalue{\@@XMLelement:#1/}{#2{}}%
+% \long\setvalue{\@@XMLelement:#1}##1#1>{#2{##1}}}
+
\long\gdef\dododefineXMLargument#1#2% watch the {} around ##1
{\long\setvalue{\@@XMLelement:#1/}{#2{}}%
- \long\setvalue{\@@XMLelement:#1}##1#1>{#2{##1}}}
+ \long\setvalue{\@@XMLelement:#1}{\redoXMLargument{#1}{#2}}}
+
+\long\gdef\redoXMLargument#1#2%
+ {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2{##1}}%
+ \next}
+
+%\long\gdef\dododefineXMLignore#1%
+% {\long\setvalue{\@@XMLelement:#1/}{}%
+% \long\setvalue{\@@XMLelement:#1}##1#1>{}}
\long\gdef\dododefineXMLignore#1%
{\long\setvalue{\@@XMLelement:#1/}{}%
- \long\setvalue{\@@XMLelement:#1}##1#1>{}}
+ \long\setvalue{\@@XMLelement:#1}{\redoXMLignore{#1}}}
+
+\long\gdef\redoXMLignore#1%
+ {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{}%
+ \next}
+
+%\long\gdef\dododefineXMLpickup#1#2#3%
+% {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
+% \long\setvalue{\@@XMLelement:#1}##1#1>{#2##1#3}}
\long\gdef\dododefineXMLpickup#1#2#3%
{\long\setvalue{\@@XMLelement:#1/}{#2#3}%
- \long\setvalue{\@@XMLelement:#1}##1#1>{#2##1#3}}
+ \long\setvalue{\@@XMLelement:#1}{\redoXMLpickup{#1}{#2}{#3}}}
+
+\long\gdef\redoXMLpickup#1#2#3%
+ {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>{#2##1#3}%
+ \next}
\long\gdef\dododefineXMLenvironment#1#2#3%
- {\long\setvalue{\@@XMLelement:#1/}{#2#3}% % genereert evt relax
+ {\long\setvalue{\@@XMLelement:#1/}{#2#3}%
\long\setvalue{\@@XMLelement:#1}{#2}%
\long\setvalue{\@@XMLelement:/#1}{#3}}
-\long\gdef\dododefineXMLpush#1%
- {\long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
- \long\setvalue{\@@XMLelement:#1}##1#1>{\long\setvalue{\@@XMLdata:#1}{##1}}}
+%\long\gdef\dododefineXMLsave#1%
+% {\letvalue{\@@XMLdata:#1}\longempty
+% \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
+% \long\setvalue{\@@XMLelement:#1}##1#1>{\long\setvalue{\@@XMLdata:#1}{##1}}}
-\long\gdef\dododefineXMLenvironmentpush#1#2#3%
- {\long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
- \long\setvalue{\@@XMLelement:#1}##1#1>{#2\long\setvalue{\@@XMLdata:#1}{##1}#3}}
+\long\gdef\dododefineXMLsave#1%
+ {\letvalue{\@@XMLdata:#1}\longempty
+ \long\setvalue{\@@XMLelement:#1/}{\long\setvalue{\@@XMLdata:#1}{}}%
+ \long\setvalue{\@@XMLelement:#1}{\redoXMLsave{#1}}}
+
+\gdef\redoXMLsave#1%
+ {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
+ {\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}}%
+ \next}
+
+%\long\gdef\dododefineXMLenvironmentsave#1#2#3%
+% {\letvalue{\@@XMLdata:#1}\longempty
+% \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
+% \long\setvalue{\@@XMLelement:#1}##1#1>{#2\long\setvalue{\@@XMLdata:#1}{##1}#3}}
+
+\long\gdef\dododefineXMLenvironmentsave#1#2#3%
+ {\letvalue{\@@XMLdata:#1}\longempty
+ \long\setvalue{\@@XMLelement:#1/}{#2\long\setvalue{\@@XMLdata:#1}{}#3}%
+ \long\setvalue{\@@XMLelement:#1}{\redoXMLenvironmentsave{#1}{#2}{#3}}}
+
+\gdef\redoXMLenvironmentsave#1#2#3%
+ {\long\@EA\def\@EA\next\@EA##\@EA1\@EA<\@EA/\currentXMLelement>%
+ {#2\long\@EA\def\csname\@@XMLdata:#1\endcsname{##1}#3}%
+ \next}
\long\gdef\dododefineXMLprocess#1%
{\long\setvalue{\@@XMLelement:#1/}{}%
@@ -627,11 +1355,16 @@
\def\defineXMLignore {\dotripleempty\dodefineXMLignore}
\def\defineXMLpickup {\dotripleempty\dodefineXMLpickup}
\def\defineXMLenvironment {\dotripleempty\dodefineXMLenvironment}
-\def\defineXMLpush {\dotripleempty\dodefineXMLpush}
-\def\defineXMLenvironmentpush{\dotripleempty\dodefineXMLenvironmentpush}
+\def\defineXMLsave {\dotripleempty\dodefineXMLsave}
+\def\defineXMLenvironmentsave{\dotripleempty\dodefineXMLenvironmentsave}
\def\defineXMLprocess {\dotripleempty\dodefineXMLprocess}
-% goes for all types
+% push is (not yet) a real push, so:
+
+\def\defineXMLpush {\dotripleempty\dodefineXMLsave}
+\def\defineXMLenvironmentpush{\dotripleempty\dodefineXMLenvironmentsave}
+
+% goes for all types
\def\defineXMLnested {\dotripleempty\dodefineXMLnestedenvironment}
\def\defineXMLnestedenvironment{\dotripleempty\dodefineXMLnestedenvironment}
@@ -658,11 +1391,11 @@
\long\def\dodefineXMLenvironment[#1][#2][#3]#4#5%
{\defineXMLmethod\dododefineXMLenvironment{#1}{#2}{#3}{#4}{#5}}
-\long\def\dodefineXMLpush[#1][#2][#3]%
- {\defineXMLmethod\dododefineXMLpush{#1}{#2}{#3}{}{}}
+\long\def\dodefineXMLsave[#1][#2][#3]%
+ {\defineXMLmethod\dododefineXMLsave{#1}{#2}{#3}{}{}}
-\long\def\dodefineXMLenvironmentpush[#1][#2][#3]#4#5%
- {\defineXMLmethod\dododefineXMLenvironmentpush{#1}{#2}{#3}{#4}{#5}}
+\long\def\dodefineXMLenvironmentsave[#1][#2][#3]#4#5%
+ {\defineXMLmethod\dododefineXMLenvironmentsave{#1}{#2}{#3}{#4}{#5}}
\long\def\dodefineXMLprocess[#1][#2][#3]%
{\defineXMLmethod\dododefineXMLprocess{#1}{#2}{#3}{}{}}
@@ -678,105 +1411,151 @@
% [blabla] [key=val] => \presetXMLarguments{element} => default key/vals
% \theXMLarguments{blabla} => user key/vals
-\long\def\defineXMLmethod#1#2#3#4#5#6% command element [map] [parlst] begin end
+% command element [map] [parlst] begin end
+
+\long\def\defineXMLmethod#1#2#3#4#5#6%
{\ifsecondargument
- \setXMLarguments{#2}{#3}{#4}%
- \fi
- \ifignoreXMLcase
- \lowercasestring#2\to\ascii \@EA#1\@EA{\ascii}{#5}{#6}%
- \uppercasestring#2\to\ascii \@EA#1\@EA{\ascii}{#5}{#6}%
+ \setXMLarguments{#2}{#3}{#4}%
\else
- #1{#2}{#5}{#6}%
- \fi}
+ \resetXMLarguments{#2}% new
+ \fi
+ #1{#2}{#5}{#6}}
+
+%D Arguments (attributes) \unknown
-\def\setXMLarguments#1#2#3% element [tag] settings
+\long\def\setXMLarguments#1#2#3% element [tag] settings
{\doifassignmentelse{#2}
- {\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}}
- {\setvalue{\@@XMLmap :#1}{#2}% later we can init vars by this name
- \doifsomething{#3}{\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}}
+ {\long\setvalue{\@@XMLpars:#1}{\getrawparameters[\@@XMLvariable:#1:][#2]}}
+ {\long\setvalue{\@@XMLmap :#1}{#2}% later we can init vars by this name
+ \doifsomething{#3}{\long\setvalue{\@@XMLpars:#1}{\getrawparameters[#2][#3]}}}}
\def\presetXMLarguments#1%
- {\getvalue{\@@XMLpars:#1}}
+ {\csname\@@XMLpars:\rawXMLnamespace#1\endcsname} % == \getvalue{}
\prependtoks
- \presetXMLarguments\currentXMLelement
+ \presetXMLarguments\rawXMLidentifier
\to \everyXMLelement
-\def\doifXMLdataelse#1#2#3% % \relax too, so no etex
-% wrong
-% {\expandafter\ifx\csname\@@XMLdata:#1\endcsname\relax
-% slow
-% {\ifundefined{\@@XMLdata:#1}%
-% etex
- {\unless\ifcsname\@@XMLdata:#1\endcsname
- #3%
- \else\expandafter\ifx\csname\@@XMLdata:#1\endcsname\empty
- #3%
- \else\expandafter\ifx\csname\@@XMLdata:#1\endcsname\relax
- #3%
+\long\def\longempty{}
+\long\def\longspace{ }
+
+\def\doifelseXMLdata#1% always empty at start [gets a long assignment]
+ {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty
+ \expandafter\secondoftwoarguments
\else
- #2%
- \fi\fi\fi}
+ \expandafter\firstoftwoarguments
+ \fi}
-\def\XMLpop#1% one level
-% wrong
-% {\expandafter\ifx\csname\@@XMLdata:#1\endcsname\relax\else
-% \csname\@@XMLdata:#1\endcsname
-% \fi}
-% slow, hm was not commented
-% {\ifundefined{\@@XMLdata:#1}\else\getvalue{\@@XMLdata:#1}\fi}
-% etex
- {\ifcsname\@@XMLdata:#1\endcsname\csname\@@XMLdata:#1\endcsname\fi}
-
-\def\XMLpopdata#1% see m-steps for usage
- {\unless\ifcsname\@@XMLdata:#1\endcsname
- \else\expandafter\ifx\csname\@@XMLdata:#1\endcsname\empty
- \else\expandafter\ifx\csname\@@XMLdata:#1\endcsname\relax
+\def\doifXMLdata#1% always empty at start [gets a long assignment]
+ {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty
+ \expandafter\gobbleoneargument
\else
- \@EA\@EA\@EA\XMLdata\@EA\@EA\@EA{\csname\@@XMLdata:#1\endcsname}%
- \fi\fi\fi}
+ \expandafter\firstofoneargument
+ \fi}
+
+\let\doifXMLdataelse\doifelseXMLdata
+
+\def\doifelseXMLempty#1%
+ {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty
+ \expandafter\firstoftwoarguments
+ \else\@EA\ifx\csname\@@XMLdata:#1\endcsname\longspace
+ \expandthree\firstoftwoarguments
+ \else
+ \expandthree\secondoftwoarguments
+ \fi\fi}
-\def\XMLappend#1#2%
- {\edef\!!stringa{\@@XMLdata:#1}%
- \doifXMLdataelse{#1}%
- {\@EA\@EA\@EA\setvalue\@EA\@EA\@EA\!!stringa\@EA\@EA\@EA
- {\csname\!!stringa\endcsname#2}}
- {\setvalue\!!stringa{#2}}}
+% test case:
+%
+% \defineXMLenvironmentsave[test]
+% {}
+% {\message{[\XMLflush{test}]}
+% \message{\doifelseXMLdata {test}{}{no }data}
+% \message{/}
+% \message{\doifelseXMLempty{test}{}{not }empty}
+% \wait}
+%
+% \startXMLdata
+% xxx
+%
+%
+%
+%
+% x
+% \stopXMLdata
+
+\def\XMLflush#1% one level
+ {\csname\@@XMLdata:#1\endcsname}
+
+\def\XMLflushdata#1% see m-steps for usage
+ {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty\else
+ \@EAEAEA\XMLdata\@EA\@EA\@EA{\csname\@@XMLdata:#1\endcsname}%
+ \fi}
-\def\XMLprepend#1#2%
- {\edef\!!stringa{\@@XMLdata:#1}%
- \doifXMLdataelse{#1}%
- {\@EA\@EA\@EA\setvalue\@EA\@EA\@EA\!!stringa\@EA\@EA\@EA
- {#2\csname\!!stringa\endcsname}}
- {\setvalue\!!stringa{#2}}}
+\let\XMLpop \XMLflush
+
+\let\XMLpopdata\XMLflushdata
+
+\def\XMLappend#1#2% let to empty expands to nothing -)
+ {\long\@EA\edef\csname\@@XMLdata:#1\endcsname
+ {\csname\@@XMLdata:#1\endcsname#2}}
+
+\def\XMLprepend#1#2% let to empty expands to nothing -)
+ {\long\@EA\edef\csname\@@XMLdata:#1\endcsname
+ {#2\csname\@@XMLdata:#1\endcsname}}
\def\XMLerase#1%
- {\letvalue{\@@XMLdata:#1}\empty}
+ {\@EA\let\csname\@@XMLdata:#1\endcsname\longempty}
\def\XMLassign#1%
- {\setvalue{\@@XMLdata:#1}}
+ {\long\@EA\def\csname\@@XMLdata:#1\endcsname}
+
+\def\dontparseXMLelement#1>{}
+
+\def\simplifyXMLelements{\let\parseXMLelement\dontparseXMLelement}
\def\defXMLstring#1#2%
-% {\@EA\convertcommand\csname\@@XMLdata:#2\endcsname\to#1}
{\bgroup
+ \enableXMLexpansion
+ \simplifyXMLelements
\let\getXMLentity\firstofoneargument
+ \XMLrawentitiestrue
\xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}%
- \egroup
- \@EA\convertcommand\@@XML@@string\to#1}
-
+ \egroup
+ \convertcommand\@@XML@@string\to#1}
+
+\def\defXMLclean#1#2%
+ {\bgroup
+ \enableXMLexpansion
+ \simplifyXMLelements
+ \simplifyXMLentities
+ \let\getXMLentity\expandedXMLentity % should this go in \simplify ?
+ \xdef\@@XML@@string{\csname\@@XMLdata:#2\endcsname}%
+ \egroup
+ \convertcommand\@@XML@@string\to#1}
+
\def\XMLshow#1%
- {\showvalue{\@@XMLdata:#1\endcsname}}
+ {\showvalue{\@@XMLdata:#1}}
-\def\XMLunspace#1%
- {\ifcsname\@@XMLdata:#1\endcsname
- \setevalue{\@@XMLdata:#1}%
- {\@EA\@EA\@EA\dounspaced\csname\@@XMLdata:#1\endcsname\end}%
+\def\XMLunspace#1% kan sneller
+ {\@EA\ifx\csname\@@XMLdata:#1\endcsname\longempty\else
+ \long\@EA\edef\csname\@@XMLdata:#1\csname
+ {\@EAEAEA\dounspaced\csname\@@XMLdata:#1\endcsname\end}%
\fi}
+\chardef\asciispacecode=32
+
\def\defXMLlowerclean#1% lowercase ! evt tzt upper too
{\bgroup
- \lccode`\#=32\lccode`\$=32\lccode`\%=32\lccode`\\=32\lccode`\^=32
- \lccode`\_=32\lccode`\{=32\lccode`\}=32\lccode`\|=32\lccode`\~=32
+ \lccode`\#\asciispacecode
+ \lccode`\$\asciispacecode
+ \lccode`\%\asciispacecode
+ \lccode`\\\asciispacecode
+ \lccode`\^\asciispacecode
+ \lccode`\_\asciispacecode
+ \lccode`\{\asciispacecode
+ \lccode`\}\asciispacecode
+ \lccode`\|\asciispacecode
+ \lccode`\~\asciispacecode
\@EA\lowercase\@EA{\@EA\xdef\@EA#1\@EA{#1}}%
\egroup}
@@ -791,36 +1570,17 @@
\def\mapXMLvalue#1#2#3% td align center -> middle
{\setvalue{\@@XMLvalue:#1:#2:#3}}
-% \def\XMLvar#1#2#3% td align center
-% {\ifundefined{\@@XMLvariable:#1:#2}%
-% \XMLval{#1}{#2}{#3}%
-% \else
-% \XMLval{#1}{#2}{\getvalue{\@@XMLvariable:#1:#2}}%
-% \fi}
-%
-% \def\XMLval#1#2#3%
-% {\ifundefined{\@@XMLvalue:#1:#2}%
-% #3%
-% \else
-% \getvalue{\@@XMLvalue:#1:#2}%
-% \fi}
-%
-% \def\XMLpar#1#2#3%
-% {\ifundefined{\@@XMLvariable:#1:#2}%
-% #3%
-% \else
-% \getvalue{\@@XMLvariable:#1:#2}%
-% \fi}
-%
-% speedup
-
\def\XMLvar#1#2#3% td align center
{\ifcsname\@@XMLvariable:#1:#2\endcsname
\XMLval{#1}{#2}{\csname\@@XMLvariable:#1:#2\endcsname}%
\else
- \XMLval{#1}{#2}{#3}% evt inline code
+ \XMLval{#1}{#2}{#3}% evt inline code
\fi}
+% \def\XMLvar#1#2#3% td align center
+% {\XMLval{#1}{#2}{\ifcsname\@@XMLvariable:#1:#2\endcsname
+% \csname\@@XMLvariable:#1:#2\endcsname\else#3\fi}}
+
\def\XMLval#1#2#3%
{\ifcsname\@@XMLvalue:#1:#2\endcsname
\csname\@@XMLvalue:#1:#2\endcsname
@@ -835,76 +1595,166 @@
#3%
\fi}
-% so far for speedup
+\def\XMLNSpar#1#2#3#4% element namespace name default
+ {\ifcsname\@@XMLvariable:#1:#2:#3\endcsname
+ \csname\@@XMLvariable:#1:#2:#3\endcsname
+ \else
+ #4%
+ \fi}
+
+\def\setXMLpar#1#2%
+ {\@EA\def\csname\@@XMLvariable:#1:#2\endcsname}
+
+\def\TEXpar#1#2%
+ {\csname#1\interfaced{#2}\endcsname}
-\defineXMLsingular [begingroup] {\begingroup}
-\defineXMLsingular [endgroup] {\endgroup}
+\let\texXMLpar\TEXpar % soon obsolete
+
+\let\XMLtex\TEXpar
+
+% handy one
+
+\def\XMLtyp#1#2#3%
+ {\ifcsname\@@XMLvariable:#1:#2\endcsname
+ \@EA\convertcommand\csname\@@XMLvariable:#1:#2\endcsname\to\ascii
+ \else
+ \convertargument#3\to\ascii
+ \fi
+ \ascii}
+
+\defineXMLsingular [begingroup] {\begingroup}
+\defineXMLsingular [endgroup] {\endgroup}
+\defineXMLsingular [gobblespacetokens] {\gobblespacetokens}
+\defineXMLsingular [disableXML] {\disableXML}
\def\XMLstr#1%
{{\enableXML\scantokens{#1}\unskip}}
-\def\XMLstr#1% test
- {\scantokens{\begingroup\enableXML#1}}
-
-%\def\XMLstrpar#1#2#3%
-% {{\enableXML
-% \ifundefined{\@@XMLvariable:#1:#2}%
-% \scantokens{#3}%
-% \else
-% \scantokens\@EA\@EA\@EA
-% {\csname\@@XMLvariable:#1:#2\endcsname}\unskip
-% \fi}}
+\def\XMLstr#1% test
+ {\scantokens{\begingroup\enableXML#1\gobblespacetokens}}
-\def\XMLstrpar#1#2#3% test
- {\ifundefined{\@@XMLvariable:#1:#2}%
+\def\XMLstrpar#1#2#3% test
+ {\ifcsname\@@XMLvariable:#1:#2\endcsname
+ \scantokens\@EAEAEA{\@EA\begingroup\@EA\enableXML
+ \csname\@@XMLvariable:#1:#2\endcsname}%
+ \else
\scantokens{\begingroup\enableXML#3}%
+ \fi}
+
+\def\doifXMLvarelse#1#2% geen etex, \relax too
+ {\ifcsname\@@XMLvariable:#1:#2\endcsname
+%\expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\relax
+% \message{#1 #2 -> relax}\wait
+%\fi
+ \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty
+ \@EAEAEA\secondoftwoarguments
+ \else
+ \@EAEAEA\firstoftwoarguments
+ \fi
\else
- \scantokens\@EA\@EA\@EA{\@EA\begingroup\@EA\enableXML
- \csname\@@XMLvariable:#1:#2\endcsname}%
+ \@EA\secondoftwoarguments
\fi}
-\def\doifXMLvarelse#1#2#3#4% geen etex, \relax too
- {\expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\relax#4\else
- \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty#4\else#3\fi\fi}
+\def\doifXMLvar#1#2% geen etex, \relax too
+ {\ifcsname\@@XMLvariable:#1:#2\endcsname
+ \expandafter\ifx\csname\@@XMLvariable:#1:#2\endcsname\empty
+ \@EAEAEA\gobbleoneargument
+ \else
+ \@EAEAEA\firstofoneargument
+ \fi
+ \else
+ \@EA\gobbleoneargument
+ \fi}
-\def\doifXMLvalelse#1#2#3#4% geen etex, \relax too
- {\expandafter\ifx\csname\@@XMLvalue:#1:#2\endcsname\relax#4\else
- \expandafter\ifx\csname\@@XMLvalue:#1:#2\endcsname\empty#4\else#3\fi\fi}
+\def\doifXMLvalelse#1#2% geen etex, \relax too
+ {\ifcsname\@@XMLvalue:#1:#2\endcsname
+ \expandafter\ifx\csname\@@XMLvalue:#1:#2\endcsname\empty
+ \@EAEAEA\secondoftwoarguments
+ \else
+ \@EAEAEA\firstoftwoarguments
+ \fi
+ \else
+ \@EA\secondoftwoarguments
+ \fi}
\let\doifXMLparelse\doifXMLvarelse
+\let\doifXMLpar \doifXMLvar
+
+\bgroup \catcode`<=\@@active
-\def\dogotoXML%
- {\ifx\nexttoken<%
- \expandafter\nexttoken
- \else
- \expandafter\gotoXML
- \fi}
+\long\gdef\ignoreuntilXMLelement#1<{<}
+\long\gdef\grabuntilXMLelement #1<\to#2{\def#2{#1}<}
-\def\gotoXML%
- {\afterassignment\dogotoXML\let\nexttoken=}
+\egroup
-%D Saves tokens and typing.
+%D Saves tokens and typing.
-\def\XMLownvar {\XMLvar \currentXMLelement}
-\def\XMLownval {\XMLval \currentXMLelement}
-\def\XMLownpar {\XMLpar \currentXMLelement}
-\def\XMLownstrpar {\XMLstrpar \currentXMLelement}
-\def\doifXMLownvarelse{\doifXMLvarelse\currentXMLelement}
-\def\doifXMLownvalelse{\doifXMLvalelse\currentXMLelement}
-\def\doifXMLownparelse{\doifXMLparelse\currentXMLelement}
+\def\XMLownvar {\XMLvar {\rawXMLnamespace\rawXMLidentifier}}
+\def\XMLownval {\XMLval {\rawXMLnamespace\rawXMLidentifier}}
+\def\XMLownpar {\XMLpar {\rawXMLnamespace\rawXMLidentifier}}
+\def\XMLownstrpar {\XMLstrpar {\rawXMLnamespace\rawXMLidentifier}}
+\def\doifXMLownvarelse{\doifXMLvarelse{\rawXMLnamespace\rawXMLidentifier}}
+\def\doifXMLownvalelse{\doifXMLvalelse{\rawXMLnamespace\rawXMLidentifier}}
+\def\doifXMLownparelse{\doifXMLparelse{\rawXMLnamespace\rawXMLidentifier}}
+
+\def\ownXMLelement{\rawXMLnamespace\rawXMLidentifier}
-%D
+\def\XMLop#1% ownpar
+ {\csname\@@XMLvariable:\ownXMLelement:#1\endcsname}
+
+\def\XMLtp#1% texpar
+ {\csname\@@XMLmapmap\interfaced{#1}\endcsname}
+
+\def\doifelseXMLop#1{\doifelse{\XMLop{#1}}}
+\def\doifXMLop #1{\doif {\XMLop{#1}}}
+\def\doifnotXMLop #1{\doifnot {\XMLop{#1}}}
+
+\def\doifelsenothingXMLop#1{\doifelsenothing{\XMLop{#1}}}
+\def\doifsomethingXMLop #1{\doifsomething {\XMLop{#1}}}
+\def\doifnothingXMLop #1{\doifnothing {\XMLop{#1}}}
-\long\def\startXMLcode[#1] #2 \stopXMLcode
- {\setgvalue{\@@XMLcode:#1}{\startXMLdata#2\stopXMLdata}}
+\def\doifelseXMLtp#1{\doifelse{\XMLtp{#1}}}
+\def\doifXMLtp #1{\doif {\XMLtp{#1}}}
+\def\doifnotXMLtp #1{\doifnot {\XMLtp{#1}}}
+
+\def\doifelsenothingXMLtp#1{\doifelsenothing{\XMLtp{#1}}}
+\def\doifsomethingXMLtp #1{\doifsomething {\XMLtp{#1}}}
+\def\doifnothingXMLtp #1{\doifnothing {\XMLtp{#1}}}
+
+\def\XMLflushself{\csname\@@XMLdata:\ownXMLelement\endcsname}
+
+\def\XMLta {\theXMLarguments\@@XMLmapmap}
+\def\getXMLta {\expanded{\getparameters[\@@XMLmapmap][\XMLta]}}
+\def\expandXMLta{\expandXMLarguments\@@XMLmapmap}
+\def\expandXMLtp{\expandTEXpar\@@XMLmapmap} % #1
+
+\def\defXMLop#1#2{\@EA\let\@EA#1\csname\@@XMLvariable:\ownXMLelement:#2\endcsname}
+\def\defXMLtp#1#2{\@EA\let\@EA#1\csname\@@XMLmapmap\interfaced{#2}\endcsname}
+
+%D ...
+
+\def\protectXMLdata
+ {\catcode`\^^I\@@space
+ \catcode`\^^M\@@space
+ \catcode`\^^L\@@space
+ \catcode`\#\@@other}
+
+\long\def\startXMLcode
+ {\begingroup
+ \protectXMLdata
+ \dostartXMLcode}
+
+\long\def\dostartXMLcode[#1] #2 \stopXMLcode
+ {\@EA\gdef\csname\@@XMLcode:#1\endcsname{\startXMLdata#2\stopXMLdata}%
+ \endgroup}
\def\getXMLcode[#1]% \expandXMLcode
- {\getvalue{\@@XMLcode:#1}}
+ {\csname\@@XMLcode:#1\endcsname}
% \long\def\startXMLdata#1\stopXMLdata%
% {\begingroup\enableXML\scantokens{#1}\endgroup}
%
-% \defineXMLentity[tex-backslash] {\catchXMLpar}
+% \defineXMLentity[tex-backslash] {\catchXMLpar}
%
% \def\catchXMLpar#1#2#3
% {\if#1p\if#2a\if#3r\ifmmode\else\endgraf\fi
@@ -912,25 +1762,38 @@
\long\def\startXMLdata
{\begingroup
- \catcode`\^^I=\@@space
- \catcode`\^^M=\@@space
- \catcode`\^^L=\@@space
+ \protectXMLdata
\dostartXMLdata}
-
-% \long\def\dostartXMLdata#1\stopXMLdata
-% {\enableXML\scantokens{#1}\endgroup}
\long\def\dostartXMLdata#1\stopXMLdata
- {\enableXML\scantokens{#1}\ifhmode\unskip\unskip\fi\endgroup}
+ {\enableXML\scantokens{#1}%
+ \endgroup
+ \ifhmode\unskip\unskip\fi}
+
+% suboptimal:
+%
+% \unexpanded\def\XMLdata#1% % \unexpanded added 22/5/2001
+% {\begingroup
+% \enableXML\scantokens{#1}\ifhmode\unskip\unskip\fi
+% \endgroup}
+%
+% better but does not work in tables:
+%
+% \unexpanded\def\XMLdata#1% % grouping changed 20/5/2001
+% {\scantokens{\begingroup\enableXML#1\gobblespacetokens}}
+%
+% currently:
-\unexpanded\def\XMLdata#1% % \unexpanded added 22/5/2001
+\unexpanded\def\XMLdata % # safe
{\begingroup
- \enableXML\scantokens{#1}\ifhmode\unskip\unskip\fi
- \endgroup}
+ \protectXMLdata
+ \doXMLdata}
+
+\def\doXMLdata#1%
+ {\enableXML
+ \scantokens{#1}%
+ \endgroup}
-\unexpanded\def\XMLdata#1% % grouping changed 20/5/2001
- {\scantokens{\begingroup\enableXML#1}}
-
%D
\def\bXMLs{\ifignoreXMLspaces\ignorespaces\fi}
@@ -969,17 +1832,6 @@
\def\processXMLfile #1{\enableXML\processfile{#1}}
\def\processXMLfilegrouped#1{{\enableXML\processfile{#1}\relax\ifmmode\else\par\fi}}
-% partially defined here
-
-\fetchruntimecommand\showXMLfile {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLbuffer{\f!xtagprefix\s!run}
-
-\fetchruntimecommand\showXMLtxt {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLpar {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLlin {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLwrd {\f!xtagprefix\s!run}
-\fetchruntimecommand\showXMLemp {\f!xtagprefix\s!run}
-
%D \type
%D {processXMLbuffer}
%D
@@ -1003,6 +1855,8 @@
%D Loading specific modules takes place with \type
%D {\useXMLfilters}.
+% todo: flag
+
\def\useXMLfilter[#1]%
{\processcommalist[#1]\douseXMLfilter}
@@ -1018,141 +1872,112 @@
%D Temporarily here.
\newtoks\groupedtoks
+\newif\ifcollectXMLgrouped
-\bgroup
-
-\catcode`\<=\@@active
-
-\long\unexpanded\gdef\getXMLgrouped#1#2#3%
- {\groupedtoks\emptytoks
- \convertargument<#1>\to\xxascii
- \convertargument<#1 \to\yyascii
- \newcounter\groupedlevel
- \long\def\dogetgrouped##1#1>%
- {\appendtoks##1\to\groupedtoks
- \convertargument##1\to\ascii
- \doloop
- {\@EA\@EA\@EA\aftersplitstring\@EA\ascii\@EA\at\xxascii\to\ascii
- \ifx\ascii\empty
- \exitloop
- \else
- \increment\groupedlevel
- \fi}%
- \convertargument##1\to\ascii
- \doloop
- {\@EA\@EA\@EA\aftersplitstring\@EA\ascii\@EA\at\yyascii\to\ascii
- \ifx\ascii\empty
- \exitloop
- \else
- \increment\groupedlevel
- \fi}%
- \ifnum\groupedlevel>0
- \decrement\groupedlevel
- \appendtoks#1>\to\groupedtoks
- \else
- \edef\dogetgrouped{\noexpand#2\the\groupedtoks\noexpand#3}%
- \fi
- \dogetgrouped}%
- \dogetgrouped}
-
-%D Cleaner but hardly faster unless big strings are passed.
-
-\long\gdef\docountXMLgrouped#1\end#2\end
- {\long\def\dosplitstring##1#2##2@@##3\end%
- {\def\ascii{##2}%
- \ifx\ascii\empty \else
- \advance\scratchcounter 1
- \dosplitstring##2@@#2@@\end
- \fi}%
- \dosplitstring#1@@#2@@\end}
-
-\long\unexpanded\gdef\getXMLgrouped#1#2#3%
- {\groupedtoks\emptytoks
- \scratchcounter=0
- \long\def\dogetgrouped##1#1>%
- {\appendtoks##1\to\groupedtoks
- \docountXMLgrouped##1\end<#1>\end
- \docountXMLgrouped##1\end<#1 \end
- \ifcase\scratchcounter
- \def\dogetgrouped{\@EA#2\the\groupedtoks#3}%
- \else
- \advance\scratchcounter -1
- \appendtoks#1>\to\groupedtoks
- \fi
- \dogetgrouped}%
- \dogetgrouped}
+\bgroup \catcode`\<=\@@active
-%D More versatile.
+\newtoks\XMLgtoks
\long\unexpanded\gdef\getXMLgroupedenvironment#1#2#3%
- {\def\dodogetgrouped{\@EA#2\the\groupedtoks#3}%
+ {\collectXMLgroupedtrue
+ \XMLgtoks{#2}%
+ \long\def\dodogetgrouped{\@EA\the\@EA\XMLgtoks\the\groupedtoks#3}%
\getXMLgrouped{#1}}
\long\unexpanded\gdef\getXMLgroupedargument#1#2%
- {\def\dodogetgrouped{\@EA#2\@EA{\the\groupedtoks}}%
+ {\collectXMLgroupedtrue
+ \XMLgtoks{#2}%
+ \long\def\dodogetgrouped{\@EA\the\@EA\XMLgtoks\@EA{\the\groupedtoks}}%
+ \getXMLgrouped{#1}}
+
+\long\unexpanded\gdef\getXMLgroupedignore#1%
+ {\collectXMLgroupedfalse
+ \let\dodogetgrouped\relax
\getXMLgrouped{#1}}
-\long\unexpanded\gdef\getXMLgrouped#1%
+%\long\gdef\docountXMLgrouped#1\end#2\end % @@ => \relax\relax
+% {\long\def\dosplitstring##1#1##2@@##3\end%
+% {\def\ascii{##2}%
+% \ifx\ascii\empty \else
+% \advance\scratchcounter 1
+% \dosplitstring##2@@#1@@\end
+% \fi}%
+% \dosplitstring#2@@#1@@\end}
+
+\long\gdef\docountXMLgrouped#1\end#2\end % 1 relax is enough since it's
+ {\long\def\dosplitstring##1#1##2\relax\relax##3\end % another regime
+ {\def\ascii{##2}%
+ \ifx\ascii\empty \else
+ \advance\scratchcounter \plusone
+ \dosplitstring##2\relax\relax#1\relax\relax\end
+ \fi}%
+ \dosplitstring#2\relax\relax#1\relax\relax\end}
+
+\long\unexpanded\gdef\getXMLgrouped#1% #1 kan weg % klopt dit nu?
{\groupedtoks\emptytoks
\scratchcounter=0
- \long\def\dogetgrouped##1#1>%
- {\appendtoks##1\to\groupedtoks
- \docountXMLgrouped##1\end<#1>\end
- \docountXMLgrouped##1\end<#1 \end
+ \edef\theXMLnamespace
+ {\ifx\originalXMLnamespace\empty\else\originalXMLnamespace:\fi
+ \currentXMLidentifier}%
+ \expanded{\long\noexpand\def\noexpand\dogetgrouped####1\noexpand\currentXMLelement>}%
+ {\ifcollectXMLgrouped\appendtoks##1\to\groupedtoks\fi
+ \@EA\docountXMLgrouped\@EA<\theXMLnamespace>\end##1\end
+ \@EAEAEA\docountXMLgrouped\@EA\@EA\@EA<\@EA\theXMLnamespace\space \end##1\end
\ifcase\scratchcounter
\let\dogetgrouped\dodogetgrouped
\else
- \advance\scratchcounter -1
- \appendtoks#1>\to\groupedtoks
+ \advance\scratchcounter \minusone
+ \ifcollectXMLgrouped\@EA\appendtoks\@EA<\@EA/\currentXMLelement>\to\groupedtoks\fi
\fi
\dogetgrouped}%
\dogetgrouped}
\egroup
-% {pre}{pos}{before}{after}
-%
-%\unexpanded\def\getgrouped#1#2#3#4%
-% {\groupedtoks\emptytoks
-% \convertargument#1\to\xxascii
-% \newcounter\groupedlevel
-% \def\dogetgrouped##1#2%
-% {\appendtoks##1\to\groupedtoks
-% \convertargument##1\to\ascii
-% \doloop
-% {\@EA\@EA\@EA\aftersplitstring\@EA\ascii\@EA\at\xxascii\to\ascii
-% \ifx\ascii\empty
-% \exitloop
-% \else
-% \increment\groupedlevel
-% \fi}%
-% \ifnum\groupedlevel>0
-% \decrement\groupedlevel
-% \appendtoks#2\to\groupedtoks
-% \else
-% \edef\dogetgrouped{\noexpand#3\the\groupedtoks\noexpand#4}%
-% \fi
-% \dogetgrouped}%
-% \dogetgrouped}
-
% interesting and fully expandable
-\def\XMLifequalelse#1#2#3#4#5%
- {\ifundefined{\@@XMLvariable:#1:#2}%
- #5%
+\def\XMLifequalelse#1#2#3%
+ {\ifcsname\@@XMLvariable:#1:#2\endcsname
+ \@EAEAEA\@@ifequal\csname\@@XMLvariable:#1:#2\endcsname\relax\@@and#3\relax\@@then
\else
- \@EA\@EA\@EA\@@ifequal\csname\@@XMLvariable:#1:#2\endcsname
- \relax\@@and#3\relax\@@then#4\@@else#5\@@fi
+ \@EA\secondoftwoarguments
\fi}
-\def\expifequalelse#1#2#3#4%
- {\@@ifequal#1\relax\relax\@@and#2\relax\relax\@@then#3\@@else#4\@@fi}
+\def\XMLownifequalelse#1#2%
+ {\@EAEAEA\@@ifequal\csname\@@XMLvariable:\ownXMLelement:#1\endcsname\relax\@@and#2\relax\@@then}
+
+\def\XMLyes#1{\XMLownifequalelse{#1}{yes}{#1}{}}
-\def\@@ifequal#1#2\@@and#3#4\@@then#5\@@else#6\@@fi%
+\def\expifequalelse#1#2%
+ {\@@ifequal#1\relax\relax\@@and#2\relax\relax\@@then}
+
+\def\@@ifequal#1#2\@@and#3%
{\ifx#1\relax
- \ifx#3\relax#5\else#6\fi
+ \ifx#3\relax
+ \@EAEAEA\@@if@@equal@@true
+ \else
+ \@EAEAEA\@@if@@equal@@false
+ \fi
\else
- \ifx#3\relax#6\else\@@ifequal#2\@@and#4\@@then#5\@@else#6\@@fi\fi
- \fi}
+ \ifx#3\relax
+ \@EAEAEAEAEAEA\@@if@@equal@@false
+ \else\ifx#1#3%
+ % go on
+ \else
+ \@EAEAEAEAEAEA\@@if@@equal@@false
+ \fi\fi
+ \fi
+ \@@ifequal#2\@@and}
+\long\def\@@if@@equal@@true #1\@@then#2#3{#2}
+\long\def\@@if@@equal@@false#1\@@then#2#3{#3}
+
+%D new stuff :
+
+\def\partialexpanded#1%
+ {\let\notexpanded\noexpand
+ \edef\@@expanded{\noexpand#1}%
+ \let\notexpanded\empty
+ \@@expanded}
+
\protect \endinput
diff --git a/tex/context/base/xtag-map.tex b/tex/context/base/xtag-map.tex
index 32648acd7..8eda9b74b 100644
--- a/tex/context/base/xtag-map.tex
+++ b/tex/context/base/xtag-map.tex
@@ -11,107 +11,167 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-%D There is a more versatile mapper available in \type {xtag-rem.tex}!
+%D There is a more versatile mapper available in \type {xtag-rem.tex}!
-\beginTEX
- \endinput
-\endTEX
+%D We also need something that lets content as-is, like for
+%D instance XML embedded in a chemical caption.
-\writestatus{loading}{Context XML Macros (remap)}
+\beginTEX
+ \endinput
+\endTEX
+
+\writestatus{loading}{Context XML Macros (remapping)}
%D A fundamental characteristic of \TEX\ is that much
%D processing depends on picking up one or more arguments and
%D acting upon them. In \type {xtag-ini} we have implemented
%D the normal (high) level interface between \XML\ and
%D \CONTEXT, and there we already saw some ways to pick up an
-%D element as argument.
-%D
-%D In this module we will implement a preprocessor. An element
-%D that feeds its content to the preprocessor, becomes a token
+%D element as argument.
+%D
+%D In this module we will implement a preprocessor. An element
+%D that feeds its content to the preprocessor, becomes a token
%D list consisting of \TEX\ macros, which in turn may expand to
-%D their meanings.
-%D
+%D their meanings.
+%D
%D This module is only tested with \ETEX. In principle we can
%D make it work with good old \TEX, but we see no objection
%D against using \ETEX, especially since it's part of every
-%D grown up \TEX\ distribution.
+%D grown up \TEX\ distribution.
-\unprotect
+\unprotect
+\let\normalparseXMLescape \parseXMLescape
+\let\normalparseXMLelement\parseXMLelement
+\let\normalparseXMLprocess\parseXMLprocess
+
+\let\normaldoXMLelement \doXMLelement
+\let\normaldoXMLentity \doXMLentity
+
+\def\setnormalXMLhandler
+ {\let\doXMLelement \normaldoXMLelement
+ \let\parseXMLelement\normalparseXMLelement
+ \let\parseXMLescape \normalparseXMLescape
+ \let\parseXMLprocess\normalparseXMLprocess
+ \let\doXMLentity \normaldoXMLentity}
+
%D A careful reader will notice that we do a full expansion of
%D the content of the element, although commands that are
%D protected will stay untouched. In this stage we also
%D collect key|/|value pairs and pass them onto the \TEX\
%D macros if needed. Again, we need a fully expandable parser
%D to handle this, which make the core macros slightly
-%D unreadable.
-%D
+%D unreadable.
+%D
%D The interface presented here evolved from an older module,
%D written on top of \type {m-sgml}, that could take care of
%D \MATHML\ (version 1). The implementation here is more
-%D advanced in the sense that it permits all kind of parsers.
+%D advanced in the sense that it permits all kind of parsers.
-\def\findendofXMLelement#1% better use a few expandafters
- {\if#1>0 \else % space prevents auto \relax
+\def\findendofXMLelement#1% space after 0/1 prevents auto \relax
+ {\if#1>0 \else
+ \if#1/1 \endofXMLelementE\else
\if#1"\endofXMLelementD \else
\if#1'\endofXMLelementS \else
- \if#1/1 \endofXMLelement \else
\endofXMLelementN \fi\fi\fi\fi}
-\def\endofXMLelementD#1\fi\fi\fi\fi#2"{\fi\fi \findendofXMLelement}
-\def\endofXMLelementS#1\fi\fi\fi\fi#2'{\fi\fi\fi \findendofXMLelement}
-\def\endofXMLelementN#1\fi\fi\fi\fi {\fi\fi\fi\fi\findendofXMLelement}
-\def\endofXMLelement #1\fi\fi\fi\fi#2>{\fi\fi\fi\fi}
+\def\endofXMLelementE#1\fi\fi\fi\fi#2>{\fi\fi}
+\def\endofXMLelementD#1\fi\fi\fi\fi#2"{\fi\fi\fi \findendofXMLelement}
+\def\endofXMLelementS#1\fi\fi\fi\fi#2'{\fi\fi\fi\fi\findendofXMLelement}
+\def\endofXMLelementN \fi\fi\fi\fi {\fi\fi\fi\fi\findendofXMLelement}
+
+% not faster
+%
+% \def\findendofXMLelement#1%
+% {\csname**\if#1>>\else\if#1//\else\if#1""\else\if#1''\else.\fi\fi\fi\fi\endcsname}
+%
+% \def\findendofXMLelement#1%
+% {\csname**\ifcsname**#1\endcsname#1\else.\fi\endcsname}
+%
+% \setvalue{**>}{0 }
+% \setvalue{**/}#1>{1 }
+% \setvalue{**"}#1"{\findendofXMLelement}
+% \setvalue{**'}#1'{\findendofXMLelement}
+% \letvalue{**.}\findendofXMLelement
-\newif\ifremapXMLunknown
+\newif\ifremapXMLunknown
-\def\doremapXMLelement#1#2#3#4%
- {\expandafter\ifx\csname\@@XML#1:#2\endcsname\relax#4\else
- \csname\@@XML#1:#2\endcsname#3%
- \fi}
+%D We need three steps to avoid namespace: tag since comment
+%D and processing instructions don't have a namespace. The
+%D first step distinguishes between comment, processing
+%D instructions and elements. The second step (which is
+%D defined in the main mapping macro) either or not grabs the
+%D namespace. We may extend this model later to a more
+%D versatile one, using remapping.
+
+%D Parsing escapes is done by specific macros. For the
+%D moment we assume that the sequence ends with an \type {>}
+%D (which is definietly not the case for \type {CDATA}).
+
+\long\def\remapXMLescape#1#2>{}
+
+%D Processing instructions are remapped and only certain
+%D cases are handled.
+
+\long\def\remapXMLprocess#1#2{\xmlp{procins/}{X}{#1}{#2}}
+
+%D This one is more efficient (although no one will notice
+%D this since this macro is used seldom).
-\long\def\remapXMLelement#1#2 #3>% todo: we need to get rid of the end /
- {\if#1!%
- % ignore all comment
- \else\if#1?%
- % ignore all instructions
- \remapXMLpi#2 #3>%
- \else\ifcase\findendofXMLelement#2#3>%
+\long\def\remapXMLprocess{\xmlp{procins/}{X}}
+
+%D Element need a bit more work; \type {#4} consumes spaces.
+
+\def\remapXMLunknownONE#1#2% name args
+ {\ifremapXMLunknown\remapXMLone{\s!unknown}{#1 #2}\fi}
+
+\def\remapXMLunknownTWO#1#2% name args
+ {\ifremapXMLunknown\remapXMLtwo{\s!unknown}{#1 #2}\fi}
+
+\def\remapXMLunknownTHREE#1#2% name args
+ {\ifremapXMLunknown\remapXMLthree{\s!unknown/}{#1 #2}\fi}
+
+\long\def\remapXMLelement#1#2 #3>#4% todo: we need to get rid of the end /
+ {\ifcase\findendofXMLelement#2#3>%
\if#1/%
- \expandafter\ifx\csname\@@XML#2:M\endcsname\relax
- \ifremapXMLunknown\remapXMLone{\s!unknown}{#2}\fi
+ \expandafter\ifx\csname\@@XML\@@XMLmapping:#2:M\endcsname\relax
+ \remapXMLunknownONE{#2}{}%
\else
\remapXMLone{#2}{}%
\fi
\else
- \expandafter\ifx\csname\@@XML#1#2:M\endcsname\relax
- \ifremapXMLunknown\remapXMLtwo{\s!unknown}{#1#2}\fi
+ \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax
+ \remapXMLunknownTWO{#1#2}{#3}%
\else
\remapXMLtwo{#1#2}{#3}%
\fi
\fi
\else
- \expandafter\ifx\csname\@@XML#1#2:M\endcsname\relax
- \expandafter\ifx\csname\@@XML#1#2/:M\endcsname\relax
- \ifremapXMLunknown\remapXMLthree{\s!unknown/}{#1#2}\fi
+ \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2:M\endcsname\relax
+ \expandafter\ifx\csname\@@XML\@@XMLmapping:#1#2/:M\endcsname\relax
+ \remapXMLunknownTHREE{#1#2}{#3}%
\else
\remapXMLthree{#1#2/}{#3}%
\fi
\else
\remapXMLthree{#1#2}{#3}%
\fi
- \fi\fi\fi}
+ \fi#4}
+
+\unexpanded\def\xmlr#1#2{\csname\@@XML\@@XMLmapping:#1:#2\endcsname}
+\unexpanded\def\xmlp#1#2{\csname\@@XML :#1:#2\endcsname}
+\def \expandedxmlr#1#2{\csname\@@XML\@@XMLmapping:#1:#2\endcsname}
-\unexpanded\def\xmlr#1#2{\csname\@@XML#1:#2\endcsname}
+\def\expandXMLremapping{\let\xmlr\expandedxmlr}
\def\@@XMLremap{XMLremap}
\def\remapXMLone#1#2%
- {\ifcase\csname\@@XMLremap\csname\@@XML#1:M\endcsname\endcsname
+ {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname
\or % GCPA
\XMLeg\XMLeg
\or % GCP-
- \XMLeg
+ \XMLeg
\or % GC-A
\XMLeg\XMLeg
\or % GC--
@@ -119,11 +179,11 @@
\or % -CPA
\XMLeg
\or % -CP-
- %
+ %
\or % -C-A
\XMLeg
\or % -C--
- %
+ %
\or % G---
\XMLeg
\or % GLR-
@@ -133,11 +193,11 @@
\fi}
\def\remapXMLtwo#1#2%
- {\ifcase\csname\@@XMLremap\csname\@@XML#1:M\endcsname\endcsname
+ {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname
\or % GCPA
\XMLbg\xmlr{#1}{X}{#2}\XMLbg
\or % GCP-
- \XMLbg\xmlr{#1}{X}{#2}%
+ \XMLbg\xmlr{#1}{X}{#2}%
\or % GC-A
\XMLbg\xmlr{#1}{X}\XMLbg
\or % GC--
@@ -145,21 +205,21 @@
\or % -CPA
\xmlr{#1}{X}{#2}\XMLbg
\or % -CP-
- \xmlr{#1}{X}{#2}%
+ \xmlr{#1}{X}{#2}%
\or % -C-A
\xmlr{#1}{X}\XMLbg
\or % -C--
- \xmlr{#1}{X}%
+ \xmlr{#1}{X}%
\or % G---
\XMLbg
\or % GLR-
\XMLbg\xmlr{#1}{L}%
\or % -LR-
- \xmlr{#1}{L}%
+ \xmlr{#1}{L}%
\fi}
\def\remapXMLthree#1#2%
- {\ifcase\csname\@@XMLremap\csname\@@XML#1:M\endcsname\endcsname
+ {\ifcase\csname\@@XMLremap\csname\@@XML\@@XMLmapping:#1:M\endcsname\endcsname
\or % GCPA
\XMLbg\xmlr{#1}{X}{#2}\XMLbg\XMLeg\XMLeg
\or % GCP-
@@ -169,9 +229,9 @@
\or % GC--
\XMLbg\xmlr{#1}{X}\XMLeg
\or % -CPA
- \xmlr{#1}{X}{#2}\XMLbg\XMLeg
+ \xmlr{#1}{X}{#2}\XMLbg\XMLeg
\or % -CP-
- \xmlr{#1}{X}{#2}%
+ \xmlr{#1}{X}{#2}%
\or % -C-A
\xmlr{#1}{X}\XMLbg\XMLeg
\or % -C--
@@ -180,112 +240,116 @@
\XMLbg\XMLeg
\fi}
-\@EA\scratchtoks\@EA{\string{} \edef\XMLbg{\the\scratchtoks}
-\@EA\scratchtoks\@EA{\string}} \edef\XMLeg{\the\scratchtoks}
+\scratchtoks\@EA{\string{} \edef\XMLbg{\the\scratchtoks}
+\scratchtoks\@EA{\string}} \edef\XMLeg{\the\scratchtoks}
-\chardef\XMLremapGCPA = 1 % {\command {arg} { } }
+\chardef\XMLremapGCPA = 1 % {\command {arg} { } }
\chardef\XMLremapGCP = 2 % {\command {arg} } %
-\chardef\XMLremapGCA = 3 % {\command { } }
+\chardef\XMLremapGCA = 3 % {\command { } }
\chardef\XMLremapGC = 4 % {\command } %
-\chardef\XMLremapCPA = 5 % \command {arg} { }
+\chardef\XMLremapCPA = 5 % \command {arg} { }
\chardef\XMLremapCP = 6 % \command {arg} %
-\chardef\XMLremapCA = 7 % \command { }
+\chardef\XMLremapCA = 7 % \command { }
\chardef\XMLremapC = 8 % \command %
\chardef\XMLremapG = 9 % { }
\chardef\XMLremapGLR = 10 % { \bcom \ecom }
\chardef\XMLremapLR = 11 % \bcom \ecom
-\protect
-
-\def\remapXMLpi#1 #2?#3>%
- {\xmlr{procins/}{X}{#1}{#2}}
-
-\unprotect
-
-%D The remapping is controlled by only a few definition
-%D macros, that both deal with elements. We distinguish
-%D between normal and empty elements.
-%D
+%D The remapping is controlled by only a few definition
+%D macros, that both deal with elements. We distinguish
+%D between normal and empty elements.
+%D
%D \starttypen
%D \remapXMLsequence [name] [result map] \unexpandablecommand
%D \remapXMLsequence [name] [result map] \unexpandablecommand
%D \stoptypen
-%D
-%D The \MATHML\ module demonstrates how these can be used.
+%D
+%D The \MATHML\ module demonstrates how these can be used.
%D The element is converted into a sequence with one or more
-%D of the following components.
+%D of the following components.
%D
%D \starttypen
-%D { \command {parameters} {argument} }
+%D { \command {parameters} {argument} }
%D \stoptypen
%D
-%D The following combinations are supported.
-%D
+%D The following combinations are supported.
+%D
%D \starttabulatie[|c|c|c|c|c|]
-%D \NC GCPA \NC grouped \NC command \NC parameters \NC argument \NC \NR
-%D \NC GCP \NC grouped \NC command \NC parameters \NC \NC \NR
-%D \NC GCA \NC grouped \NC command \NC \NC argument \NC \NR
-%D \NC GC \NC grouped \NC command \NC \NC \NC \NR
-%D \NC CPA \NC \NC command \NC parameters \NC argument \NC \NR
-%D \NC CP \NC \NC command \NC parameters \NC \NC \NR
-%D \NC CA \NC \NC command \NC \NC argument \NC \NR
-%D \NC C \NC \NC command \NC \NC \NC \NR
-%D \NC G \NC grouped \NC \NC \NC \NC \NR
-%D \stoptabulatie
+%D \NC GCPA \NC grouped \NC command \NC parameters \NC argument \NC \NR
+%D \NC GCP \NC grouped \NC command \NC parameters \NC \NC \NR
+%D \NC GCA \NC grouped \NC command \NC \NC argument \NC \NR
+%D \NC GC \NC grouped \NC command \NC \NC \NC \NR
+%D \NC CPA \NC \NC command \NC parameters \NC argument \NC \NR
+%D \NC CP \NC \NC command \NC parameters \NC \NC \NR
+%D \NC CA \NC \NC command \NC \NC argument \NC \NR
+%D \NC C \NC \NC command \NC \NC \NC \NR
+%D \NC G \NC grouped \NC \NC \NC \NC \NR
+%D \stoptabulatie
%D
-%D Empty elements (singular ones) never get an argument,
-%D which makes sense, since they have at most parameters.
+%D Empty elements (singular ones) never get an argument,
+%D which makes sense, since they have at most parameters.
-\def\remapXMLsequence{\dotripleargument\doremapXML []}
-\def\remapXMLsingular{\dotripleargument\doremapXML[/]}
+\def\remapXMLsequence{\doquadrupleargument\doremapXML []}
+\def\remapXMLsingular{\doquadrupleargument\doremapXML[/]}
-\def\doremapXML[#1][#2][#3]%
- {\doifinstringelse{LR}{#3}
- {\let\next\doremapXMLtwo}
- {\let\next\doremapXMLone}%
- \next[#1][#2][#3]}
+\def\doremapXML[#1][#2][#3][#4]%
+ {\iffourthargument
+ \def\next{\dodoremapXML[#2][#1][#3][#4]}%
+ \else
+ \def\next{\dodoremapXML[\@@XMLmapping][#1][#2][#3]}%
+ \fi
+ \next}
-\def\doremapXMLone[#1][#2][#3]#4%
- {\setvalue{\@@XML#2#1:M}{#3}%
- \setvalue{\@@XML#2#1:X}{#4}}
+%\def\dodoremapXML[#1][#2][#3][#4]% class / name pattern
+% {\doifinstringelse{LR}{#4}
+% {\let\next\doremapXMLtwo}
+% {\let\next\doremapXMLone}%
+% \next[#1][#2][#3][#4]}%
-\def\doremapXMLtwo[#1][#2][#3]#4#5%
- {\setvalue{\@@XML#2:M}{#3}%
- \setvalue{\@@XML#2:L}{#4}%
- \setvalue{\@@XML#2:R}{#5}}
+\def\dodoremapXML[#1][#2][#3][#4]% class / name pattern
+ {\doifinstringelse{LR}{#4}\doremapXMLtwo\doremapXMLone[#1][#2][#3][#4]}
-\let\dowithentity\empty
+\def\doremapXMLone[#1][#2][#3][#4]#5%
+ {\setvalue{\@@XML#1:#3#2:M}{#4}%
+ \setvalue{\@@XML#1:#3#2:X}{#5}}
-%D We handle unknown elements with:
+\def\doremapXMLtwo[#1][#2][#3][#4]#5#6%
+ {\setvalue{\@@XML#1:#3:M}{#4}%
+ \setvalue{\@@XML#1:#3:L}{#5}%
+ \setvalue{\@@XML#1:#3:R}{#6}}
-\remapXMLsingular[procins] [CPA] \doXMLprocins
+\let\dowithentity\empty
-\def\doXMLprocins#1#2{\dodoXMLprocessor{?#1}{#2}}
+%D We handle processing instructions and unknown elements with:
+\remapXMLsingular [procins] [CPA] \normalparseXMLprocess
\remapXMLsingular [\s!unknown] [CPA] \doXMLunknownSI
\remapXMLsequence [\s!unknown] [CPA] \doXMLunknownSE
-\def\doXMLunknownSI#1#2{\hbox{\tttf[#1]}}
-\def\doXMLunknownSE#1#2{\hbox{\tttf[#1:\enspace\ignorespaces#2\unskip]}}
+\def\doXMLunknownSI#1#2{{\tttf[#1 #2]}}
+\def\doXMLunknownSE#1#2{{\tttf[#1 #2]}}
%D In a similar way, we can remap entities.
-\def\remapXMLentity%
+\def\remapXMLentity#1;#2%
+ {\doremapXMLentity{#1}#2}%
+
+\def\doremapXMLentity%
{\xmlrent}
\unexpanded\def\xmlrent#1%
{\getXMLentity{#1}}
-%D The remapping is taken care of by the following macro,
-%D which takes three arguments.
+%D The remapping is taken care of by the following macro,
+%D which takes three arguments.
%D
-%D \starttypen
+%D \starttypen
%D \XMLremapdata{before}{after}{content}
-%D \stoptypen
+%D \stoptypen
%D
-%D After the remapping, the content is executed (expanded)
-%D under the normal \TEX\ catcode regime. The intermediate
-%D result can be traced by turning on the following switch.
+%D After the remapping, the content is executed (expanded)
+%D under the normal \TEX\ catcode regime. The intermediate
+%D result can be traced by turning on the following switch.
\newif\iftraceXMLremapping
@@ -296,10 +360,10 @@
\defineXMLentity[tex-bar]{\myspecialvert}%
\to \everyXMLremapping
-\def\setnormalXMLentities%
+\def\setnormalXMLentities% will change ! ! ! ! !
{\defineXMLentity[tex-hash]\letterhash
- \defineXMLentity[tex-dollar]\letterdollar
- \defineXMLentity[tex-percent]\letterpercent
+ \defineXMLentity[tex-dollar]\letterdollar
+ \defineXMLentity[tex-percent]\letterpercent
\defineXMLentity[tex-backslash]\letterbackslash
\defineXMLentity[tex-hat]\letterhat
\defineXMLentity[tex-underscore]\letterunderscore
@@ -309,12 +373,36 @@
\let\XMLremappedpar\empty
-\long\def\XMLremapdata#1#2#3%
+%D Here we implement the second step in the element grabber.
+
+\long\def\XMLremapdata%
+ {\dosingleempty\doXMLremapdata}
+
+\long\def\doXMLremapdata[#1]#2#3#4%
{\bgroup
- \pushmacro\doXMLelement
- \pushmacro\doXMLentity % ##2 removes leading spaces
- \long\def\doXMLelement##1>##2{\remapXMLelement##1 >##2}%
- \def\doXMLentity ##1;##2{\remapXMLentity{##1}##2}%
+ \startXMLmapping[#1]%
+ % enable unknown elements (should be macro)
+ \doifsomething{#1}
+ {\doifdefinedelse{\@@XML#1:\s!unknown:M}
+ {\remapXMLunknowntrue}{\remapXMLunknownfalse}}%
+ %
+ \pushmacro\doXMLentity % needed ?
+ % this will change, proper split in element itself
+ \ifx\currentXMLnamespace\empty
+ \let\parseXMLelement\remapXMLelement
+ \else
+ % here we need to get rid of the namespace; we also
+ % have to preserve the leaqding / if present
+ \@EA\long\@EA\def\@EA\parseXMLelement\@EA
+ ##\@EA1\currentXMLnamespace:{\remapXMLelement##1}%
+ % ##2 removes leading spaces
+ \fi
+ %
+ \let\parseXMLescape \remapXMLescape
+ \let\parseXMLprocess\remapXMLprocess
+ %
+ \let\doXMLentity \remapXMLentity
+ %
\enableXML % sets entities
\enableXMLexpansion
\let\par\XMLremappedpar
@@ -324,10 +412,9 @@
\catcode`\^^M=\@@space
\catcode`\^^L=\@@space
\catcode`\^^Z=\@@space
- \xdef\remappedXMLdata{#3\empty}%
+ \xdef\remappedXMLdata{#4\empty}%
\let\par\endgraf
- \popmacro\doXMLentity
- \popmacro\doXMLelement
+ \popmacro\doXMLentity % needed ?
\disableXMLexpansion
\catcode`\{=\@@begingroup
\catcode`\}=\@@endgroup
@@ -336,18 +423,19 @@
\bgroup
\convertcommand\remappedXMLdata\to\ascii
\tttf\veryraggedright\ascii\par
- \writestatus{XML}{\ascii}%
+ \writestatus{xml-remap}{\ascii}%
\egroup
\fi
- #1\scantokens\@EA{\remappedXMLdata\empty\empty}#2%
+ #2\scantokens\@EA{\remappedXMLdata\empty\empty}#3%
+ \stopXMLmapping
\egroup}
-% rename to better names
+% rename to better names
\newtoks \XMLRtoks
\newcount \nofXMLRchildren
-\def\naturalxmlr#1#2{\getvalue{\@@XML#1:#2}}
+\def\naturalxmlr#1#2{\getvalue{\@@XML\@@XMLmapping:#1:#2}}
\def\ignoreXMLRelement#1#2{}
\def\normalXMLRelement#1#2{#2}
@@ -363,8 +451,8 @@
% \def\nextXMLRelement{##1{##2}{##3}{##4}{##5}}%
% #1}%
% \doifnextcharelse\empty\empty\dowithnextXMLRelement}
-%
-% better and faster:
+%
+% better and faster:
\def\dowithnextXMLRelement#1#2#3#4#5#6%
{\def\nextXMLRelement{#2{#3}{#4}{#5}{#6}}#1}%
@@ -383,7 +471,7 @@
\popmacro\secondXMLRelement
\popmacro\firstXMLRelement}}}
-\def\withnextthreeXMLRelements#1% korter, met two
+\def\withnextthreeXMLRelements#1% korter, met two
{\pushmacro\firstXMLRelement
\pushmacro\secondXMLRelement
\pushmacro\thirdXMLRelement
@@ -467,7 +555,7 @@
{\let\nextXMLRelement\empty#2}%
\doifnextcharelse\xmlr\xdowithnextXMLRelement\xnowithnextXMLRelement}
-\def\encapsulatenextXMLRelements#1#2#3#4% oude bewaren
+\def\encapsulatenextXMLRelements#1#2#3#4% oude bewaren
{\pushmacro\betweenXMLRchild
\pushmacro\afterXMLRchild
\def\betweenXMLRchild{#1\def\betweenXMLRchild{#2}}%
@@ -482,7 +570,7 @@
\popmacro\betweenXMLRchild}%
#4}
-\def\collectXMLRchild#1#2%
+\def\collectXMLRchild#1#2%
{\XMLRtoks\emptytoks
\pushmacro\xmlr
\def\xmlr##1##2##3##4%
@@ -490,7 +578,7 @@
#2\empty
\popmacro\xmlr}
-\def\collectbetweenXMLRchild#1#2#3%
+\def\collectbetweenXMLRchild#1#2#3%
{\XMLRtoks\emptytoks
\pushmacro\xmlr
\pushmacro\betweenXMLRchild
@@ -502,7 +590,7 @@
\popmacro\betweenXMLRchild
\popmacro\xmlr}
-\def\dorawcollectbetweenXMLR#1#2%
+\def\dorawcollectbetweenXMLR#1#2%
{\pushmacro\xmlr
\pushmacro\betweenXMLRchild
\def\betweenXMLRchild{\def\betweenXMLRchild{#1}}%
@@ -512,16 +600,16 @@
\popmacro\betweenXMLRchild
\popmacro\xmlr}
-\def\rawcollectbetweenXMLR%
+\def\rawcollectbetweenXMLR%
{\XMLRtoks\emptytoks\dorawcollectbetweenXMLR}
-\def\docollectbetweenXMLR#1%
- {\dorawcollectbetweenXMLR{\appendtoks#1\to\XMLRtoks}}
+\def\docollectbetweenXMLR#1%
+ {\dorawcollectbetweenXMLR{\appendtoks#1\to\XMLRtoks}}
\def\collectbetweenXMLR%
{\XMLRtoks\emptytoks\docollectbetweenXMLR}
-\def\processXMLRchildren#1%
+\def\processXMLRchildren#1%
{\pushmacro\xmlr
\let\xmlr\naturalxmlr
#1\empty
@@ -544,7 +632,7 @@
#1\empty
\popmacro\xmlr}
-\def\countXMLRchild#1#2%
+\def\countXMLRchild#1#2%
{\pushmacro\xmlr
\nofXMLRchildren=0
\def\xmlr##1##2##3##4%
@@ -552,4 +640,27 @@
#2\empty
\popmacro\xmlr}
-\protect \endinput
+\def\installXMLunknownremapping
+ {\remapXMLsingular[\s!unknown][CPA]\doXMLunknownSI
+ \remapXMLsequence[\s!unknown][CPA]\doXMLunknownSE}
+
+\bgroup \catcode`<=\active
+
+\gdef\revertXMLremapping
+ {\gdef\doXMLunknownSE##1##2{<##1>##2##1>}%
+ \gdef\doXMLunknownSI##1##2{<##1>}}
+
+\gdef\unmapXMLdata#1#2% todo: singular, evt ##2 space ervoor en ##1##2
+ {\bgroup
+ \revertXMLremapping
+ \expandXMLremapping % now we can roll back
+ \setnormalXMLhandler % using the normal parser
+ \resetXMLmapping % and leaving the mapping namespace
+ \xdef\unmappedXMLdata{#2}% recreate the original
+ \enableXMLelements % enable normal handler
+ \unmappedXMLdata % off we go ...
+ \egroup}
+
+\egroup
+
+\protect \endinput
diff --git a/tex/context/base/xtag-meh.tex b/tex/context/base/xtag-meh.tex
index 95e244d35..1636f2a2b 100644
--- a/tex/context/base/xtag-meh.tex
+++ b/tex/context/base/xtag-meh.tex
@@ -14,7 +14,7 @@
\defineMMLentity andv E391 {unknown} and with middle stem
\defineMMLentity angrt 221F {unknown} right (90 degree) angle
\defineMMLentity angsph 2222 {unknown} angle-spherical
-\defineMMLentity angst 212B {\AA} Angstrom capital A, ring
+\defineMMLentity angst 212B {\Angstrom} Angstrom capital A, ring
\defineMMLentity ap 2248 {\approx} approximate
\defineMMLentity apacir E38C {unknown} approximate, circumflex accent
\defineMMLentity awconint 2233 {unknown} contour integral, anti-clockwise
diff --git a/tex/context/base/xtag-mmc.tex b/tex/context/base/xtag-mmc.tex
index 195ea4a72..f3c46a0c8 100644
--- a/tex/context/base/xtag-mmc.tex
+++ b/tex/context/base/xtag-mmc.tex
@@ -20,8 +20,12 @@
% approach, which we needed for proper nesting, but the
% code is still too ugly
+\startXMLmapping[mml]
+
\unprotect
+\def\MMLccomma{{,}}
+
\def\getmmlarguments#1#2#3#4#5#6% {class} {defaults} mmlargs
{\getXMLarguments{#1}{#2 #5}}%
@@ -47,7 +51,7 @@
{#1}}
\def\MMLcdopolara#1%
- {\def\MMLcsep{,}\getXMLentity{polar}\left(#1\right)}
+ {\def\MMLcsep{\MMLccomma}\getXMLentity{polar}\left(#1\right)}
\def\MMLcdopolarb#1%
{\def\MMLcsep##1\empty%
@@ -130,7 +134,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcCIdefault#1#2% #1=dummy
{#2\!% \getXMLentity{NegThinSpace}%
\doifnextcharelse\xmlr
- {\encapsulatenextXMLRelements{\left(}{,}{\right)}}
+ {\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}}
{}}
\def\MMLcCN#1% #2% can be sped up with \doifundefined ...
@@ -207,8 +211,9 @@ complex-cartesian=>\let\next\MMLccartesian,
in/,inverse/,%
fn,%
floor/,ceiling/,%
- mean/,
- abs/,int/,limit/,sum/,product/%
+ mean/,%
+ selector/,%
+ abs/,int/,limit/,sum/,product/,%
outerproduct/,innerproduct/,scalarproduct/}
\def\MMLcfunctionlist
@@ -219,17 +224,18 @@ complex-cartesian=>\let\next\MMLccartesian,
csc/,arccsc/,csch/,arccsch/,%
sec/,arcsec/,sech/,arcsech/,%
ln/,exp/,log/,%
- abs/,int/,limit/,sum/,product/%
+ abs/,int/,limit/,sum/,product/,%
fn} % ?
\def\MMLcconstructlist
- {diff/,partialdiff/,apply}
+ {diff/,partialdiff/,root/} % apply goes wrong on 1/2 * (a_2 + b_3)
% better: no () here but explicitly when needed, which is in
% less cases
\def\MMLcAPPLY#1#2%
- {\pushmacro\xmlr
+ {\mathinner{\begingroup % new, else 1/2(1+2) problem / inner: ask taco
+ \pushmacro\xmlr
\@EA\@EA\@EA\doifXMLRchild\@EA\@EA\@EA{\@EA\MMLcmainresetlist\@EA,\MMLctempresetlist}{#2}
{\MMLcreset}%
\ifcase\@MMLlevel
@@ -246,7 +252,8 @@ complex-cartesian=>\let\next\MMLccartesian,
\endgroup % ook level push
\advance\@MMLlevel-1
\doifXMLparelse{apply}{close}{\right\XMLpar{apply}{close}{}}{}%
- \popmacro\xmlr}
+ \popmacro\xmlr
+ \endgroup}}
\remapXMLsequence [reln] [CPA] \MMLcRELN
@@ -266,20 +273,32 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcFNdefault#1#2% neg space needed because of \left
{#2\!% \getXMLentity{NegThinSpace}%
- \MMLcreset\encapsulatenextXMLRelements{\left(}{,}{\right)}}
+ \MMLcreset\encapsulatenextXMLRelements{\left(}{\MMLccomma}{\right)}}
% special function handlers
\def\MMLcFNoperator
{\getvalue{doMMLcFN\mmloperator}}
+% \def\doMMLcFNplusminus#1#2#3\empty
+% {\countXMLRchildren{#3}%
+% \ifcase\nofXMLRchildren\or
+% #2#3%
+% \else % suboptimal for instance under root
+% \encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}%
+% \fi}
+
\def\doMMLcFNplusminus#1#2#3\empty
{\countXMLRchildren{#3}%
\ifcase\nofXMLRchildren\or
- #2#3%
- \else
- \encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}%
- \fi}
+ \def\next{#2#3}%
+ \else
+ \def\next
+ {\doifnextcharelse\xmlr
+ {\encapsulateXMLR{\left(}{#2}{\right)}{\MMLcreset#3}}%
+ {\encapsulateXMLR{}{#2}{}{\MMLcreset#3}}}%
+ \fi
+ \next}
\let\doMMLcFNminusplus\doMMLcFNplusminus
@@ -347,11 +366,11 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcLAMBDA#1#2%
{\doifelse{\@@MMLlambdavariant}{a}
- {\encapsulateXMLR{\getXMLentity{lambda}(}{,}{)}{#2}}
+ {\encapsulateXMLR{\getXMLentity{lambda}(}{\MMLccomma}{)}{#2}}
{\countXMLRchild{bvar}{#2}%
\ifnum\nofXMLRchildren>1
\collectXMLRchild{bvar}{#2}%
- \encapsulateXMLR{\left(}{,}{\right)}{\the\XMLRtoks}%
+ \encapsulateXMLR{\left(}{\MMLccomma}{\right)}{\the\XMLRtoks}%
\else
\processXMLRchild{bvar}{#2}%
\fi
@@ -422,13 +441,13 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcDIVIDE#1#2%
{\withnexttwoXMLRelements
- {\increment\MMLcDIVIDElevel
- \ifnum\MMLcDIVIDElevel>\@@MMLdivideniveau\space
- \firstXMLRelement/\secondXMLRelement
- \else
- \frac{\MMLcreset\firstXMLRelement}{\MMLcreset\secondXMLRelement}%
- \fi
- \decrement\MMLcDIVIDElevel}}
+ {\increment\MMLcDIVIDElevel
+ \ifnum\MMLcDIVIDElevel>\@@MMLdivideniveau\space
+ \firstXMLRelement/\secondXMLRelement
+ \else
+ \frac{\MMLcreset\firstXMLRelement}{\MMLcreset\secondXMLRelement}%
+ \fi
+ \decrement\MMLcDIVIDElevel}}
\remapXMLsingular [min] [CPA] \MMLcMIN
\remapXMLsingular [max] [CPA] \MMLcMAX
@@ -436,12 +455,12 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcMIN#1#2#3\empty
{\encapsulateXMLR
{\min\doifXMLRchild{bvar}{#3}{_{\processXMLRchild{bvar}{#3}}}\left\{}
- {,}{\right\}}{#3}}
+ {\MMLccomma}{\right\}}{#3}}
\def\MMLcMAX#1#2#3\empty
{\encapsulateXMLR
{\max\doifXMLRchild{bvar}{#3}{_{\processXMLRchild{bvar}{#3}}}\left\{}
- {,}{\right\}}{#3}}
+ {\MMLccomma}{\right\}}{#3}}
\remapXMLsingular [minus] [CPA] \MMLcMINUS
\remapXMLsingular [plus] [CPA] \MMLcPLUS
@@ -529,7 +548,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\remapXMLsingular [gcd] [CPA] \MMLcGCD
-\def\MMLcGCD#1#2#3\empty{\encapsulateXMLR{\gcd(}{,}{)}{#3}}
+\def\MMLcGCD#1#2#3\empty{\encapsulateXMLR{\gcd(}{\MMLccomma}{)}{#3}}
\remapXMLsingular [and] [CPA] \MMLcAND
\remapXMLsingular [or] [CPA] \MMLcOR
@@ -559,7 +578,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcFORALLandEXISTS#1#2#3\empty
{\MMLcreset
- _{\encapsulateXMLRchildren{bvar}{}{,}{}{#3}}%
+ _{\encapsulateXMLRchildren{bvar}{}{\MMLccomma}{}{#3}}%
\doifXMLRchildelse{condition}{#3}
{\;% \getXMLentity{ThickSpace}%
\processXMLRchild{condition}{#3}
@@ -608,7 +627,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\remapXMLsingular [lcm] [CPA] \MMLcLCM
\def\MMLcLCM#1#2#3\empty
- {\encapsulateXMLR{\getXMLentity{lcm}(}{,}{)}{#3}}
+ {\encapsulateXMLR{\getXMLentity{lcm}(}{\MMLccomma}{)}{#3}}
\remapXMLsingular [floor] [CPA] \MMLcFLOOR
\remapXMLsingular [ceiling] [CPA] \MMLcCEILING
@@ -762,7 +781,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcPARTIALDIFF#1#2#3\empty
{\pushmacro\xmlr
\doifXMLRchildelse{list}{#3}
- {\getXMLentity{capitaldifferentiald}_{\encapsulateXMLRchild{list}{}{,}{}{#3}}%
+ {\getXMLentity{capitaldifferentiald}_{\encapsulateXMLRchild{list}{}{\MMLccomma}{}{#3}}%
\processXMLRchild{apply,reln,ci,cn}{#3}}
{\countXMLRchild{bvar}{#3}%
\ifnum\nofXMLRchildren>0
@@ -829,11 +848,11 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcSET#1#2%
{\doifXMLRchildelse{condition}{#2}
{\{\processXMLRchild{bvar}{#2}\,\vert\,\processXMLRchild{condition}{#2}\}}
- {\encapsulateXMLR{\{}{,}{\}}{#2}}}
+ {\encapsulateXMLR{\{}{\MMLccomma}{\}}{#2}}}
\remapXMLsequence [list] [CPA] \MMLcLIST
-\def\MMLcLIST#1#2{\encapsulateXMLR{[} {,}{]} {#2}}
+\def\MMLcLIST#1#2{\encapsulateXMLR{[}{\MMLccomma}{]}{#2}}
\remapXMLsingular [union] [CPA] \MMLcUNION
\remapXMLsingular [intersect] [CPA] \MMLcINTERSECT
@@ -1072,7 +1091,7 @@ complex-cartesian=>\let\next\MMLccartesian,
{\countXMLRchildren{#2}%
\ifnum\nofXMLRchildren>1
\doifelse{\@@MMLvectorrichting}{\v!horizontaal}
- {\encapsulateXMLR{\left(}{,}{\right)}{#2}}
+ {\encapsulateXMLR{\left(}{\MMLccomma}{\right)}{#2}}
{\collectbetweenXMLR{\crcr}{#2}%
\MMLcreset\left(\matrix{\the\XMLRtoks}\right)}%
\else
@@ -1128,7 +1147,7 @@ complex-cartesian=>\let\next\MMLccartesian,
\popmacro\xmlr}
\def\doMMLcSELECTOR#1\empty
- {_{\encapsulateXMLR{}{,}{}{#1\empty}}}
+ {_{\MMLcreset\encapsulateXMLR{}{\MMLccomma}{}{#1\empty}}}
\remapXMLsingular [vectorproduct] [CPA] \MMLcVECTORPRODUCT
\remapXMLsingular [scalarproduct] [CPA] \MMLcSCALARPRODUCT
@@ -1152,11 +1171,11 @@ complex-cartesian=>\let\next\MMLccartesian,
\remapXMLsequence [annotation] [CPA] \MMLcANNOTATION
-\def\MMLcANNOTATION#1#2%
+\def\MMLcANNOTATION#1#2% we need a better unmapper
{\getXMLarguments{annotation}{encoding="" #1}%
\doif{\XMLpar{annotation}{encoding}{}}{TeX}%
{\begingroup
- \setnormalXMLentities
+ \setnormalXMLentities % better: \simplifyXMLentities ; test first
\let\xmlrent\expandedXMLentity
\edef\mmlascii{#2}%
\setnormalcatcodes
@@ -1220,4 +1239,6 @@ complex-cartesian=>\let\next\MMLccartesian,
\def\MMLcEULERGAMMA #1#2{\gamma}
\def\MMLcINFINITY #1#2{\infty}
+\stopXMLmapping
+
\protect \endinput
diff --git a/tex/context/base/xtag-mml.tex b/tex/context/base/xtag-mml.tex
index 27d4d10d0..e7d8e2eda 100644
--- a/tex/context/base/xtag-mml.tex
+++ b/tex/context/base/xtag-mml.tex
@@ -11,10 +11,28 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\ifx\remapXMLsequence\undefined \input xtag-map.tex \relax \fi % temp hack
-
\writestatus{loading}{Context XML Macros (math ml)}
+%\enablemathpunctuation
+
+% First some general formula element definitions.
+
+\defineXMLenvironment [formula] [label=,sublabel=]
+ {\dostartXMLformula\placeformula}
+ {\dostopXMLformula}
+
+\defineXMLenvironment [subformula] [label=,sublabel=]
+ {\dostartXMLformula\placesubformula}
+ {\dostopXMLformula}
+
+\def\dostartXMLformula#1%
+ {\doifelsenothingXMLop{label}
+ {\startformula}
+ {\expanded{#1[\XMLop{label}]{\XMLop{sublabel}}}\startformula}}
+
+\def\dostopXMLformula
+ {\stopformula}
+
% Since I only had the draft of mml 2 as example of
% rendering, there are probably a lot of omissions and
% misinterpretations. At least I learned some bits and
@@ -35,43 +53,17 @@
\unprotect
-\def\setupMMLappearance[#1]%
- {\dodoubleargument\getparameters[@@MML#1]}
-
-\defineXMLprocessor[context-mathml-directive]{\contextXMLmathml}
-
-\def\contextXMLmathml#1%
- {\docontextXMLmathml#1 dummy dummy dummy\end}
+\def\setupMMLappearance[#1]{\dodoubleargument\getparameters[@@MML#1]}
-\def\docontextXMLmathml#1 #2 #3 #4\end
- {\setupMMLappearance[#1][#2=#3]}
-
-% == \defineXMLdirective [mathml] \setupMMLappearance
+\defineXMLdirective [mathml] \setupMMLappearance
\defineXMLargument [math] \doXMLmath
\defineXMLargument [imath] \doXMLimath
\defineXMLargument [dmath] \doXMLdmath
\unexpanded\def\doXMLmath {\ifhmode\@EA\doXMLimath\else\@EA\doXMLdmath\fi}
-\unexpanded\def\doXMLimath{\XMLremapdata{$}{$}}
-\unexpanded\def\doXMLdmath{\XMLremapdata{\dostartformula{}}{\dostopformula}}
-
-\defineXMLenvironment [formula]
- {\dostartXMLformula{formula}\placeformula}
- {\dostopXMLformula}
-
-\defineXMLenvironment [subformula]
- {\dostartXMLformula{subformula}\placesubformula}
- {\dostopXMLformula}
-
-\def\dostartXMLformula#1#2%
- {\doifXMLparelse{#1}{label}
- {\expanded{#2[\XMLpar{#1}{label}{}]{\XMLpar{#1}{sublabel}{}}}%
- \startformula}
- {\startformula}}
-
-\def\dostopXMLformula%
- {\stopformula}
+\unexpanded\def\doXMLimath{\XMLremapdata[mml]{$}{$}}
+\unexpanded\def\doXMLdmath{\XMLremapdata[mml]{\dostartformula{}}{\dostopformula}}
\ifx\XMLRtoks\undefined \newtoks\XMLRtoks \fi
@@ -112,12 +104,16 @@
\gdef\xdefineMMLentity #1 #2 #3 #4
{\egroup\dodefineMMLentity{#1}{#2}{#3}{#4}}
+\global\let\dodefineMMLsynonym\gobblefourarguments
+
\gdef\defineMMLsynonym%
{\bgroup\obeylines\xdefineMMLsynonym}
\gdef\xdefineMMLsynonym #1 #2
{\egroup\dodefineMMLsynonym{#1}{#2}}
+\global\let\dodefineMMLsynonym\gobbletwoarguments
+
\egroup
% some more
@@ -387,6 +383,9 @@
\defineXMLentity [OverBar] {\normalorfiller\hrule\hrulefill}
\defineXMLentity [Hat] {\normalorfiller\empty\empty} % todo
+\defineXMLentity [downarrow] {\mathortext\downarrow\empty}
+\defineXMLentity [uparrow] {\mathortext\uparrow\empty}
+
\defineXMLentity [Tab] {\hskip4em}
\defineXMLentity [NewLine] {\mathortext\empty\crlf}
\defineXMLentity [IndentingNewLine] {\mathortext\empty\crlf}
@@ -464,6 +463,8 @@
\def\myspecialvert{\mathematics{\vert}} % temp hack, should stretch
+\defineXMLentity [,] {{,}}
+\defineXMLentity [.] {{.}}
\defineXMLentity [+] {+}
\defineXMLentity [-] {-}
\defineXMLentity [(] {(}
diff --git a/tex/context/base/xtag-mmp.tex b/tex/context/base/xtag-mmp.tex
index 1748e83e6..20cc1e677 100644
--- a/tex/context/base/xtag-mmp.tex
+++ b/tex/context/base/xtag-mmp.tex
@@ -15,6 +15,8 @@
\unprotect
+\startXMLmapping [mml]
+
\def\convertasciiafter#1#2%
{\convertargument#2\to\asciiafter
\@EA#1\@EA{\asciiafter}}
@@ -70,7 +72,7 @@
{}%
{\pushmacro\myspecialvert % hack
\def\myspecialvert{\;\vrule\;}%
- \grabMMLseparator{\XMLpar{mfenced}{separators}}%
+ \grabMMLseparator{\XMLpar{mfenced}{separators}{}}%
\popmacro\myspecialvert}
{}%
{#2\empty}}
@@ -102,9 +104,11 @@
\fi
\dograbMMLseparator}
-\def\grabMMLseparatorb#1%
+\def\grabMMLseparatorb#1% better use \checkMMLoperator
{\ifnum\MMLxxcounter=\MMLyycounter\space
- \def\lastMMLseparator{#1}%
+\doifXMLentityelse{#1}
+ {\def\lastMMLseparator{\xmlrent{#1}}}
+ {\def\lastMMLseparator{#1}}%
\fi
\dograbMMLseparator}
@@ -468,5 +472,7 @@
\fi
\doif{mprescripts/}{#1}{\donefalse}% weak, the / here
\ifdone \advance\scratchcounter 1 \fi}
-
+
+\stopXMLmapping
+
\protect \endinput
diff --git a/tex/context/base/xtag-pml.tex b/tex/context/base/xtag-pml.tex
new file mode 100644
index 000000000..7371ec165
--- /dev/null
+++ b/tex/context/base/xtag-pml.tex
@@ -0,0 +1,83 @@
+%D \module
+%D [ file=xtag-pml,
+%D version=2001.09.04,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=Physics ML,
+%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.
+
+\writestatus{loading}{Context XML Macros (phys ml)}
+
+%D This filter runs on top of the mathml and units modules.
+
+\useXMLfilter[mml,mmp,mmc,unt]
+
+\defineXMLargument [phys] \doXMLphys
+\defineXMLargument [iphys] \doXMLiphys
+\defineXMLargument [dphys] \doXMLdphys
+
+\unprotect
+
+\unexpanded\def\doXMLphys {\ifhmode\@EA\doXMLiphys\else\@EA\doXMLdphys\fi}
+\unexpanded\def\doXMLiphys{\XMLremapdata[mml]{$\ignorespaces}{\unskip$}}
+\unexpanded\def\doXMLdphys{\XMLremapdata[mml]{\dostartformula{}}{\dostopformula}}
+
+\protect
+
+\doifnotmode{demo}{\endinput}
+
+\usemodule[units]
+
+\starttext
+
+\startXMLdata
+
+
+ 10
+
+
+
+\stopXMLdata
+
+\startXMLdata
+
+
+ 10
+
+
+
+\stopXMLdata
+
+\startXMLdata
+
+
+ 10
+
+
+
+\stopXMLdata
+
+\startXMLdata
+
+
+ 10
+
+
+
+\stopXMLdata
+
+\startXMLdata
+
+
+ 10
+
+
+
+\stopXMLdata
+
+\stoptext
diff --git a/tex/context/base/xtag-pmu.tex b/tex/context/base/xtag-pmu.tex
new file mode 100644
index 000000000..425257b49
--- /dev/null
+++ b/tex/context/base/xtag-pmu.tex
@@ -0,0 +1,188 @@
+%D \module
+%D [ file=xtag-pmu,
+%D version=2001.06.10,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=Units,
+%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.
+
+\writestatus{loading}{Context XML Macros (units)}
+
+%D Quick and dirty in||line units:
+%D
+%D \startbuffer
+%D
+%D 10
+%D
+%D
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D A more \MATHML||like unit application:
+%D
+%D \startbuffer
+%D
+%D 10
+%D
+%D
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D A bit more compact:
+%D
+%D \startbuffer
+%D
+%D 10
+%D
+%D
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D A bit more complicated:
+%D
+%D \startbuffer
+%D
+%D a 10
+%D
+%D
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+%D
+%D An alternative (equivalent) for \type {}:
+%D
+%D \startbuffer
+%D
+%D 10
+%D
+%D \stopbuffer
+%D
+%D \typebuffer \processXMLbuffer
+
+\defineXMLsingular [unitmeaning] [label=] \doPMLunitmeaning
+
+\def\doPMLunitmeaning%
+ {\expanded{\unitmeaning{\XMLop{label}}}}
+
+\startXMLmapping [mml]
+
+\remapXMLsequence [unit] [CPA] \doPMLuseq
+\remapXMLsingular [unit] [CPA] \doPMLunit % #2\empty
+\remapXMLsequence [cunseq] [CPA] \doPMLuseq % #2
+\remapXMLsequence [cu] [CPA] \doPMLuseq % #2
+
+\newif\ifPMLunit \PMLunittrue
+
+\def\doPMLuseq#1#2{\PMLunittrue\ignorespaces#2\unskip\PMLunitfalse}
+\def\doPMLunit#1#2\empty{\ignorespaces#2\unskip}
+
+\def\handlePMLunit#1{\ifPMLunit\ignorespaces#1\fi\ignorespaces}
+
+%D All unit commands are remapped in a similar way.
+
+\remapXMLsingular [Atto] [C] {\handlePMLunit\Atto}
+\remapXMLsingular [Femto] [C] {\handlePMLunit\Femto}
+\remapXMLsingular [Pico] [C] {\handlePMLunit\Pico}
+\remapXMLsingular [Nano] [C] {\handlePMLunit\Nano}
+\remapXMLsingular [Micro] [C] {\handlePMLunit\Micro}
+\remapXMLsingular [Milli] [C] {\handlePMLunit\Milli}
+\remapXMLsingular [Centi] [C] {\handlePMLunit\Centi}
+\remapXMLsingular [Deci] [C] {\handlePMLunit\Deci}
+\remapXMLsingular [Hecto] [C] {\handlePMLunit\Hecto}
+\remapXMLsingular [Kilo] [C] {\handlePMLunit\Kilo}
+\remapXMLsingular [Mega] [C] {\handlePMLunit\Mega}
+\remapXMLsingular [Giga] [C] {\handlePMLunit\Giga}
+\remapXMLsingular [Terra] [C] {\handlePMLunit\Terra}
+\remapXMLsingular [Peta] [C] {\handlePMLunit\Peta}
+\remapXMLsingular [Exa] [C] {\handlePMLunit\Exa}
+
+\remapXMLsingular [Times] [C] {\handlePMLunit\Times}
+\remapXMLsingular [Solidus] [C] {\handlePMLunit\Solidus}
+\remapXMLsingular [Per] [C] {\handlePMLunit\Per}
+\remapXMLsingular [OutOf] [C] {\handlePMLunit\OutOf}
+
+\remapXMLsingular [Linear] [C] {\handlePMLunit\Linear}
+\remapXMLsingular [Square] [C] {\handlePMLunit\Square}
+\remapXMLsingular [Cubic] [C] {\handlePMLunit\Cubic}
+
+\remapXMLsingular [Inverse] [C] {\handlePMLunit\Inverse}
+
+\remapXMLsingular [Degrees] [C] {\handlePMLunit\Degrees}
+\remapXMLsingular [Meter] [C] {\handlePMLunit\Meter}
+\remapXMLsingular [Liter] [C] {\handlePMLunit\Liter}
+\remapXMLsingular [Sec] [C] {\handlePMLunit\Sec}
+\remapXMLsingular [Year] [C] {\handlePMLunit\Year}
+\remapXMLsingular [Month] [C] {\handlePMLunit\Month}
+\remapXMLsingular [Week] [C] {\handlePMLunit\Week}
+\remapXMLsingular [Day] [C] {\handlePMLunit\Day}
+\remapXMLsingular [Hour] [C] {\handlePMLunit\Hour}
+\remapXMLsingular [Min] [C] {\handlePMLunit\Min}
+\remapXMLsingular [Second] [C] {\handlePMLunit\Sec}
+\remapXMLsingular [Rad] [C] {\handlePMLunit\Rad}
+\remapXMLsingular [Deg] [C] {\handlePMLunit\Deg}
+\remapXMLsingular [Hertz] [C] {\handlePMLunit\Hertz}
+\remapXMLsingular [RevPerSec] [C] {\handlePMLunit\RevPerSec}
+\remapXMLsingular [RevPerMin] [C] {\handlePMLunit\RevPerMin}
+\remapXMLsingular [Gram] [C] {\handlePMLunit\Gram}
+\remapXMLsingular [Atom] [C] {\handlePMLunit\Atom}
+\remapXMLsingular [Newton] [C] {\handlePMLunit\Newton}
+\remapXMLsingular [Pascal] [C] {\handlePMLunit\Pascal}
+\remapXMLsingular [Joule] [C] {\handlePMLunit\Joule}
+\remapXMLsingular [Watt] [C] {\handlePMLunit\Watt}
+\remapXMLsingular [Celsius] [C] {\handlePMLunit\Celsius}
+\remapXMLsingular [Kelvin] [C] {\handlePMLunit\Kelvin}
+\remapXMLsingular [Fahrenheit] [C] {\handlePMLunit\Fahrenheit}
+\remapXMLsingular [Mol] [C] {\handlePMLunit\Mol}
+\remapXMLsingular [Molair] [C] {\handlePMLunit\Molair}
+\remapXMLsingular [Equivalent] [C] {\handlePMLunit\Equivalent}
+\remapXMLsingular [Farad] [C] {\handlePMLunit\Farad}
+\remapXMLsingular [Ohm] [C] {\handlePMLunit\Ohm}
+\remapXMLsingular [Siemens] [C] {\handlePMLunit\Siemens}
+\remapXMLsingular [Ampere] [C] {\handlePMLunit\Ampere}
+\remapXMLsingular [Coulomb] [C] {\handlePMLunit\Coulomb}
+\remapXMLsingular [Volt] [C] {\handlePMLunit\Volt}
+\remapXMLsingular [eVolt] [C] {\handlePMLunit\eVolt}
+\remapXMLsingular [Tesla] [C] {\handlePMLunit\Tesla}
+\remapXMLsingular [VoltAC] [C] {\handlePMLunit\VoltAC}
+\remapXMLsingular [VoltDC] [C] {\handlePMLunit\VoltDC}
+\remapXMLsingular [Baud] [C] {\handlePMLunit\Baud}
+\remapXMLsingular [Bit] [C] {\handlePMLunit\Bit}
+\remapXMLsingular [Byte] [C] {\handlePMLunit\Byte}
+\remapXMLsingular [Bequerel] [C] {\handlePMLunit\Bequerel}
+\remapXMLsingular [Sievert] [C] {\handlePMLunit\Sievert}
+\remapXMLsingular [Candela] [C] {\handlePMLunit\Candela}
+\remapXMLsingular [Bell] [C] {\handlePMLunit\Bell}
+\remapXMLsingular [At] [C] {\handlePMLunit\At}
+\remapXMLsingular [Atm] [C] {\handlePMLunit\Atm}
+\remapXMLsingular [Bar] [C] {\handlePMLunit\Bar}
+\remapXMLsingular [EVolt] [C] {\handlePMLunit\EVolt}
+\remapXMLsingular [Foot] [C] {\handlePMLunit\Foot}
+\remapXMLsingular [Inch] [C] {\handlePMLunit\Inch}
+\remapXMLsingular [Cal] [C] {\handlePMLunit\Cal}
+\remapXMLsingular [Force] [C] {\handlePMLunit\Force}
+\remapXMLsingular [Lux] [C] {\handlePMLunit\Lux}
+\remapXMLsingular [Gray] [C] {\handlePMLunit\Gray}
+\remapXMLsingular [Weber] [C] {\handlePMLunit\Weber}
+\remapXMLsingular [Henry] [C] {\handlePMLunit\Henry}
+\remapXMLsingular [Sterant] [C] {\handlePMLunit\Sterant}
+\remapXMLsingular [Angstrom] [C] {\handlePMLunit\Angstrom}
+\remapXMLsingular [Gauss] [C] {\handlePMLunit\Gauss}
+
+\remapXMLsingular [Percent] [C] {\handlePMLunit\Percent}
+\remapXMLsingular [Promille] [C] {\handlePMLunit\Promille}
+\remapXMLsingular [Permille] [C] {\handlePMLunit\Permille}
+
+\remapXMLsingular [Unit] [C] {\handlePMLunit\Unit}
+\remapXMLsingular [NoUnit] [C] {\handlePMLunit\NoUnit}
+
+\stopXMLmapping
+
+\endinput
diff --git a/tex/context/base/xtag-pre.tex b/tex/context/base/xtag-pre.tex
new file mode 100644
index 000000000..6ce33ab84
--- /dev/null
+++ b/tex/context/base/xtag-pre.tex
@@ -0,0 +1,325 @@
+%D \module
+%D [ file=xtag-pre,
+%D version=2000.12.20,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=Predefined Things
+%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.
+
+\beginTEX
+ \endinput
+\endTEX
+
+\writestatus{loading}{Context XML Macros (predefined)}
+
+%D Here we predefine some escapes, processing instructions,
+%D entities and other handy things.
+
+\unprotect
+
+%D First we define the default error handler. When tracing is
+%D activated, the unknown element is showed verbatim.
+
+\defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement
+\defineXMLsingular [\s!default] \defaultXMLelement
+
+\def\defaultXMLelement{\iftraceXMLelements[\currentXMLelement]\fi}
+
+%D The following entities need to be defined anyway. They
+%D may be overloaded later.
+
+\defineXMLentities [amp] {\string&} {\&}
+\defineXMLentities [gt] {\string>} {\mathematics{>}}
+\defineXMLentities [lt] {\string<} {\mathematics{<}}
+\defineXMLentities [quot] {\string"} {\mathematics{"}}
+\defineXMLentities [apos] {\string`} {\mathematics{'}}
+
+%D Of course we define:
+
+\defineXMLentities [tex] {tex} {\TeX}
+\defineXMLentities [context] {context} {\ConTeXt}
+\defineXMLentities [xml] {xml} {XML}
+\defineXMLentities [xsd] {xsd} {XSD}
+\defineXMLentities [html] {html} {HTML}
+
+%D The following entities are used for internal purposes and
+%D concern characters that are kind of problematic in \TEX\
+%D input.
+
+\defineXMLentities [tex-hash] {\letterhash} {\#}
+\defineXMLentities [tex-dollar] {\letterdollar} {\$}
+\defineXMLentities [tex-percent] {\letterpercent} {\%}
+\defineXMLentities [tex-backslash] {\letterbackslash} {\texescape}
+\defineXMLentities [tex-hat] {\letterhar} {\^{}}
+\defineXMLentities [tex-underscore] {\letterunderscore} {\_}
+\defineXMLentities [tex-leftbrace] {\letterleftbrace} {\leftargument}
+\defineXMLentities [tex-rightbrace] {\letterrightbrace} {\rightargument}
+\defineXMLentities [tex-bar] {\letterbar} {\vl}
+\defineXMLentities [tex-tilde] {\lettertilde} {\~{}}
+
+%D Some pretty printing macros will use color, for which we
+%D define a dedicated palet here.
+
+\definepalet
+ [xtag]
+ [0=darkgray, 1=darkred, 2=darkgreen,
+ 3=darkblue, 4=darkcyan, 5=darkmagenta,
+ 6=darkyellow, 7=black, 8=black]
+
+%D An example of its usage can be found in the pretty
+%D printing macros in the run time module.
+
+\newif\ifautoXMLshow \autoXMLshowtrue
+\newif\ifshowXMLarguments \showXMLargumentstrue
+
+\def\setupXMLfile{\dodoubleargument\getparameters[\??xf]}
+
+\setupXMLfile
+ [\c!tussen=\blanko,
+ \c!niveau=1]
+
+\fetchruntimecommand\showXMLfile {\f!xtagprefix\s!run}
+\fetchruntimecommand\showXMLbuffer{\f!xtagprefix\s!run}
+
+\fetchruntimecommand\showXMLign {\f!xtagprefix\s!run}
+\fetchruntimecommand\showXMLnop {\f!xtagprefix\s!run}
+\fetchruntimecommand\showXMLtxt {\f!xtagprefix\s!run}
+\fetchruntimecommand\showXMLpar {\f!xtagprefix\s!run}
+\fetchruntimecommand\showXMLlin {\f!xtagprefix\s!run}
+\fetchruntimecommand\showXMLwrd {\f!xtagprefix\s!run}
+\fetchruntimecommand\showXMLemp {\f!xtagprefix\s!run}
+
+%D By default, we will ignore escape commands, preceded by
+%D \type {}.
+
+\defineXMLescape [\s!default] {\gobbleuntil{>}}
+
+%D The comment escape has the form:
+%D
+%D \starttypen
+%D
+%D \stoptypen
+
+\defineXMLescape [--] {\gobbleuntil{-->}}
+
+%D The \type {CDATA} escape is kind of unique in its
+%D strange syntax.
+%D
+%D \starttypen
+%D
+%D \stoptypen
+%D
+%D Watch this rather obscure definition (we need to pass an
+%D \type {[} to the macro.
+
+\defineXMLescape [{CDATA[}]
+ {\skipfirstverbatimlinefalse
+ \processtaggeddisplayverbatim{]]>}}
+
+%D \starttypen
+%D
+%D
+%D
+%D \stoptypen
+
+\defineXMLescape [ENTITY] \handleXMLentityescape
+
+\def\handleXMLentityescape#1>%
+ {\dohandleXMLentityescape#1 @ @ @ @ @ @>}
+
+\def\dohandleXMLentityescape#1 #2 #3 #4>
+ {\doifnot{#1}{\letterpercent}
+ {\doifelse{#2}{SYSTEM}
+ {\dohandleXMLentitySYSTEM#1 #2 #3 #4>}
+ {\dohandleXMLentityDEFINE#1 #2 #3 #4>}}}
+
+\def\dohandleXMLentitySYSTEM#1 #2 #3 #4 #5 #6>% name SYSTEM ....
+ {\doifelse{#4}{@}
+ {\expanded{\defineXMLentity[#1]{\noexpand\readXMLsystem{\unstringed#3}}}}
+ {\doif{#4}{NDATA} % maybe we should also store the NDATA
+ {\expanded{\defineXMLentity[#1]{\noexpand\readXMLndata{\unstringed#3}}}}}}
+
+\def\readXMLsystem#1%
+ {\readfile{#1}
+ {\writestatus{xml-system}{reading #1}}
+ {\writestatus{xml-system}{unable to locate #1}}}
+
+\def\readXMLndata#1%
+ {#1} % {\externalfigure[#1]}
+
+\def\dohandleXMLentityDEFINE#1 %#2 #3 #4 #5 #6>% name replacement
+ {\def\docommando##1>{\expanded{\defineXMLentity[#1]{\the\scratchtoks}}}%
+ \afterassignment\docommando\grabstring}
+
+%D Such entities can be encapsulated in a \type {DOCTYPE}
+%D element. Therefore we remove the outer level of document
+%D type definitions.
+
+\defineXMLescape [DOCTYPE] \handleXMLdoctype
+
+\def\handleXMLdoctype#1 #2%
+ {\doifelse{#2}{[}
+ {%\writestatus{xml-doctype}{expanding #1}%
+ \def\next{\processuntil{]>}}}
+ {%\writestatus{xml-doctype}{skipping #1}%
+ \def\next{\gobbleuntil {>}}}%
+ \next}
+
+%D Some day we may need to support entities within a
+%D document type namespace.
+
+%D As an example of processing instructions, we implement a
+%D \CONTEXT\ code handler:
+
+\defineXMLprocessor [context] \contextXMLcommand
+\defineXMLprocessor [context-command] \contextXMLcommand
+
+% we need to get rid of the endlinechar inserted by \scantokens
+%
+% \def\saveendlinechar%
+% {\ifx\restoreendlinechar\undefined
+% \edef\restoreendlinechar{\endlinechar\the\endlinechar\space}%
+% \fi
+% \endlinechar=-1 }
+%
+% \def\scanXMLtokens#1%
+% {\saveendlinechar\scantokens{#1}\restoreendlinechar}
+
+%D For security reasons, we provide a switch to turn this
+%D mechanism on and off. When turned off, there is no way to
+%D turn it on from within an \XML\ encoded document, simply
+%D because the possibility to process \CONTEXT\ commands is
+%D gone.
+
+\setupXMLprocessing[\c!commando=\v!ja]
+
+%\def\contextXMLcommand#1%
+% {\doif{\@@xpcommando}{\v!ja}
+% {\pushmacro\disableXML
+% \def\disableXML{\global\let\afterXMLprocessor\empty}%
+% \global\let\afterXMLprocessor\enableXML
+% \setnormalcatcodes\scantokens{#1}\afterXMLprocessor
+% \popmacro\disableXML}}
+
+\def\contextXMLcommand#1% we don't use #1 here
+ {\doif{\@@xpcommando}{\v!ja}
+ {\disableXML\scantokens\@EA{\currentXMLprocess}\enableXML}}
+
+%D The indirect method (using the macro \type
+%D {\currentXMLprocess} instead of \type {#}) is needed
+%D because of the \type {\scantokens}. Given the previous
+%D definition, and given that \ETEX\ is used, we can now
+%D say:
+%D
+%D \starttypen
+%D
+%D \stoptypen
+%D
+%D A non||\ETEX\ solution is also possible, using buffers,
+%D but for the moment we assume that \ETEX\ is used.
+
+%D Next we implement a general purpose directive. This one
+%D can be used to set variables that can be accessed with
+%D \type {\XMLvar}.
+
+\defineXMLprocessor [context-directive] \contextXMLdirective
+
+\def\contextXMLdirective#1%
+ {\docontextXMLdirective#1 @ @ @\end}
+
+\def\docontextXMLdirective#1 #2 #3 #4\end% class variable value
+ {\csname\@@XMLvariable:#1:#2\endcsname{#3}}
+
+%D A simple processing instruction is the following. It just
+%D writes a message to the screen.
+
+\defineXMLprocessor [context-message] {\writestatus{xml-message}}
+
+%D The following processing instruction permits you to tag
+%D parts of the file in such a way that you can filter data.
+%D We use this method when documenting schemas.
+
+\defineXMLprocessor [context-block] \handleXMLcontextblock
+
+\def\handleXMLcontextblock#1%
+ {\dohandleXMLcontextblock#1 \relax}
+
+\def\dohandleXMLcontextblock#1 #2 #3\relax
+ {\dodohandleXMLcontextblock{#1}{#2}}
+
+\let\dodohandleXMLcontextblock\gobbletwoarguments
+
+\def\hideXMLcontextblock[#1]%
+ {\def\dodohandleXMLcontextblock
+ {\dododohandleXMLcontextblock\doifinset{#1}}}
+
+\def\videXMLcontextblock[#1]%
+ {\def\dodohandleXMLcontextblock
+ {\dododohandleXMLcontextblock\doifnotinset{#1}}}
+
+\protect
+
+\def\dododohandleXMLcontextblock#1#2#3#4%
+ {\let\next\relax
+ \doifelse{#3}{begin}
+ {#1{#4}{#2}
+ {%\writestatus{xml-block}{skipping begin #4}%
+ \long\def\next##1?context-block end #4 ##2?>{}}}
+ {\doif{#3}{name}
+ {#1{#4}{#2}
+ {%\writestatus{xml-block}{skipping name #4}%
+ \long\def\next##1?context-block ##2?>{}}}}%
+ \next}
+
+\unprotect
+
+%D Say that a file contains blocks like the following:
+%D
+%D \starttypen
+%D
+%D
+%D maybe so much
+%D
+%D
+%D \stoptypen
+%D
+%D The following commands will show only this block:
+%D
+%D \starttypen
+%D \videXMLcontextblock[whatevername] \showXMLfile{yourfile}
+%D \stoptypen
+%D
+%D You can also mark blocks in the following way, thereby
+%D saving yourself some work:
+%D
+%D \starttypen
+%D
+%D
+%D What do you want?
+%D
+%D
+%D
+%D How do you want?
+%D
+%D
+%D \stoptypen
+
+% yet undocumented and experimental
+
+% \defineXMLprocessor [context-eof] {\endinput}
+
+% already defined in xtag-ini
+
+% \defineXMLsingular [begingroup] {\begingroup}
+% \defineXMLsingular [endgroup] {\endgroup}
+%
+% \defineXMLsingular [gobblespacetokens] {\gobblespacetokens}
+
+\protect \endinput
diff --git a/tex/context/base/xtag-run.tex b/tex/context/base/xtag-run.tex
index 8da6ab9e3..7a919d31f 100644
--- a/tex/context/base/xtag-run.tex
+++ b/tex/context/base/xtag-run.tex
@@ -13,7 +13,7 @@
\writestatus{loading}{Context XML Macros (visualization)}
-\unprotect
+\unprotect
\bgroup
@@ -46,77 +46,192 @@
.egroup
-\definepalet
- [xtag]
- [0=darkgreen,
- 1=darkred,
- 2=darkblue,
- 3=darkgray]
+\gdef\@@XMLshow {\@@XML shw}
-\newcount\XMLlevel
+\gdef\@XMLindent#1%
+ {\ifnum\XMLlevel>1\advance\leftskip#11em\relax\fi}
-\def\@XMLindent#1%
-% {\ifnum\XMLlevel>0\advance\leftskip#11em\relax\fi}
- {\advance\leftskip#11em\relax}
-
-\def\@XMLlevel#1%
+\gdef\@XMLlevel#1%
{\advance\XMLlevel#11\relax}
-\def\@XMLentity#1%
- {\noindent
- \hbox
- {\localcolortrue
- \startcolormode{xtag:3}\string\stopcolormode}}
-
-\def\@XMLelement#1%
- {\ifhmode\unskip\fi
- \noindent
- \hbox
- {\localcolortrue
- \DoMod\XMLlevel by3to\scratchcounter
- \startcolormode{xtag:\number\scratchcounter}\string<\currentXMLelement\stopcolormode
+\unexpanded\gdef\@XMLentity#1%
+ {\noindent\hbox{\localcolortrue\color[xtag:0]{\string}}}
+
+\bgroup
+
+\@EA\catcode\string`=\@@active
+\@EA\catcode\string`"\@@active
+\@EA\catcode\string``\@@active
+\@EA\catcode\string`&\@@active
+
+\gdef\showXMLarguments%
+ {\ifshowXMLarguments
+ \bgroup
+ \@EA\catcode\string`=\@@active
+ \@EA\catcode\string`"\@@active
+ \@EA\catcode\string``\@@active
+ \@EA\catcode\string`&\@@active
+ \def={\color[xtag:7]{\string=}}%
+ \def"##1"{\string"\color[xtag:8]{##1}\string"}%
+ \def`##1`{\string`\color[xtag:8]{##1}\string`}%
+ \def#1;{\string&\color[xtag:7]{##1}\string;}%
+ \scantokens\@EA{\currentXMLarguments}%
+ \egroup
+ \else
+ \currentXMLarguments
+ \fi}
+
+\egroup
+
+\ifx\XMLprettycycle\undefined \gdef\XMLprettycycle{3} \fi
+
+\doglobal\newcounter\@XMLnofelements
+
+\gdef\@XMLelement#1%
+ {\ifnum\XMLlevel<\@@xfniveau\relax
+ \ifnum\kindofXMLelement=2\else
+ \doglobal\increment\@XMLnofelements\relax
+ \ifcase\@XMLnofelements\else\@@xftussen\fi
+ \fi
+ \fi
+\hangindent2em
+\indent
+ \bgroup
+ \localcolortrue
+ \advance\XMLlevel -1
+ \DoMod\XMLlevel by\XMLprettycycle to\scratchcounter
+ \advance\scratchcounter 1
+ \startcolor[xtag:\number\scratchcounter]%
+ \string<%
+ \ifnum\kindofXMLelement=2\string/\fi
+ \currentXMLelement
+ \stopcolor
\ifcase#1\or\ifx\currentXMLarguments\empty\else
- \startcolormode{xtag:3}\hskip.5em\currentXMLarguments\unskip\stopcolormode
+ \cleanupXMLarguments
+ \startcolor[xtag:0]\hbox{\space}\showXMLarguments\unskip\stopcolor
\fi\fi
- \startcolormode{xtag:\number\scratchcounter}\string>\stopcolormode}%
+ \startcolor[xtag:\number\scratchcounter]%
+ \ifnum\kindofXMLelement=3\string/\fi
+ \string>%
+ \stopcolor
+ \egroup
+ \ifnum\XMLlevel<\@@xfniveau\relax
+ \ifnum\kindofXMLelement=1\else
+ \doglobal\increment\@XMLnofelements\relax
+ \ifcase\@XMLnofelements\else\@@xftussen\fi
+ \fi
+ \fi
\ignorespaces}
-\def\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par}
-\def\prevXMLtext{\par\@XMLelement0\par\@XMLlevel-\blank}
-\def\nextXMLpara{\nextXMLline\par}
-\def\prevXMLpara{\par\prevXMLline}
-\def\nextXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1}
-\def\prevXMLline{\@XMLelement0\par\@XMLlevel-\@XMLindent-}
-\def\nextXMLword{\@XMLlevel+\@XMLelement1}
-\def\prevXMLword{\@XMLelement0\@XMLlevel-}
-
-\def\someXMLword{\@XMLlevel+\@XMLelement1\@XMLlevel-}
-
-\def\setXMLshow#1#2#3[#4]%
- {\def\docommando##1{#1[##1]#2#3}\processcommalist[#4]\docommando}
-
-\def\showXMLtxt{\setXMLshow\defineXMLenvironment\nextXMLtext\prevXMLtext}
-\def\showXMLpar{\setXMLshow\defineXMLenvironment\nextXMLpara\prevXMLpara}
-\def\showXMLlin{\setXMLshow\defineXMLenvironment\nextXMLline\prevXMLline}
-\def\showXMLwrd{\setXMLshow\defineXMLenvironment\nextXMLword\prevXMLword}
-\def\showXMLemp{\setXMLshow\defineXMLsingular\someXMLword\relax}
-
-\def\showXMLfile#1%
- {{\tttf\dontcomplain
- \let\executeXMLentity\@XMLentity
- \enableXML\verbatimXML
- \processfile{#1}}}
-
-\def\showXMLbuffer%
+\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par}
+\gdef\prevXMLtext{\par\@XMLelement0\par\@XMLlevel-\blank}
+\gdef\nextXMLpara{\nextXMLline\par}
+\gdef\prevXMLpara{\par\prevXMLline}
+\gdef\nextXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1}
+\gdef\prevXMLline{\@XMLelement0\par\@XMLindent-\@XMLlevel-}
+\gdef\nextXMLword{\@XMLlevel+\@XMLelement1}
+\gdef\prevXMLword{\@XMLelement0\@XMLlevel-}
+
+\gdef\someXMLtext{\blank\@XMLlevel+\@XMLelement1\@XMLlevel-\blank}
+\gdef\someXMLpara{\someXMLline}
+\gdef\someXMLline{\par\@XMLlevel+\@XMLindent+\@XMLelement1\par\@XMLindent-\@XMLlevel-}
+\gdef\someXMLword{\@XMLlevel+\@XMLelement1\@XMLlevel-}
+
+\gdef\@XMLindent#1%
+ {\ifnum\XMLlevel>0\advance\leftskip#11em\relax\fi}
+
+\gdef\nextXMLtext{\blank\@XMLlevel+\@XMLelement1\par\@XMLindent+}
+\gdef\prevXMLtext{\par\@XMLindent-\@XMLelement0\par\@XMLlevel-\blank}
+\gdef\nextXMLpara{\nextXMLline\par\@XMLindent+}
+\gdef\prevXMLpara{\par\@XMLindent-\prevXMLline}
+\gdef\nextXMLline{\par\@XMLlevel+\@XMLelement1}
+\gdef\prevXMLline{\@XMLelement0\par\@XMLlevel-}
+
+\gdef\someXMLline{\par\@XMLlevel+\@XMLelement1\par\@XMLlevel-}
+
+\gdef\setXMLshow#1#2#3[#4]%
+ {\def\docommando##1{#1[##1]#2#3\letvalue{\@@XMLshow:##1}\empty}%
+ \processcommalist[#4]\docommando}
+
+\gdef\showXMLign[#1]%
+ {\setXMLshow\defineXMLignore \relax\relax[#1]%
+ \setXMLshow\defineXMLsingular \relax\relax[#1]}
+
+\gdef\showXMLnop[#1]%
+ {\setXMLshow\defineXMLenvironment\relax\relax[#1]%
+ \setXMLshow\defineXMLsingular \relax\relax[#1]}
+
+\gdef\showXMLtxt[#1]%
+ {\setXMLshow\defineXMLenvironment\nextXMLtext\prevXMLtext[#1]%
+ \setXMLshow\defineXMLsingular \someXMLtext\relax [#1]}
+
+\gdef\showXMLpar[#1]%
+ {\setXMLshow\defineXMLenvironment\nextXMLpara\prevXMLpara[#1]%
+ \setXMLshow\defineXMLsingular \someXMLline\relax [#1]}
+
+\gdef\showXMLlin[#1]%
+ {\setXMLshow\defineXMLenvironment\nextXMLline\prevXMLline[#1]%
+ \setXMLshow\defineXMLsingular \someXMLword\relax [#1]}
+
+\gdef\showXMLwrd[#1]%
+ {\setXMLshow\defineXMLenvironment\nextXMLword\prevXMLword[#1]%
+ \setXMLshow\defineXMLsingular \someXMLword\relax [#1]}
+
+\gdef\showXMLemp[#1]%
+ {\setXMLshow\defineXMLsingular\someXMLword\relax[#1]}
+
+\gdef\doautoshowXMLelement%
+ {\ifcase\kindofXMLelement
+ \or \nextXMLpara \or \prevXMLpara \or \someXMLline
+ \fi}
+
+\gdef\autoshowXMLelement%
+ {\ifcsname\@@XMLshow:\currentXMLelement\endcsname
+ \expandafter\normalexecuteXMLelement
+ \else
+ \expandafter\doautoshowXMLelement
+ \fi}
+
+\global\let\normalexecuteXMLelement\executeXMLelement
+
+\gdef\showXMLfile#1%
+ {\bgroup
+ \nohyphens
+ \dontcomplain
+ \XMLlevel=0
+ \increment\@@xfniveau % hack
+ \tttf
+ \startopelkaar[\v!blanko]
+ \ifautoXMLshow \let\executeXMLelement\autoshowXMLelement \fi
+ \let\executeXMLentity\@XMLentity
+ \enableXML\verbatimXML
+ \readfile{\truefilename{#1}}{}{}\endgraf
+ \stopopelkaar
+ \egroup}
+
+\gdef\showXMLbuffer%
{\dosingleempty\doshowXMLbuffer}
-\def\doshowXMLbuffer[#1]%
+\gdef\doshowXMLbuffer[#1]%
{\doifelsenothing{#1}
{\doshowXMLbuffer[\jobname]}
{\bgroup
- \def\dodoprocessXMLbuffer##1%
- {\showXMLfile{\TEXbufferfile{##1}}}%
+ \def\dodoprocessXMLbuffer##1{\showXMLfile{\TEXbufferfile{##1}}}%
\processcommalist[#1]\dodoprocessXMLbuffer
\egroup}}
-\protect \endinput
+%D
+
+\gdef\showXSDcomponent%
+ {\dodoubleargument\doshowXSDcomponent}
+
+\gdef\doshowXSDcomponent[#1][#2]%
+ {\bgroup
+ \showXMLnop[xsd:schema]
+ \showXMLign[xsd:appInfo]
+ \showXMLign[xsd:annotation]
+ \videXMLcontextblock[#2]
+ \showXMLfile{#1}
+ \egroup}
+
+\protect \endinput
diff --git a/tex/context/base/xtag-xsd.tex b/tex/context/base/xtag-xsd.tex
new file mode 100644
index 000000000..e354202d5
--- /dev/null
+++ b/tex/context/base/xtag-xsd.tex
@@ -0,0 +1,28 @@
+%D \module
+%D [ file=xtag-pre,
+%D version=2001.10.04,
+%D title=\CONTEXT\ XML Support,
+%D subtitle=Schemas,
+%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.
+
+\unprotect
+
+%D The following commands picks up a named block from the
+%D given file and pretty prints it.
+%D
+%D \starttypen
+%D \showXSDcomponent [x-exa-tx.xsd] [sequence]
+%D \stoptypen
+%D
+%D If needed, you adapt the colors used by redefining the
+%D \type {xtag} color palet.
+
+\fetchruntimecommand\showXSDcomponent {\f!xtagprefix\s!run}
+
+\protect \endinput
diff --git a/tex/context/config/cont-usr.tex b/tex/context/config/cont-usr.tex
index e11370510..38dbab706 100644
--- a/tex/context/config/cont-usr.tex
+++ b/tex/context/config/cont-usr.tex
@@ -30,10 +30,11 @@
\definefilesynonym [lang-da.pat] [dkhyph.tex]
\definefilesynonym [lang-de.pat] [dehyphn.tex]
\definefilesynonym [lang-en.pat] [ushyph1.tex]
+\definefilesynonym [lang-es.pat] [eshyph.tex]
\definefilesynonym [lang-fi.pat] [fihyph.tex]
\definefilesynonym [lang-fr.pat] [frhyph.tex]
-\definefilesynonym [lang-hu.pat] [huhyph.tex]
\definefilesynonym [lang-hr.pat] [hrhyph.tex]
+\definefilesynonym [lang-hu.pat] [huhyph.tex]
\definefilesynonym [lang-it.pat] [ithyph.tex]
\definefilesynonym [lang-la.pat] [lahyph7.tex]
\definefilesynonym [lang-nl.pat] [nehyph.tex]
@@ -41,10 +42,11 @@
\definefilesynonym [lang-pl.pat] [plhyph.tex]
\definefilesynonym [lang-pt.pat] [pthyph.tex]
\definefilesynonym [lang-ro.pat] [rohyph.tex]
+\definefilesynonym [lang-ru.pat] [ruenhyph.tex]
\definefilesynonym [lang-sk.pat] [skhyph.tex]
-\definefilesynonym [lang-es.pat] [eshyph.tex]
\definefilesynonym [lang-sv.pat] [sehyph.tex]
\definefilesynonym [lang-tr.pat] [trhyph.tex]
+\definefilesynonym [lang-ua.pat] [ukrenhyp.tex]
\definefilesynonym [lang-uk.pat] [ukhyphen.tex]
\definefilesynonym [lang-us.pat] [ushyph1.tex]
@@ -86,9 +88,11 @@
% \installlanguage [\s!da] [\c!status=\v!start] % danish
% \installlanguage [\s!de] [\c!status=\v!start] % german
% \installlanguage [\s!en] [\c!status=\v!start] % english us
+% \installlanguage [\s!es] [\c!status=\v!start] % spanish
% \installlanguage [\s!fi] [\c!status=\v!start] % finnish
% \installlanguage [\s!fr] [\c!status=\v!start] % french
% \installlanguage [\s!hr] [\c!status=\v!start] % croatian
+% \installlanguage [\s!hu] [\c!status=\v!start] % hungarian
% \installlanguage [\s!it] [\c!status=\v!start] % italian
% \installlanguage [\s!la] [\c!status=\v!start] % latin
% \installlanguage [\s!nl] [\c!status=\v!start] % dutch
@@ -96,11 +100,11 @@
% \installlanguage [\s!pl] [\c!status=\v!start] % polish
% \installlanguage [\s!pt] [\c!status=\v!start] % portuguese
% \installlanguage [\s!ro] [\c!status=\v!start] % romanian
-% \installlanguage [\s!hu] [\c!status=\v!start] % hungarian
+% \installlanguage [\s!ru] [\c!status=\v!start] % russian
% \installlanguage [\s!sk] [\c!status=\v!start] % slovak
-% \installlanguage [\s!es] [\c!status=\v!start] % spanish
% \installlanguage [\s!sv] [\c!status=\v!start] % swedish
% \installlanguage [\s!tr] [\c!status=\v!start] % turkish
+% \installlanguage [\s!ua] [\c!status=\v!start] % ukrainian
% \installlanguage [\s!uk] [\c!status=\v!start] % english uk
% \installlanguage [deo] [\c!status=\v!start] % old german
@@ -114,9 +118,11 @@
% \setupcurrentlanguage[\s!da]
% \setupcurrentlanguage[\s!de]
% \setupcurrentlanguage[\s!en]
+% \setupcurrentlanguage[\s!es]
% \setupcurrentlanguage[\s!fi]
% \setupcurrentlanguage[\s!fr]
% \setupcurrentlanguage[\s!hr]
+% \setupcurrentlanguage[\s!hu]
% \setupcurrentlanguage[\s!it]
% \setupcurrentlanguage[\s!la]
% \setupcurrentlanguage[\s!nl]
@@ -124,11 +130,11 @@
% \setupcurrentlanguage[\s!pl]
% \setupcurrentlanguage[\s!pt]
% \setupcurrentlanguage[\s!ro]
-% \setupcurrentlanguage[\s!hu]
+% \setupcurrentlanguage[\s!ru]
% \setupcurrentlanguage[\s!sk]
-% \setupcurrentlanguage[\s!es]
% \setupcurrentlanguage[\s!sv]
% \setupcurrentlanguage[\s!tr]
+% \setupcurrentlanguage[\s!ua]
%D Local font settings can go here. Normally suitable
%D defaults are already preloaded, almost certainly the
diff --git a/tex/context/extra/setup-qr.tex b/tex/context/extra/setup-qr.tex
index 31f40f6ca..d78943cce 100644
--- a/tex/context/extra/setup-qr.tex
+++ b/tex/context/extra/setup-qr.tex
@@ -1,89 +1,40 @@
-% output=pdftex tex=pdfetex modes=cmr,nocover
-
-% This file is not part of the regular ConTeXt distribution.
-% Because this file generates the official ConTeXt command
-% references, you may not alter it.
-%
-% copyright: 19..-2001, Hans Hagen, PRAGMA-ADE, Hasselt NL
-
-% modes: cmr use cmr fonts
-% nocover don't produce a cover page
-%
-% other modes are supported by the cod driver
-
-\unprotect
-
-\startinterface dutch \def\LocalColor{green} \stopinterface
-\startinterface english \def\LocalColor{red} \stopinterface
-\startinterface german \def\LocalColor{blue} \stopinterface
-\startinterface czech \def\LocalColor{magenta} \stopinterface
-\startinterface italian \def\LocalColor{cyan} \stopinterface
-\startinterface romanian \def\LocalColor{yellow} \stopinterface
-
-\startuseMPgraphic{cover}
- def something =
- path p, q;
- color localgray, drawcolor, fillcolor, localcolor;
- localgray := (.9,.9,.9);
- localcolor := \LocalColor ;
- p := (0,0)--(200,0)--(200,50)--(0,50)--cycle;
- q := (25,25)--(175,25);
- dx := uniformdeviate 600;
- dy := uniformdeviate 900;
- sx := .3+(uniformdeviate .5);
- sy := .3+(uniformdeviate .5);
- drawcolor := (uniformdeviate 1)[.75localcolor,localcolor];
- fillcolor := (uniformdeviate 1)[.75localgray,localgray];
- rr := uniformdeviate 360;
- p := p xscaled sx yscaled sy rotated rr shifted (dx,dy);
- q := q xscaled sx yscaled sy rotated rr shifted (dx,dy);
- fill p withcolor fillcolor;
- ahlength := (.2+sy)*15;
- ahangle := (.2+sx)*45;
- draw p withpen pencircle scaled 7.5 withcolor drawcolor;
- drawarrow q withpen pencircle scaled 7.5 withcolor drawcolor;
- enddef;
- for i := 1 upto 1000:
- something;
- endfor;
- setbounds currentpicture to unitsquare
- xscaled \overlaywidth yscaled \overlayheight;
-\stopuseMPgraphic
-
-\startnotmode[cmr]
-
-\setupbodyfont[lbr]
-
-\stopnotmode
+% output=pdftex tex=pdfetex
+
+%D \module
+%D [ file=setup-qr,
+%D version=1997.07.22,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Quick Reference Document / Efficient,
+%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.
+
+%D This is a stripped down version of the good old quick
+%D reference document. This version is more compact and
+%D therefore better suited for local processing and printing.
+%D The slightly more fancy version can be fetched from the
+%D \CONTEXT\ web site.
+
+\dontcomplain \silentmode
+
+\unprotect
\setupbodyfont
[9pt]
-\setupcolors
- [\c!status=\v!start]
-
-\startnotmode[nocover]
-
-\defineoverlay
- [cover]
- [\useMPgraphic{cover}]
-
-\stopnotmode
-
\stellayoutin
- [\c!rugwit=2cm,
- \c!kopwit=2cm,
+ [\c!rugwit=1cm,
+ \c!kopwit=1cm,
\c!hoofd=0cm,
\c!voet=0cm,
- \c!marge=0cm,
- \c!breedte=\v!passend,
- \c!hoogte=\v!passend]
+ \c!breedte=\v!midden,
+ \c!hoogte=\v!midden]
-\stelnummeringin
- [\c!status=\v!stop,
- \c!variant=\v!dubbelzijdig]
-
-\input setupa.tex
+\readfile{setupa} {} {}
\stelsetupin
[\c!criterium=\v!alles,
@@ -93,47 +44,16 @@
[setuptext]
[\c!kader=\v!aan]
-\usemodule[cod-01]
-
-\input setupb.tex
+\readfile{setupb} {} {}
\starttekst
-\setupbackgrounds
- [\v!rechterpagina]
- [\c!achtergrond=cover]
-
-\startmakeup[\v!standaard]
- \definefont[test][RegularBold at 100pt]\test\setstrut
- \steluitlijnenin[\v!midden]
- \strut Con\TeX t \par
- \definefont[test][RegularBold at 75pt]\test\setstrut
- \startinterface dutch \strut commando's \par \stopinterface
- \startinterface english \strut commands \par \stopinterface
- \startinterface german \strut befehle \par \stopinterface
- \startinterface czech \strut prikazy \par \stopinterface
- \startinterface italian \strut comandi \par \stopinterface
- \startinterface romanian \strut comenzile \par \stopinterface
- \vfill
- \definefont[test][RegularBold at 150pt]\test\setstrut
- \startinterface dutch \strut NL \stopinterface
- \startinterface english \strut EN \stopinterface
- \startinterface german \strut DE \stopinterface
- \startinterface czech \strut CZ \stopinterface
- \startinterface italian \strut IT \stopinterface
- \startinterface romanian \strut RO \stopinterface
-\stopmakeup
-
-\setupbackgrounds
- [\v!rechterpagina]
- [\c!achtergrond=]
-
\startmakeup[\v!standaard]
- \definefont[test][RegularBold at 60pt]\test\setstrut
\steluitlijnenin[\v!midden]
+ \definedfont[RegularBold at 60pt]\setstrut
\strut Con\TeX t \par
\vskip24pt
- \definefont[test][RegularBold at 45pt]\test\setstrut
+ \definedfont[RegularBold at 45pt]\setstrut
\startinterface dutch \strut commando's \par \stopinterface
\startinterface english \strut commands \par \stopinterface
\startinterface german \strut befehle \par \stopinterface
@@ -148,31 +68,10 @@
\startinterface czech \strut \^cesk\'y \par \stopinterface
\startinterface italian \strut italiano \par \stopinterface
\startinterface romanian \strut rom\^{a}n\u{a} \par \stopinterface
-
-\stopmakeup
-
-\stellayoutin
- [\c!kopwit=1.5cm]
-
-\protect \placesetup \unprotect
-
-\pagina[\v!ja,\v!blanko,\v!rechts,\v!links]
-
-\setupbackgrounds
- [\v!linkerpagina]
- [\c!achtergrond=cover]
-
-\stellayoutin
- [\c!kopwit=2cm]
-
-\startmakeup[\v!standaard][\c!pagina=]
- \definefont[test][RegularBold at 24pt]\test\stelinterliniein
- \steluitlijnenin[\v!midden]
- \vfill
- PRAGMA ADE \par
- Ridderstraat 27, 8061GH Hasselt NL
\stopmakeup
\protect
+\placesetup
+
\stoptekst
diff --git a/tex/context/user/cont-sys.rme b/tex/context/user/cont-sys.rme
index 4da61099c..a571c8c60 100644
--- a/tex/context/user/cont-sys.rme
+++ b/tex/context/user/cont-sys.rme
@@ -71,9 +71,9 @@
%
% Enabling \CONTEXT\ navigation symbols as well as \euro's.
-\usesymbols [nav,eur]
+\usesymbols [nav,mvs]
-\setupsymbolset [navigation 1]
+\setupsymbolset [navigation 1] % not that clever
\setupinteraction [\c!symboolset=navigation 1]
diff --git a/tex/generic/context/mptopdf.tex b/tex/generic/context/mptopdf.tex
index 665971088..9cd130fd5 100644
--- a/tex/generic/context/mptopdf.tex
+++ b/tex/generic/context/mptopdf.tex
@@ -84,7 +84,7 @@
%D are collected in the file:
\input supp-pdf
-\input supp-mpe
+\input supp-mpe \MPcmyktrue
%D We use no output routine.
diff --git a/tex/generic/context/ppchtex.noc b/tex/generic/context/ppchtex.noc
index 81ec994e9..12cc676af 100644
--- a/tex/generic/context/ppchtex.noc
+++ b/tex/generic/context/ppchtex.noc
@@ -126,8 +126,12 @@
\defineconstant number getal nummer
\defineconstant height hoogte hoehe
\defineconstant frame kader rahmen
+%defineconstant framecolor kaderkleur rahmenfarbe
+\defineconstant color kleur farbe
\defineconstant bodyfont korps fliesstext
\defineconstant style letter schriftstil
+\defineconstant rulethickness lijndikte liniendicke
+\defineconstant rulecolor lijnkleur linienfarbe
\defineconstant left links links
\defineconstant offset offset offset
\defineconstant bottom onder unten
@@ -138,6 +142,7 @@
\defineconstant scale schaal format
\defineconstant status status status
\defineconstant text tekst text
+\defineconstant textcolor tekstkleur tekstfarbe
\defineconstant textsize tekstformaat textgroesse
\defineconstant alternative variant alternative
\defineconstant x x x
@@ -201,6 +206,6 @@
\setupchemical[\c!resolutie=\outputresolution]
\fi
-\protect
+\protect
\endinput
--
cgit v1.2.3