I have an expansion problem in natural tables. I need to have this: \bTD\XMLDBcontinuepartrue\ignorespaces\XMLflush{revremark}\eTD but \XMLflush{revremark} must be expanded. When I do that using \expanded, \expanded{\bTD\noexpand\XMLDBcontinuepartrue\ignorespaces\XMLflush{#1}}\eTD I get errors when I have compound characters: \XMLDBcontinuepartrue\ignorespaces Kleine \dobuildtextaccent\char 127 A{}nderung It should be \dobuildtextaccent{\char 127} A for it to be valid. Or it should be \buildtextaccent\textdiaeresis A In other words, \XMLflush{#1} should be expanded, but not all the way down. How do I get that? This is my hack, but it is awful because it relies on an exact number of expansions: \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter\!!stringa \expandafter\expandafter\expandafter{\csname XML:dat:#1\endcsname} \@EA\bTD\@EA\XMLDBcontinuepartrue\@EA\ignorespaces\!!stringa\eTD} Error log: \XMLDBshowElementTD #1->\expanded {\bTD \noexpand \XMLDBcontinuepartrue \ignore spaces \XMLflush {#1}}\eTD #1<-revremark \expanded #1->\long \edef \@@expanded {\noexpand #1}\@@expanded #1<-\bTD \noexpand \XMLDBcontinuepartrue \ignorespaces \XMLflush {revremark} {\long} {\noexpand} {\noexpand} \XMLflush #1->\csname \@@XMLdata :#1\endcsname #1<-revremark {\csname} \@@XMLdata ->\@@XML dat \@@XML ->XML: \XML:dat:revremark ->Kleine Änderung Ä->\Adiaeresis {} \Adiaeresis ->\dohandlecharacter {Adiaeresis} \dohandlecharacter #1->\csname \ifcsname \characterencoding #1\endcsname \chara cterencoding \else \nocharacterencoding \fi #1\endcsname #1<-Adiaeresis {\csname} {\ifcsname} \characterencoding ->@default@ {true} \characterencoding ->@default@ {\else} \@default@Adiaeresis ->\buildtextaccent \textdiaeresis A \buildtextaccent ->\ifignoreaccent \expandafter \nobuildtextaccent \else \expan dafter \dobuildtextaccent \fi {\iffalse} {false} {\expandafter} {\fi} \textdiaeresis ->\dohandlecharacter {textdiaeresis} \dohandlecharacter #1->\csname \ifcsname \characterencoding #1\endcsname \chara cterencoding \else \nocharacterencoding \fi #1\endcsname #1<-textdiaeresis {\csname} {\ifcsname} \characterencoding ->@default@ {true} \characterencoding ->@default@ {\else} \@default@textdiaeresis ->\char 127 \@@expanded ->\bTD \XMLDBcontinuepartrue \ignorespaces Kleine \dobuildtextaccen t \char 127 A{}nderung \bTD ->\dodoubleempty \parseTD ... snip ... \parseTD [#1][#2]#3\eTD ->\getparameters [\@@tbl ][\c!ny =\tblnr ,\c!nx =\tblnc ,nc=1,nr=1,#1]\doloop {\increment \currentcol \doifnottbltag \maximumrow \curr entcol \exitloop }\let \row \maximumrow \let \col \currentcol \dorecurse {\tbln y } {\let \col \currentcol \settblcol \row \col \tblnx \ifnum \tblnx >\maximumr owspan \relax \let \maximumrowspan \tblnx \fi \dorecurse {\tblnx } {\settbltag \row \col \tblnone \increment \col }\increment \row }\decrement \col \ifnum \co l >\maximumcol \relax \let \maximumcol \col \fi \settbltag \maximumrow \current col \tblcell \settblcol \maximumrow \currentcol \tblnx \settblrow \maximumrow \ currentcol \tblny \edef \celltag {{\maximumrow }{\currentcol }}\@EA \settbltxt \@EA \maximumrow \@EA \currentcol \@EA {\@EA \handleTBLcell \celltag [#1]{#3}} #1<- #2<- #3<-\XMLDBcontinuepartrue \ignorespaces Kleine \dobuildtextaccent \char 127 A{} nderung ... snip ... \dobuildtextaccent #1#2->{\let \char \normalaccent #1\let \char \normalchar #2} #1<-\char #2<-1 {begin-group character {} {\let} {\accent} ! Missing number, treated as zero. <to be read again> \let \dobuildtextaccent ... \char \normalaccent #1\let \char \normalchar #2} <argument> ...es Kleine \dobuildtextaccent \char 1 27 A{}nderung -- Simon Pepping email: spepping@scaprea.hobby.nl