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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

Reply via email to