diff options
author | Hans Hagen <pragma@wxs.nl> | 2006-04-10 20:04:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2006-04-10 20:04:00 +0200 |
commit | 179243cbf50610eceed2704e4b3e4372d8462683 (patch) | |
tree | 57b2e6e35322fa0361a236e9fa965b6a71162a5a /tex/context/base/xtag-stk.tex | |
parent | 6d33823d5817378ce39b53563438a533de0efbe7 (diff) | |
download | context-179243cbf50610eceed2704e4b3e4372d8462683.tar.gz |
stable 2006.04.10 20:04
Diffstat (limited to 'tex/context/base/xtag-stk.tex')
-rw-r--r-- | tex/context/base/xtag-stk.tex | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/tex/context/base/xtag-stk.tex b/tex/context/base/xtag-stk.tex index 1d596766b..32b2b87df 100644 --- a/tex/context/base/xtag-stk.tex +++ b/tex/context/base/xtag-stk.tex @@ -33,7 +33,7 @@ \def\resetXMLelements {\XMLstacklevel\zerocount} -\def\startsavingXMLelements +\def\startsavingXMLelements % maybe something with \ignorespaces \\removeunwantedspaces {\XMLstacklevel\zerocount \let\normalexecuteXMLelement\executeXMLelement \def\executeXMLelement{\csname\@@XMLelement:\@@xmlstack\ifcase\kindofXMLelement\or\or\or/\fi\endcsname}} @@ -117,7 +117,7 @@ {\ifnum\recurselevel>#1\relax#3\fi \getXMLstackdata\recurselevel}}} -\def\countXMLnamedstack#1% +\def\countXMLnamedstack#1% todo: \nofXMLchildren ! ! ! ! ! {\scratchcounter\zerocount \dorecurse\XMLstacklevel {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} @@ -179,4 +179,57 @@ \advance\XMLstacklevel\minusone \exitloop}}} +%D BEWARE: these names may change (get stack in the name) + +\def\XMLallnamed#1% + {\dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\getXMLstackdata\recurselevel}}} + +\def\defXMLfirstnamed#1#2% \cs list + {\dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} + {\defXMLstackdata#1\recurselevel\exitloop}}} + +\def\defXMLfirstnamedtext#1#2% \cs list + {\dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#2}} + {\edef#1{\getXMLstacktext\recurselevel}\exitloop}}} + +\def\XMLfirstnamed#1% + {\dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\getXMLstackdata\recurselevel\exitloop}}} + +\def\XMLnotnamed#1% + {\dorecurse\XMLstacklevel + {\expanded{\doifnotinset{\getXMLstackname\recurselevel}{#1}} + {\getXMLstackdata\recurselevel\exitloop}}} + +\let\XMLstackposition\!!zerocount + +\def\XMLdoifonstackelse#1% was \XMLdoifelsefound + {\!!doneafalse + \let\XMLstackposition\!!zerocount + \dorecurse\XMLstacklevel + {\expanded{\doifinset{\getXMLstackname\recurselevel}{#1}} + {\let\XMLstackposition\recurselevel\!!doneatrue\exitloop}}% + \if!!donea + \expandafter\firstoftwoarguments + \else + \expandafter\secondoftwoarguments + \fi} + +%D Handy: + +\def\pushXMLmeaning#1% or [#1] + {\@EA\pushmacro\csname\@@XMLelement:#1/\endcsname + \@EA\pushmacro\csname\@@XMLelement:#1\endcsname + \@EA\pushmacro\csname\@@XMLelement:/#1\endcsname} + +\def\popXMLmeaning#1% or [#1] + {\@EA\popmacro\csname\@@XMLelement:#1/\endcsname + \@EA\popmacro\csname\@@XMLelement:#1\endcsname + \@EA\popmacro\csname\@@XMLelement:/#1\endcsname} + \protect \endinput |