On 06/17/2018 09:37 PM, Pablo Rodriguez wrote:
Hi Thomas,
this may work in your case:
\startxmlsetups xml:document \mainlanguage[\xmlatt{#1}{language}] \doifmodeelse{**en} {\usebtxdefinitions [english]} {\usebtxdefinitions [deutsch]} \stopxmlsetups
I have just checked in with another document and it worked as expected.
Thank you for your suggestion, Pablo, but this is just a slightly different syntax to express the same test, this doesn't change anything. Maybe this document is clearer in explaining my problem (and results are identical with the \doifmodeelse syntax): \startbuffer[test] <document language="de"> test </document> \stopbuffer \startxmlsetups xml:testsetups \xmlsetsetup{\xmldocument}{document}{xml:*} \stopxmlsetups \xmlregistersetup{xml:testsetups} \startxmlsetups xml:document \mainlanguage[\xmlatt{#1}{language}] Language settings work correctly here: \doifelse {\currentmainlanguage} {de} {\color [blue] {Deutsch}} {\color [red] {English}}\par \xmlflush{#1} \stopxmlsetups \starttext This is where the btx set has to be loaded, and language settings do not work as needed: \doifelse {\currentmainlanguage} {de} {\color [blue] {Deutsch}} {\color [red] {English}}\par \xmlprocessbuffer{main}{test}{} \stoptext Is there any way to set the language before the <document> element is processed? I experimented with this \startxmlsetups xml:language:initiate \mainlanguage[\xmlattribute{\xmldocument}{root::/document}{language}] \stopxmlsetups \xmlbeforedocumentsetup{\xmldocument}{xml:language:initiate}{xml:testsetups} but this doesn't work, and I'm not sure I'm using it the right way. All best Thomas