Hi Denis,

Many thanks for checking the MWE on your side — and for confirming that it runs correctly once the XML file is saved under the right name. This is actually very reassuring: it shows that the TEI structure, the namespace, and the basic ConTeXt XML pipeline (|\xmlnamespace|, |\xmlsetsetup|, |\xmlprocessfile|) are all sound.

This narrows down the problem on my side to something very local, most probably in one of these areas:

• filename resolution on Windows (LMTX 2025.07.27 / fmt 2025.12.08)
• catcode pollution or stray characters in the setup identifier
• an invisible Unicode character around “tei:start” being interpreted as part of a control sequence • or possibly a conflict in my environment or editor that alters the file contents

Now that we know the MWE is valid and can be processed normally, I can focus on isolating what exactly corrupts the setup name on my installation (it appears internally as something like “\18>:tei:start”, which suggests a mis-scanned token before the |t|).

If you have a moment at some point, it would be interesting to know whether the same MWE also behaves correctly with:

• another engine format date
• a fully clean standalone folder (no texmf-local contamination)
• or different ways of invoking ConTeXt (|context|, |mtxrun --script context|, etc.)

But already your confirmation is extremely helpful: the code itself is right, and the issue is environmental, not conceptual.

Many thanks again for your help and quick feedback!

Best,
JP

------------------------------------------------------------------------

Si tu v


Le 11/12/2025 à 13:18, [email protected] a écrit :

Sorry, I saved the xml with a wrong name. Now, it works as expected.

Pdf looks like this;

http://www.tei-c.org/ns/1.0

<TEI xmlns=http://www.tei-c.org/ns/1.0> <text> <body> <lg type="stanza"> <lg

type="orig"> <l>Sometimes I hear the distant call</l> <l n="2">Of nights I thought

would never fade</l> </lg> <lg type="trans"> <l>Parfois j’entends un appel loin­

tain</l> <l n="2">Des nuits que je croyais éternelles</l> </lg> <lg type="comm">

<l>Commentary for line 1</l> <l>Commentary for line 2</l> </lg> </lg> </body>

</text> </TEI>/TEI/text/body

*Von:*[email protected] <[email protected]>
*Gesendet:* Donnerstag, 11. Dezember 2025 13:16
*An:* 'mailing list for ConTeXt users' <[email protected]>
*Cc:* 'Jean-Pierre Delange' <[email protected]>
*Betreff:* AW: [NTG-context] Re: XML-TEI : \xmlprocessfile: unexpected character in setup name

I cannot reproduce your error. Instead I’m gettting a pdf with <error>empty xml file</error>/TEI/text/body

*Von:*Jean-Pierre Delange via ntg-context <[email protected]>
*Gesendet:* Mittwoch, 10. Dezember 2025 22:32
*An:* [email protected]
*Cc:* Jean-Pierre Delange <[email protected]>
*Betreff:* [NTG-context] Re: XML-TEI : \xmlprocessfile: unexpected character in setup name

Just a quick correction: the coding mistake in my email

|\xxmlsetsetup{|main|}{*}{tei:all}|

(with two initial x)

is not present in my actual source file. It was introduced only in the email draft.
The original code uses the correct form:

|\xmlsetsetup{|main|}{*}{tei:all}|

So the issue I am facing is /not/ caused by that typo !

Le 10/12/2025 à 22:24, Jean-Pierre Delange via ntg-context a écrit :

    Hi fellows !

    I am returning to you with some XML-TEI issues. I am trying to
    produce a MWE that shows how to handle the literary analysis of
    versification and how to typeset the results properly. To reach
    this goal, I turned to the XML-TEI approach, but I have
    encountered an issue ...Then, this MWE is now a M(N)WE ...

    • Goal: produce a PDF from a TEI-XML source containing
    – original poem
    – translation
    – commentary
    – notes (<note>)
    – apparatus (<app><lem><rdg>)

    • Desired layout in ConTeXt:
    – original text with line numbers
    – translation in parallel
    – commentary in a third column
    – proper rendering of notes and apparatus

    • Reason for using TEI:
    – separation between content and layout
    – reuse of the same TEI source for different typesettings
    – scalable workflow for wider scholarly editions

    • TEI structure (poem.xml):
    – <lg type="orig">, <lg type="trans">, <lg type="comm">
    – <l> elements for individual lines
    – optional <note> and <app><lem><rdg> elements
    – valid XML and valid TEI namespace declaration

    Minimal TEI file:

    <?xml version="1.0"|encoding=|"UTF-8"|?>|

    <TEI||xmlns|=|"http://www.tei-c.org/ns/1.0"; <http://www.tei-c.org/ns/1.0>|>|

    ||<text|>|

    ||<body|>|

    ||<lg||type|=|"stanza"|>|

    ||<lg||type|=|"orig"|>|

    ||<l|>Sometimes I hear the distant call|</l|>|

    ||<l||n|=|"2"|>Of nights I thought would never fade|</l|>|

    ||</lg|>|

    ||<lg||type|=|"trans"|>|

    ||<l|>Parfois j’entends un appel lointain|</l|>|

    ||<l||n|=|"2"|>Des nuits que je croyais éternelles|</l|>|

    ||</lg|>|

    ||<lg||type|=|"comm"|>|

    ||<l|>Commentary for line 1|</l|>|

    ||<l|>Commentary for line 2|</l|>|

    ||</lg|>|

    ||</lg|>|

    ||</body|>|

    ||</text|>|

    </TEI|>|

    • Minimal ConTeXt debugging file:
    – declares the TEI namespace
    – assigns all elements to a debug setup
    – defines an entry setup for starting the XML traversal
    – calls \xmlprocessfile

    %mwe-xmltei-debug.tex

    |\setuppapersize|[A4]||

    |\setupbodyfont|[modern,11pt]||

    ||

    |\xmlnamespace{tei}{http://www.tei-c.org/ns/|1.0|}|

    ||

    |\xxmlsetsetup{|main|}{*}{tei:all}|

    ||

    |\startxmlsetups tei:all|

    |  \type{NODE: \xmlname{|#1|} -- |TEXT|: \xmltext{|#1|}}|

    |\stopxmlsetups|

    ||

    |\xmlsetsetup{|main|}{/}{tei:start}|

    ||

    |\startxmlsetups tei:start|

    |  \xmlflush{|main|}{/TEI/|text|/|body|}|

    |\stopxmlsetups|

    ||

    |\starttext|

    |\xmlprocessfile{|main|}{poem|.xml|}{tei:start}|

    |\stoptext|

    • Expected result:
    – the PDF should list TEI nodes (NODE: TEI, NODE: lg, NODE: l, etc.)
    – confirms that namespace and setup dispatching work correctly

    • Actual problem:
    – ConTeXt aborts with the TeX error “You can't use the letter
    U+0041 A in horizontal mode”
    – this happens before any TEI node is processed
    – the setup name appears internally as something like “\18>:tei:start”
    – this suggests that the setup identifier is not read as a normal
    control sequence at runtime

    • Technical implication:
    – the entry setup cannot be resolved normally by the XML processor
    – the dispatch never reaches the TEI tree
    – ConTeXt attempts to execute a malformed control sequence and aborts

    Any insights into why the setup name is degraded at runtime, or
    how to stabilise the entry point for XML processing in this
    context, would be warmly welcome (as I've struggled hours on this
    issue !).

    Best regards,

    JP

    
___________________________________________________________________________________

    If your question is of interest to others as well, please add an entry to 
the Wiki!

    maillist :[email protected] 
/https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl

    webpage  :https://www.pragma-ade.nl /https://context.aanhet.net (mirror)

    archive  :https://github.com/contextgarden/context

    wiki     :https://wiki.contextgarden.net

    
___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to