On 8/8/2017 11:37 PM, Pablo Rodriguez wrote:
On 08/08/2017 11:26 PM, Pablo Rodriguez wrote:
On 08/08/2017 10:46 PM, Schmitz Thomas A. wrote:
Hi all,
excellent excuse to pester the list with a program: it’s for my presentation at the ConTeXt meeting (have YOU registered yet?)… So: I want to show verbatim xml, and I’m writing in xml. This solution: http://wiki.contextgarden.net/Verbatim_XML mostly works (for Lua and TeX code), except for one little detail: for verbatim xml, it also prints the <xmlcode> tag. Example: Thomas,
\xmlprettyprint seems an easier approach.
And I don’t know whether there might be a bug here, but your issue arises when it contains XML tags:
Buffer in my previous sample was wrong (I modified something [to check whether the string "xml" was the cause] and I copied the wrong version):
\startbuffer[test] <a> <texcode> \starttext \ConTeXt\ is awesome! \stoptext </texcode>
<xmlcode> <text> <front> ... </front> <body> ... </body> </text> </xmlcode> </a> \stopbuffer
\startxmlsetups xml:testsetups \xmlsetsetup{\xmldocument}{a/xmlcode}{xml:xmlcode} \xmlsetsetup{\xmldocument}{a/texcode}{xml:texcode} \stopxmlsetups
\xmlregistersetup{xml:testsetups}
\startxmlsetups xml:texcode \xmlprettyprint{#1}{none} \stopxmlsetups
\startxmlsetups xml:xmlcode \xmlprettyprint{#1}{none} \stopxmlsetups
\starttext \xmlprocessbuffer{main}{test}{} \stoptext
\startbuffer[test] <a> <texcode> \starttext \ConTeXt\ is awesome! \stoptext </texcode> <xmlcode> <text> <front> ... </front> <body> ... </body> </text> </xmlcode> </a> \stopbuffer \startxmlsetups xml:testsetups \xmlsetsetup{\xmldocument}{a/xmlcode}{xml:xmlcode} \xmlsetsetup{\xmldocument}{a/texcode}{xml:texcode} \stopxmlsetups \xmlregistersetup{xml:testsetups} \startxmlsetups xml:texcode \xmlprettyprint{#1}{tex} \stopxmlsetups \startxmlsetups xml:xmlcode \xmlprettyprint{#1}{xml} \stopxmlsetups \starttext \xmlprocessbuffer{main}{test}{} \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------