<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText">I did not succeed in on-the-fly loading data from an xml-buffer and subsequently executing its content.<br>
The accompanying minimal example of a <document> shows what I strive to accomplish.<br>
The node <buffer> contains the buffered data (abc meant to be set in bold) and node <getbuffer> executing the typesetting. As can be seen the output the <b>xyz</b> outside <buffer> is correctly set in bold, but the contents of <buffer> is not processed: the
 xml is just reproduced. Obviously there is some misunderstanding on my part.<br>
I would like to be pointed in the right direction.<br>
<br>
Hans van der Meer<br>
<br>
\startbuffer[demo-xml]<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<document><br>
<buffer name="name"><br>
<b>abc</b><br>
</buffer><br>
<!-- other stuff in real application --><br>
<getbuffer name="name"/><br>
<b>xyz</b><br>
</document><br>
\stopbuffer<br>
<br>
\enabletrackers[lxml.loading,lxml.setups]<br>
<br>
\startxmlsetups xml:demo:base<br>
        \xmlsetsetup{#1}{document|buffer|getbuffer|execbuffer|b}{xml:demo:*}<br>
\stopxmlsetups<br>
\xmlregisterdocumentsetup{demo}{xml:demo:base}<br>
<br>
\startxmlsetups xml:demo:buffer<br>
        ... enter <buffer> for "\xmlatt{#1}{name}"\crlf<br>
        \xmltobuffer{#1}{.}{\xmlatt{#1}{name}}<br>
\stopxmlsetups<br>
<br>
\startxmlsetups xml:demo:getbuffer<br>
        ... enter <getbuffer> for "\xmlatt{#1}{name}"\crlf<br>
        \xmlprocessbuffer{}{\xmlatt{#1}{name}}{xml:demo:execbuffer}<br>
\stopxmlsetups<br>
<br>
\startxmlsetups xml:demo:execbuffer<br>
        ... enter <execbuffer>\crlf<br>
        \xmlall{#1}{buffer/*}<br>
\stopxmlsetups<br>
<br>
\startxmlsetups xml:demo:b<br>
        \xmlstripnolines{#1}{.}<br>
        {\bf\xmlflush{#1}}<br>
\stopxmlsetups<br>
<br>
\startxmlsetups xml:demo:document<br>
\writestatus{TEST}{start document}<br>
        start document "\xmldocument"\blank<br>
        \xmlflush{#1}\blank<br>
        stop document "\xmldocument"\blank<br>
\writestatus{TEST}{stop document}<br>
\stopxmlsetups<br>
<br>
\starttext<br>
        \textrule{Demo of buffer: demo.xml}<br>
        ==========\crlf<br>
        \xmlprocessbuffer{demo}{demo-xml}{}<br>
        ==========\crlf<br>
\stoptext<br>
<br>
</div>
</span></font></div>
<div class="BodyFragment"><font size="2"><span style="font-size:10pt;">
<div class="PlainText"><br>
<br>
<br>
</div>
</span></font></div>
</body>
</html>