ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* inclusion of tex code in xml context
@ 2013-05-07 12:18 Meer, H. van der
  2013-05-07 17:41 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Meer, H. van der @ 2013-05-07 12:18 UTC (permalink / raw)
  To: NTG ConTeXt

I have some difficulties understanding the intake of ConTeXt-code in an XML processing environment.
The setup is as follows.

\startbuffer[buffername]
\startuseMPgraphic{graphicname}{}
..
\stopuseMPgraphic
\stopbuffer

Processing inside xmlsetup:

\startxmlsetups xmlcommon:mpgraphic
  Here I want to read the buffer and then call it up with
  \useMPgraphic{graphicname}{}
\stopxmlsetups

This works if I pack the graphic definition in the buffer inside a <tex></tex> node and call
  \xmlprocessbuffer{tex}{\xmlatt{#1}{buffer}}{}
where <tex> is a ConTeXt processing setup.

This actuallty works, but has the drawback of putting the ConTeXt code inside <tex></tex> thereby makeing it difficult to reuse the definition of the graphic in a non XML-context. I thus want to get rid of the <tex></tex> enclosure.

I tried things like
  \xmlloadbuffer{tex}{\xmlatt{#1}{buffer}}
  \xmlsetup{tex}{xmlcommon:tex}    <== the tex processing xmlsetups
But this does not work. Because the graphic in this case is not found by \useMPgraphic.
Clearly I am misunderstanding some of the intricacies of the xmlloading macros and probably the solution is quite simple. But I cannot find the right way to do it.
Any help would be appreciated.

Hans van der Meer



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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: inclusion of tex code in xml context
  2013-05-07 12:18 inclusion of tex code in xml context Meer, H. van der
@ 2013-05-07 17:41 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2013-05-07 17:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 5/7/2013 2:18 PM, Meer, H. van der wrote:
> I have some difficulties understanding the intake of ConTeXt-code in an XML processing environment.
> The setup is as follows.
>
> \startbuffer[buffername]
> \startuseMPgraphic{graphicname}{}
> ...
> \stopuseMPgraphic
> \stopbuffer
>
> Processing inside xmlsetup:
>
> \startxmlsetups xmlcommon:mpgraphic
>    Here I want to read the buffer and then call it up with
>    \useMPgraphic{graphicname}{}
> \stopxmlsetups
>
> This works if I pack the graphic definition in the buffer inside a <tex></tex> node and call
>    \xmlprocessbuffer{tex}{\xmlatt{#1}{buffer}}{}
> where <tex> is a ConTeXt processing setup.
>
> This actuallty works, but has the drawback of putting the ConTeXt code inside <tex></tex> thereby makeing it difficult to reuse the definition of the graphic in a non XML-context. I thus want to get rid of the <tex></tex> enclosure.
>
> I tried things like
>    \xmlloadbuffer{tex}{\xmlatt{#1}{buffer}}
>    \xmlsetup{tex}{xmlcommon:tex}    <== the tex processing xmlsetups
> But this does not work. Because the graphic in this case is not found by \useMPgraphic.
> Clearly I am misunderstanding some of the intricacies of the xmlloading macros and probably the solution is quite simple. But I cannot find the right way to do it.
> Any help would be appreciated.

you can look for \xmlcontext and \xmlflushcontext

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-07 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07 12:18 inclusion of tex code in xml context Meer, H. van der
2013-05-07 17:41 ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).