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] <mailto:[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