I had tested using a MWE but in reality I have a rather involved set of XML setups with some lua code inclusions and multi-language handling bits and when I ran that as an environment without the explicit \starttext \xmlprocessfile{...}{\inputfilename}{} \stoptext, while some parts did work (fonts, colours, language switches) some of the page layout information was lost. When I added the \starttext \xmlprocessfile{...}{\inputfilename}{} \stoptext back in, it worked properly.

I'm not sure exactly which bits "fell out" but something definitely did. But the explicit calling as above fixed it.

Duncan

On Thu, 3 Jul 2025 at 10:46, <denismaier@mailbox.org> wrote:

What do you mean by this?

 

Von: Duncan Hothersall <dh@capdm.com>
Gesendet: Donnerstag, 3. Juli 2025 10:50
An: mailing list for ConTeXt users <ntg-context@ntg.nl>
Betreff: [NTG-context] Re: Passing the name of an XML file to process via the command line

 

Just coming back to this to say after further testing, for anyone copying in future, actually you can lose some of your setups if you just strip the \starttext \xmlprocessfile ... \stoptext from the environment file completely. Wolfgang's original recipe solves that problem.

 

On Mon, 30 Jun 2025 at 19:51, Duncan Hothersall <dh@capdm.com> wrote:

Thanks both. I stripped out the \starttext \xmlprocessfile ... \stoptext from my tex file and just used the command line invocation as suggested and it worked perfectly. So I've learned two things for the price of one!

 

Thanks again.

 

Duncan

 

On Mon, 30 Jun 2025 at 17:34, Denis Maier via ntg-context <ntg-context@ntg.nl> wrote:

Do you actually need

\xmlprocessfile{...}{\inputfilename}{} 

?

 

I just use 

context --environment=mytexfile myxmlfile.xml

and it works just fine.

Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> hat am 30.06.2025 18:21 CEST geschrieben:

 

 

Am 30.06.2025 um 17:59 schrieb Duncan Hothersall:

Hello list. I feel this should be an easy question to answer but I

couldn't find a hint.

 

I have a ConTeXt file which pulls in an XML file for processing using

the command

 

\xmlprocessfile{mydomain}{myXMLfile.xml}{}

 

I would like instead to call context with the XML file name in the

command line (so that I can use the same ConTeXt setups on multiple XML

sources).

 

How can I do that?

\xmlprocessfile{...}{\inputfilename}{}

 

and process it with

 

context --environment=mytexfile myxmlfile.xml

 

Wolfgang

 

___________________________________________________________________________________

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

 

___________________________________________________________________________________

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

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________