3

I have an XML file with some elements that should be typeset right-to-left. I use ConTeXt directives to change the typesetting direction. But our web viewer does not seem to like those injections. Is there a way to produce both a PDF and an cleaned up XML (without those injections)?

Here's an MWE with a dummy injector:

\startbuffer[test]
<?xml version="1.0" encoding="utf-8" ?>
<article>
<p>Text.
<?context-directive injector foo ?>
More Text.
</p>
</article>
\stopbuffer

\startxmlsetups xml:test
    \xmlsetsetup{#1}{*}{-}
    \xmlsetsetup{#1}{article|p}{xml:*}
\stopxmlsetups

\xmlregistersetup{xml:test}

% Root
\startxmlsetups xml:article
    \xmlflush{#1}
\stopxmlsetups

% Paragraphs
\startxmlsetups xml:p
    \xmlflush{#1}\par
\stopxmlsetups

\startsetups xml:directive:injector:foo
    FOO:
\stopsetups

\starttext
\xmlprocessbuffer{test}{test}{}
\stoptext

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.