Alas, this does not solve the problem, iff I am following your suggestion correctly.
I did
\xmlloadbuffer{thebuffer}{\xmlatt{#1}{buffer}}
\xmlfilter{thebuffer}{*/context()}
\useMPgraphic..
This works for a buffer content enclosed in any node:
\startbuffer[ychannel]
<anyone> <========= cannot be omitted
\startuseMPgraphic{}{}
..
\stopuseMPgraphic
</anyone> <========= cannot be omitted
\stopbuffer
But it does not work when the content is not enclosed in a node, which is my input case:
\startbuffer[ychannel]
\startuseMPgraphic{}{}
..
\stopuseMPgraphic
\stopbuffer
Now the xml is judged invalid by running it.
In the case of a file there is a circumvention through directlua. There I can os.execute a chain of commands: echo "<node>" >tmp;cat file >>tmp;echo "<node>" >>tmp and then \xmlprocessfile the tmp. A bit of a kludge, I am ready to admit, but working. But I don't see how to do this with buffers.
Hans van der Meer
On 7 May 2013, at 7:39 PM, Hans Hagen