Hi,

 

if I process an XML buffer, I’ve noticed I need to wrap the \xmlprocessbuffer in a \starttext ... \stoptext pair.

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\startbuffer[test]

<?xml version='1.0' standalone='yes?>

<document>

<p>a paragraph of text</p>

<p>another paragraph of text</p>

</document>

\stopbuffer

 

\startxmlsetups xml:demo

\xmlsetsetup{\xmldocument}{document|p}{xml:*}

\stopxmlsetups

 

\xmlregistersetup{xml:demo}

 

\startxmlsetups xml:document

  \xmlflush{#1}

\stopxmlsetups

 

\startxmlsetups xml:p

  \xmlflush{#1}\endgraf

\stopxmlsetups

 

\starttext

  \xmlprocessbuffer{test}{test}{}

\stoptext

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

However, if I have the XML and the setups in dedicated files, there seems to be no need for \starttext ... \stoptext.

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% text.xml

<?xml version='1.0' standalone='yes?>

<document>

<p>a paragraph of text</p>

<p>another paragraph of text</p>

</document>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% setups.tex

\startxmlsetups xml:demo

\xmlsetsetup{\xmldocument}{document|p}{xml:*}

\stopxmlsetups

 

\xmlregistersetup{xml:demo}

 

\startxmlsetups xml:document

  \xmlflush{#1}

\stopxmlsetups

 

\startxmlsetups xml:p

  \xmlflush{#1}\endgraf

\stopxmlsetups

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

Running

context text.xml –environment=setups.tex

gives me a proper PDF without errors.

 

Therefore my question:

Does the use –environment automatically wrap the processed file in \starttext ... stoptext ?

 

If not, what’s the reason for this behaviour? Am I missing something?

 

Best,

Denis